Closed memeplex closed 7 months ago
I don't think this behavior is convenient or intuitive
According to https://code.visualstudio.com/docs/getstarted/settings#_settings-precedence it's indeed a bug:
In the following list, later scopes override earlier scopes: ... Language-specific default settings - These are language-specific default values that can be contributed by extensions.
Language-specific user settings - Same as User settings, but specific to a language.
There is no distinction between single/multi language setting.
Later in the doc:
"[typescript][javascript]" workspace setting will not override a "[javascript]" user setting.
I guess the logic for single-overrides-multi is not making this distinction:
I am not sure if I understood the issue. Can you please be crisp and clear about the issue?
TBH I'm not sure about what do you expect since I've already given a concrete example, some links to points where the documentation contradicts what's observed and an analysis of what may be the cause, so at the risk of repeating myself consider the following scenarios:
opt
for a specific language lang1
: "[lang1]": ...
.opt
for lang1
and some other language: "[lang1,lang2]": ...
opt
in lang1
Currently 1 will override 2 and 3 as expected, but 3 will override 2. This is arguably wrong and doesn't follow the documented behavior as I mentioned before:
According to https://code.visualstudio.com/docs/getstarted/settings#_settings-precedence
In the following list, later scopes override earlier scopes: ...
- Language-specific default settings - These are language-specific default values that can be contributed by extensions.
- Language-specific user settings - Same as User settings, but specific to a language.
Currently 1 will override 2 and 3 as expected, but 3 will override 2.
This seems to be contradicting your statement. If one overrides 2 and 3 and how 3 can override 2? Hence, I am asking for repro steps
I don't see the problem, 1 overrides 3 overrides 2, so 1 overrides both of them.
I don't see the problem
Then what is the problem? To get rid of confusion, please provide clear steps to reproduce with a concrete example and what is current behaviour and what do you expect?
I've thoroughly explained everything. The problem is in 3 overrides 2, of course. As I've defined:
- The user sets opt for lang1 and some other language: "[lang1,lang2]": ...
- An extension sets a default value for opt in lang1
I'm going to spell "3 overrides 2": A default value set by an extension for a language overrides a value set by the user for the same language (alongside another language, as in [lang1,lang2]
).
But, for the third time, the documentation states:
In the following list, later scopes override earlier scopes: ... Language-specific default settings - These are language-specific default values that can be contributed by extensions. Language-specific user settings - Same as User settings, but specific to a language.
If you don't see the contradiction in that, then I don't have anything else to add.
I'm going to spell "3 overrides 2": A default value set by an extension for a language overrides a value set by the user for the same language (alongside another language, as in [lang1,lang2]).
This should not happen, if an extension contributes default value for a language and user also defines a value for the same language, then user value should be taken. If this is not happening, I would request to provide proper step by step set up for me to reproduce. Giving steps will help both of us to be on same page.
I've provided an example in the opening post, but then again:
Put this into your settings:
"[markdown][latex]": {
"editor.wordWrap": "bounded",
},
Create and open a markdown file
See how wordWrap is not bounded
Change the settings to:
"[markdown]": {
"editor.wordWrap": "bounded",
},
See how wordWrap is now bounded
/duplicate
https://github.com/microsoft/vscode/issues/168411
Thanks, this is helpful. Now I understand that settings of single language in default settings is overriding settings of multi language in user settings.
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.
Happy Coding!
Default language specific settings override explicit multiple language settings.
For example:
tabSize
only for markdownwordWrap
for none of themAt least regarding
wordWrap
I know it's set as a language default. Moreover, after separately setting the same options for both languages, all of them are correctly configured.I don't think this behavior is convenient or intuitive. Explicitly set options, even if they are for a union of languages, should override implicit default ones.