Load VS Code with the extension installed and it will show this on the console:
Then, the language override setting for that dotted language does not work and it falls back to the default setting.
Investigation:
The issue happens when the updateValue() method from the configurationModels.ts tries to access the this.contents object with an non-existing key, the actual reason why that happens is because the key with the name of the language that should be [lldb.disassembly] of the this.contents object gets split by the addToValueTree() method that creates a nested object for dotted settings, such as "editor.tabSize".
Hopefully, this image helps in understanding the issue:
Possible solution:
I believe this could be solved by adding a check the verifies if the key being added is a language id. Something like if (OVERRIDE_PROPERTY_REGEX.test(key)) {
Since, if the key is a language identifier key, I assume there won't be any need to split since it won't ever be a dotted setting, such as editor.tabSize.
I have a fix that seems to work locally, but would like to hear your thoughts before creating a PR.
Do you see any other issues with having dotted languages, such as lldb.disassembly?
I could not find any resources explicitly disallowing it, and we have been using it internally without any issues, but this bug was quite tricky to discover and it caused language overrides to not work at all.
Does this issue occur when all extensions are disabled?: Yes (kinda)
Steps to Reproduce:
lldb.disassembly
package.json
.Then, the language override setting for that dotted language does not work and it falls back to the default setting.
Investigation: The issue happens when the updateValue() method from the configurationModels.ts tries to access the
this.contents
object with an non-existing key, the actual reason why that happens is because the key with the name of the language that should be[lldb.disassembly]
of thethis.contents
object gets split by theaddToValueTree()
method that creates a nested object for dotted settings, such as "editor.tabSize".Hopefully, this image helps in understanding the issue:
Possible solution: I believe this could be solved by adding a check the verifies if the key being added is a language id. Something like
if (OVERRIDE_PROPERTY_REGEX.test(key)) {
Since, if the key is a language identifier key, I assume there won't be any need to split since it won't ever be a dotted setting, such as
editor.tabSize
.I have a fix that seems to work locally, but would like to hear your thoughts before creating a PR. Do you see any other issues with having dotted languages, such as
lldb.disassembly
? I could not find any resources explicitly disallowing it, and we have been using it internally without any issues, but this bug was quite tricky to discover and it caused language overrides to not work at all.