Does anyone happen to know how VSCode behaves when multiple extensions provide a language configuration file for the same language via the contributes.languages contribution point?
I'm simply trying to add an auto-closing pair to a language in my extension, however, there is at least one other active extension (that every user of my plugin is likely to have as well) that provides its own config for this language.
Is it one-or-the-other? If so, based on what? The docs suggest multiple configs are OK since it says the contribution point also acts as a way to "enrich" VSCode's knowledge of a language, but I can't seem to get my extension to add an auto-closing pair.
I'm certain I'm using the correct language ID (the ID that the other extensions configuring this language use) as well as extensions.
If it should just allow me to extend the language's configuration, should I only provide ONLY the information that I need in the language-configuration.json file? For example:
{
"autoClosingPairs": [
{ "open": "/**", "close": " */", "notIn": ["string"] }
]
}
If all of this makes sense, and the contribution is not working, does anyone have any suggestions to debug the issue? Thanks in advance.
Ok, if anyone else ever happens to be struggling with this (unlikely given the amount of attention this question has received :) Oh, well.), your problem could be the publisher key in the package.json manifest.
After grasping at straws for days, I finally started experimenting with things that made no sense and seemingly should have no effect on this. So I started removing VSCode extension related keys from my package.json, and sure enough, when I reached publisher, voilà! My language config finally took.
My initial hypothesis on the 'why?', was that vscode was registering extensions alphabetically behind the scenes, and the publisher of the other extension probably came before my publisher name. But alas, my publisher name was dubs-dev-extensions and the publisher name of the competing extension which also configures the language in question was salesforce, so there goes that hypothesis. Furthermore, when I decided to change my publisher name to see what happened, I chose peter-weinberg, and this also worked (so it worked with no publisher key, and with the new publisher name). Both peter-weinberg and dubs-dev-extensions come before salesforce, so alphabetical was def not the answer. As of the time of writing this, I am stumped, and will try to report to vscode as a bug, and if it's not, at least I'll hopefully get some explanation as to why I've experienced this strange behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With