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

LSP: intellisense inserts ? after every completion #9920

Closed
lucacasonato opened this issue Mar 28, 2021 · 5 comments · Fixed by #9951
Closed

LSP: intellisense inserts ? after every completion #9920

lucacasonato opened this issue Mar 28, 2021 · 5 comments · Fixed by #9951
Assignees
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@lucacasonato
Copy link
Member

All completions for optional fields of an object insert a ? after the property name in the completion. Issue here is likely that completion label should have the ? to mark that the completion is optional, but the actual edit text should not. Present in canary. Was introduced very recently, likely in #9789

@lucacasonato lucacasonato added bug Something isn't working correctly lsp related to the language server labels Mar 28, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Mar 28, 2021

Could you give a more specific example of what is/isn't working so I can reproduce it?

@lucacasonato
Copy link
Member Author

lucacasonato commented Mar 28, 2021

issue.mp4

That question mark after object.bar shouldn't be added

@elisee
Copy link
Contributor

elisee commented Apr 7, 2021

Using latest canary, although the base bug is fixed, intellisense inserts an extra ? when completing further:

question-mark

Possibly that's on purpose since a is null in this case? But the regular TypeScript extension doesn't do that and it feels weird to have a ? inserted on the parent property for me when autocompleting a child property (if I wanted it, I would have put it myself)

@kitsonk
Copy link
Contributor

kitsonk commented Apr 7, 2021

That it what it is supposed to do, because a maybe undefined. I'm pretty sure the regular TypeScript extension would do this too.

@elisee
Copy link
Contributor

elisee commented Apr 7, 2021

Ah, indeed. The TypeScript extension doesn't do it by default, which is why I found it strange, but I've just tested by explicitly setting "strict": true in tsconfig.json file and now it does. Since Deno has strict enabled by default, I guess that explains it. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly lsp related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants