Open ssilva opened 6 years ago
It would be better to use different icons (not only "[abc]") to show different header levels.
Maybe the icons could be reserved for a feature which separated different markdown components (links, tables, code blocks, etc...) but having the '#' definitely seems unnecessary.
I support this feature request: Displaying markdown hashes in the outline view is not only redundant (the tree structure already holds this information), but also distracts from the actual content (the section title).
we need a custom outline view just for markdown files
It seems like this was done totally on purpose. Since i cannot estimate the side effects besides the display in the outline i won't file a merge request. But i think we could just remove getSymbolName
and replace it with entry.text
in two places here:
and then getSymbolName
is also obsolete.
I changed the getSymbolName function in resources\app\extensions\markdown-language-features\dist\extension.js to remove '#' char as a workaround.
getSymbolName(e){return" ".repeat(e.level)+e.text}
This is what I've been using for a while.
I extended pisces312's idea with the following.
%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\markdown-language-features\dist
(Windows)getSymbolName
function with the following:
getSymbolName(e){ var symbol = { "1": "β¬", "2": "π₯", "3": "π§", "4": "π¨", "5": "π©", "6": "π¦", "7": "πͺ", "8": "π«", }; if (1 <= e.level && e.level <= 8) { return symbol[e.level] + " " + e.text; } return "#".repeat(e.level) + " " + e.text; }
Prettier version:
getSymbolName(e){
var symbol = {
"1": "β¬",
"2": "π₯",
"3": "π§",
"4": "π¨",
"5": "π©",
"6": "π¦",
"7": "πͺ",
"8": "π«",
};
if (1 <= e.level && e.level <= 8) {
return symbol[e.level] + " " + e.text;
}
return "#".repeat(e.level) + " " + e.text;
}
Screen shot of how it'll look like:
@pisces312 answer should at least be implemented as a config option.
Here's a visual comparison showing how much more "clutter" the unnecessary #
's create:
I also don't like the '#
with outline, and I also don't want change the native source code file with VSCode or extensions .
So, I temporarily use Emoji to better distinguish the headers level, this:
And, I really want an option to hidden #
π
Just ran across this - I wholeheartedly agree that this should be at least a setting; the hash chars don't add anything the indentation doesn't already address.
extension.js
no longer has the getSymbolName
function. Is there anyone who knows other way to remove the annoy "#"? @pisces312 , @koffeeboi , @ckosmowski
After some file content search, I found now we need to modify resources\app\extensions\markdown-language-features\server\dist\node\main.js
instead of extension.js
.
And the function name changes from getSymbolName
to getTocSymbolName
.
We can still use the original way to modify it.
After some file content search, I found now we need to modify
resources\app\extensions\markdown-language-features\server\dist\node\main.js
instead ofextension.js
. And the function name changes fromgetSymbolName
togetTocSymbolName
. We can still use the original way to modify it.
I just got the same issue and found you have figured out the solution. :)
Would also be nice if we could hide syntax like **bold**. It's just more noise if not actively styling text
Have we solved this problemοΌIt's been many yearsγγγ
Related question on Stack Overflow:
From v1.76.0 file is: resources\app\extensions\markdown-language-features\server\dist\node\workerMain.js
Function: getTocSymbolName
I agree that the hash chars add unnecessary clutter to the outline view. It would be awesome to have a setting for this
This is especially frustrating as a Portable Mode user. Having to go in and manually make this change every time I upgrade VSCode is a chore.
May 2024 and this is still an issue with VSCode 1.89.0. Seems the function has again changed names. It's no longer #getTocSymbolName(e)
now it's just #se(e)
- ignoring the function name, just searching the workerMain.js file for:
{return"#".repeat(e.level)+" "+e.text}
and replacing it with:
{return" ".repeat(e.level)+e.text}
still applies the fix.
I'm using 1.92.1 on macOS. What would be the path and file that is equivalent to resources\app\extensions\markdown-language-features\server\dist\node\workerMain.js
?
I've found this path:
/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist
Which contains a serverWorkerMain.js
file. That file includes the text that @nonplayer says should be replaced, but replacing it doesn't fix the issue.
Do I need to do something else (beyond restarting VSCode) to get the change to register? Or am I editing the wrong file?
I'm using 1.92.1 on macOS. What would be the path and file that is equivalent to
resources\app\extensions\markdown-language-features\server\dist\node\workerMain.js
?I've found this path:
/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist
Which contains a
serverWorkerMain.js
file. That file includes the text that @nonplayer says should be replaced, but replacing it doesn't fix the issue.Do I need to do something else (beyond restarting VSCode) to get the change to register? Or am I editing the wrong file?
Coincidentally, I just today updated and just now came here to post that the file had again changed location to: .\resources\app\extensions\markdown-language-features\distserverWorkerMain.js
However I didn't encounter the same trouble you are reporting. I was able to do a find and replace, finding the same string as previous:
{return"#".repeat(e.level)+" "+e.text}
and replacing it with:
{return" ".repeat(e.level)+e.text}
Saving and re-opening VSCode applied the fix for me as expected. However, I'm on Windows, maybe that makes a difference somehow?
I'm quite befuddled as to why they have not fixed this obvious bug yet.
The Outline view for Markdown already displays headers and sub-headers in a structured way; there is no need to pollute the view with "#"s to show the header levels.