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

Renaming optional models also includes `?` in input field, causing trouble

Open janpio opened this issue 4 years ago • 1 comments

image (Hit "F2" on TestPartent)

If you then change it to FooBar? as you want to rename it to that and not loose the ?, this is the result: image

If you change it to FooBar it does the right thing though - which is also unexpected because the ? was originally part of the input field.

Originally reported by @aqrln

janpio avatar Sep 07 '21 10:09 janpio

Can reproduce, example

/// multi line
/// commennttt
model Foo {
  id     Int @id
  bar    Bar @relation(fields: [bar_id], references: [id])
  bar_id Int @unique
}

model Bar {
  id  Int  @id
  foo Foo? // rename Foo here
}

Jolg42 avatar Mar 15 '22 15:03 Jolg42