Skip to content
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

Document that single language specific settings take precedence over multi language specific settings #7773

Open
adusamr opened this issue Nov 9, 2024 · 3 comments
Assignees

Comments

@adusamr
Copy link

adusamr commented Nov 9, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.95.2 (user setup)
  • OS Version: Windows_NT x64 10.0.22631

defaultSettings.json is like this:

{
	"editor.unicodeHighlight.ambiguousCharacters": true,
	"editor.unicodeHighlight.invisibleCharacters": true,
	"[markdown]":  {
		"editor.unicodeHighlight.ambiguousCharacters": false,
		"editor.unicodeHighlight.invisibleCharacters": false,
	}
}

In user's settings.json,

{
	"editor.unicodeHighlight.ambiguousCharacters": true,
	"editor.unicodeHighlight.invisibleCharacters": true,
}

or

{
	"[markdown][plaintext]":  {
		"editor.unicodeHighlight.ambiguousCharacters": true,
		"editor.unicodeHighlight.invisibleCharacters": true,
	}
}

do not overwrite these settings in markdown.
Only

{
	"[markdown]":  {
		"editor.unicodeHighlight.ambiguousCharacters": true,
		"editor.unicodeHighlight.invisibleCharacters": true,
	}
}

can overwrite these settings.

I don't know whether this happens for other settings.
I found this when testing microsoft/vscode#233503 (comment)

@sandy081
Copy link
Member

@adusamr It is not clear to me from the issue description what is expected and what is actually happening. Can you please update the issue and let us know what you expect and what you are observing. Thanks.

@sandy081 sandy081 added the info-needed Issue requires more information from poster label Nov 12, 2024
@adusamr
Copy link
Author

adusamr commented Nov 12, 2024

I read https://code.visualstudio.com/docs/getstarted/settings and now I understand a part of the issue was documented behavior.

Then the real problem or undocumented behavior is "single language-specific settings is preceding to multiple language-specific settings" even if the single language-specific settings are default settings and the multiple language-specific settings are user settings.

Image
The defaultSettings.json is:

{
	"editor.fontSize": 14,
	"editor.wordWrap": "off",
	"[markdown]":  {
		"editor.wordWrap": "on"
	}
}

In the image, the right column is user's settings.json.

The middle column is plaintext and its font size is 20 and word wrap is off. The "[markdown][plaintext]" user settings is correctly working.

The left column is markdown.
Its font size is 8, which means the "[markdown]" user settings is preceding to the "[markdown][plaintext]" user settings.
And word wrap is on, which means the "[markdown]" default settings is preceding to the "[markdown][plaintext]" user settings.

If you uncomment the "editor.wordWrap": "off" line in the "[markdown]" user settings (and reopen markdown.md), now you can see word wrap is off.

@sandy081
Copy link
Member

Yes, single language specific settings takes precedence over multiple language specific settings. I will move this to our docs repo to make sure it is documented.

@sandy081 sandy081 changed the title Cannot overwrite file type specific settings unless exactly specify that file type Document that single language specific settings take precedence over multi language specific settings Nov 13, 2024
@sandy081 sandy081 removed the info-needed Issue requires more information from poster label Nov 13, 2024
@sandy081 sandy081 transferred this issue from microsoft/vscode Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants