vscode-markdown
vscode-markdown copied to clipboard
"markdown.extension.toc.levels" is ignored when using multi-root workspace
What's the problem
When I add multiple folders to a Visual Studio Code workspace, I expect to settings from particular folder .vscode/settings.json
be respected. This does not happen for markdown.extension.toc.levels
.
What's the expected result
Markdown All-In-One should respect per-folder TOC level settings in multi-root workspace.
Maybe also other Markdown All-In-One settings should do that.
How to reproduce
- Create two folders, each containing a Markdown file with multiple header levels: with
##
,###
and####
headers - Open first folder in vscode and generate the TOC. It will just contain contain all header levels
- Open second folder in vscode, set in
.vscode/settings.json
: `"markdown.extension.toc.levels": "2..3" and generate the TOC - Note that the TOC correctly contain only H2 and H3 levels
- Now open new Visual Studio Code instance, and add both folders to new workspace using File → Add Folder to Workspace...
- Update Table of Contents in both files
-
Note that in the second folder, the TOC is regenerated with all header levels, even though the
.vscode/settings.json
is set just to H2 and H3
Other information
I do not know the topic, but looks like it happens because:
-
markdown.extension.toc.levels
inpackage.json
does not setscope
property, which then defaults to window. -
window scoped settings in multi-root workspaces are ignored
I hope this setting can be changed to be resource
. Maybe some others also should.