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

Automatically resolves with arguments even though it wasn't accepted with Tab #151

Open
svipas opened this issue Jul 11, 2023 · 5 comments

Comments

@svipas
Copy link

svipas commented Jul 11, 2023

Even though I don't accept new URL| (| - cursor) it automatically resolves to new URL((url)).

So then I write new URL( it becomes this:

const url = new URL((url))'http://example.com'

The question is, why it adds additional () around url and why it resolves even though I didn't accept it with Tab?

BTW: I tested same happens with JSON.parse, etc. it is just enough to add ( and it automatically resolves.

image image
@svipas
Copy link
Author

svipas commented Jul 11, 2023

Maybe it's related a little bit to: #142?

@zardoy
Copy link
Owner

zardoy commented Jul 11, 2023

See microsoft/vscode#42544

Its also painful to write ... without shortcut inside objects (microsoft/TypeScript#27623)

@zardoy
Copy link
Owner

zardoy commented Jul 11, 2023

The question is, why it adds additional () around url and why it resolves even though I didn't accept it with Tab?

You can disable it with "editor.acceptSuggestionOnCommitCharacter": false

@zardoy
Copy link
Owner

zardoy commented Jul 11, 2023

const url = new URL((url))'http://example.com'

However I'm not sure how 'http://example.com' inserts after `((url))``

Also, if you still prefer to use commit characters I think we can add a workaround for this issue

@svipas
Copy link
Author

svipas commented Jul 12, 2023

Yeah if I disable it with "editor.acceptSuggestionOnCommitCharacter": false it works, but if I disable methodSnippetsInsertText it works as expected even with acceptSuggestionOnCommitCharacter enabled and it completes function arguments and fixes the problem with for e.g. new URL( except that I don't see all arguments in suggest widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants