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

Provide way for a language to re-enable editor.quickSuggestions inside of a string or comment #34857

Closed
mjbvz opened this issue Sep 22, 2017 · 3 comments
Assignees
Labels
languages-basic Basic language support issues on-testplan plan-item VS Code - planned item for upcoming
Milestone

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 22, 2017

Problem
Many languages allow embedding language fragments inside of strings. In JavaScript for example:

`Max int: ${Number.MAX_SAFE_INTEGER}`

While typing within the ${...} however, we do not show quick suggestions. The root cause is that the template expression is within a string, and the editor.quickSuggestion.strings setting explicitly disable quick suggestions within strings.

Proposal
We now have a convention of marking languages embedded within strings with the meta.embeded scope. This could be used to reset the quick suggestions scopes.

Here's the scope of the above code:

screen shot 2017-09-22 at 2 35 25 pm

In this stack, we'd first see string.template which would disable quick suggestions. Then, further up the stack, we see meta.embedded which would reset the quick suggestion mode.

@mjbvz mjbvz self-assigned this Sep 22, 2017
@mjbvz mjbvz changed the title Provide way for a language to re-enable editor.quickSuggestions inside of a string Provide way for a language to re-enable editor.quickSuggestions inside of a string or comment Sep 22, 2017
@mjbvz mjbvz added the languages-basic Basic language support issues label Sep 22, 2017
@mjbvz
Copy link
Collaborator Author

mjbvz commented Sep 22, 2017

Actually that proposal may not work since we only enter the meta.embedded scope after the first character has been typed. We'd have to make sure quick suggestions checks the token type after the character is entered when it decided to trigger or not

Edit
Nevermind, I think #34863 is actually what was causing the odd behavior

@alexdima
Copy link
Member

@mjbvz Not sure if this issue should be automatically closed. Leaving it up to you. The PR is in and published, and vscode-textmate updated in vscode.

@mjbvz
Copy link
Collaborator Author

mjbvz commented Oct 30, 2017

Thanks @alexandrudima!

Yes there are still a few edge cases to handle still but the original issue has been addressed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
languages-basic Basic language support issues on-testplan plan-item VS Code - planned item for upcoming
Projects
None yet
Development

No branches or pull requests

2 participants