language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

bug: config value completions should only trigger after `=`

Open Druue opened this issue 2 years ago • 0 comments

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 avatar Mar 16 '23 10:03 Druue