Closed thufschmitt closed 2 weeks ago
I think this can be considered closed by #1940, which makes a separation between names in the environment and record fields.
The current situation isn't perfect because it doesn't understand the order of merges, or the difference between contracts and merges. So for example, it will still suggest foo
in
({ <CURSOR> } | { bar | Number }) & { foo = 1 }
Describe the bug
When a completion is triggered while declaring the name of a record field, the LSP will suggest known fields based on the contract/type/merges for the record (which is awesome), but also based on the variables in scope. This is annoying since
To Reproduce
Triggering the completion will suggest
foo
(andstd
), but there's no particular reason for it to be relevant.A side-effect (motivating the 2. annoyance) is that
will suggest
foo
, while puttingfoo
here will break the contract.Expected behavior
Only suggest based on the type/contract/merge
Environment
Additional context