-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Improve contextual completions #53554
Improve contextual completions #53554
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
//// | ||
//// test({ foo: ['a', /*ts*/] }) | ||
|
||
verify.completions({ marker: ["ts"], includes: ['"a"', '"b"'], isNewIdentifierLocation: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't exactly understand what isNewIdentifierLocation
is about. It's true
for most of the added test cases but false
for object property values. Is this correct? What's the difference between an object property value and an array element's locations? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is it's just a bad heuristic that could be patched up?
For reference, it's discussed a bit here: #42595 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look into this in a separate PR - it would be cool to have this consistent.
😅 I'm a fortune teller. Do you fancy a palm reading? I can do that for you. |
I asked ChatGPT how to fix my issue but it was so late last night that I was in fact sending prompts to @Andarist in Discord DM. 😂 |
This PR is meant to bring "regular" completions closer to how equivalent~ string completions work. To get a better grasp of what that means you can look into the changed tests that have
ts
(within string/quotes) andts2
(at the same position but not within quotes) markersfixes #53555