oleg-shilo / codemap.vscode

Code map (syntax tree) of the active document
MIT License
84 stars 28 forks source link

Tab indented files show flat tree #48

Closed setnone closed 3 years ago

setnone commented 4 years ago

Hi, thanks for the great extension!

I'm trying to make a simple custom mapper for my html files:

"codemap.html": [{
    "pattern": "<[a-z][^<>]*(?:(?:[^/]\\s*)|(?:\\s*[^/]))>",
    "icon" : "function"
}]

With my files being indented with tabs i get the folowing results: tree stays flat after the first level.

tabs

When i change indentation to spaces the tree structure is correct:

spaces

Is there a way to use tabs with proper tree structure?

oleg-shilo commented 4 years ago

No there is none. :(

Tree view rendering algorithm does not allow whitespaces. You can cheat by using a non whitespace character that VSCode will not trim.

image

However I recommend to disable textmode : image

It was introduced a s a workaround for TreeView defect, which VSCode team now fixed.

Thus if you start using normal TeeView rendering the indentation will no longer be an issue