Open BoykoAlex opened 5 hours ago
You prob need to enable "strings": true
under "editor.quickSuggestions"
in package.json
This will enable completion triggers within strings
based on your "wordPattern"
in language-configuration.json
"configurationDefaults": {
"[sample-properties-yaml]": {
"editor.quickSuggestions": {
"strings": true
}
}
}
idk why some letters work but not others
Wow... thanks a lot. I would never be able to guess that :-) It did help and I think this can be resolved now - thanks again!
The issue is that if trigger chars are all alphabetic chars for instance only a few of them do trigger completion proposal computations. The only trigger char that works is 'y' bringing up 3 completions starting with `y'. If you try 's', 'd', 'm' which also have 3 completion proposals starting with these chars the completion proposal computation (completion provider) is never invoked. Seems random really.
Here the repo demonstrating the issue: https://github.com/BoykoAlex/vscode-extension-samples/tree/triggerchars-yaml-completions. It is a fork of VSCode's extension samples. The completions-sample is the one modified. The branch is triggerchars-yaml-completions
Essentially the extension contributes a new language
sample-properties-yaml
and the grammar for the language which is really the YAML grammar.The grammar piece seems to be critical. Snippet from
package.json
The
sample-properties-yaml.tmLanguage.json
:If the grammar is not defined for the language then completion proposals show up fine for all trigger chars. The syntax highlighting is lost however. Feels, therefore, that the issue is related to the grammar definition of the yaml based language.