Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: config value completions should only trigger after = #1393

Open
Druue opened this issue Mar 16, 2023 · 0 comments
Open

bug: config value completions should only trigger after = #1393

Druue opened this issue Mar 16, 2023 · 0 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: autocompletion LSP text document completion

Comments

@Druue
Copy link
Contributor

Druue commented Mar 16, 2023

Bug description

Property value completions can trigger anywhere after the name, which can be before the = sign :: This is an issue with find_at_position and would probably require changes in the PEST grammar to include having the = as an identifiable piece in the parser for config blocks.
image

How to reproduce

  1. Open a schema
  2. Trigger a completion after a prop name (e.g. directUrl) but before =
  3. See completions for "" or env()

Prisma information

datasource db {
  provider = "postgresql"
  url = env("DATABASE_URL")
  directUrl <|> =
}

Environment & setup

  • OS: macOS
  • Database: N/A
  • Node.js version: N/A

Prisma Version

4.11 / insider

Expected Fix

PSL will need the ability to parse = as an expression so that we can match positions after it.

Changes expected in datamodel.pest, datasource_loader (and the other loaders), and find_at_position.rs

@Druue Druue added bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. topic: autocompletion LSP text document completion labels Mar 16, 2023
@janpio janpio transferred this issue from prisma/prisma Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/bug A reported bug. tech/engines/datamodel Issue about parsing/validation/rendering of the Prisma schema topic: autocompletion LSP text document completion
Projects
None yet
Development

No branches or pull requests

1 participant