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
Tab does not work as a trigger character for #89826
Comments
Yeah, that kinda wanted because using space, newline, and tab is a bit of an anti-usage of trigger characters. What is you use-case for this? What language needs such trigger characters? |
My use case is autocompletion for yaml. Since yaml is whitespace significant, the autocompletion needs to suggest different options depending on indentation levels. |
That I understand, but all the whitespace and indentation levels are inside the document that you receive when being triggered (in whatever way). Tho, I do wonder if yaml users expect that IntelliSense is triggered by whitespace... Our intent for them is to trigger exclusive completions in cases like member completion, e.g |
I guess it's a question of whether VS Code should block tab as a trigger character because it isn't desirable in the vast majority of use cases, even if there may be some rare cases where it would be useful. I'd advocate for VS Code leaving that decision up to extension authors rather than simply preventing the option outright. |
It's not that we are blocking anything but tab doesn't reach us like other characters do. To implement trigger characters we have a "typing listener" which spies on what's being typed. Pressing tab, doesn't perform a type-operation but a more complex insert operation because pressing tab might mean "insert 4 spaces", "insert 2 spaces", "insert \t" etc. That's why we are bling on that eye. Rephrasing my question, what is a good sample yaml-snippet in which tab should trigger completions (from only your provider)? |
- someObject:
| In the above example, imagine I have just tabbed to the pipe character. |
@jrieken Does my use case with flowtype above ☝️ give reason to implement this change? |
Ran into the same issue. We're trying to trigger completions for yaml files when tab is hit |
Steps to Reproduce:
Register a CompletionProvider with tab (
\t
) as a trigger character:In the above example, the space and new line characters successfully trigger my completion provider, but not tab. This is the case whether my text editor is using tabs or spaces.
The text was updated successfully, but these errors were encountered: