vscode-code-outline
vscode-code-outline copied to clipboard
Golang code represented as list not as tree
VSC 1.20.1 See only sorted list of golang symbols. No nesting.
It's only sorted when "symbolOutline.doSort" is set to true.
How would you expect the code to be nested? For me it is shown as a tree, albeit a pretty boring one: The package is the root node and all other symbols are leafes. But that's how go code is structued, there are no namespaces or classes that wrap parts of the code. All variables, types, functions etc. are on the same level. So I personally wouldn't expect it to be any different.
Ok, but if we have much symbols in file there is difficult to keep attention for specific. So packing to the tree seems right. There is opened https://github.com/Microsoft/vscode/issues/5605 issue about it in vscode with long discussion about it.
Sorry, seems misunderstanding. There is no expand nodes as classes, variables, etc. Only one long list with all symbols.
"symbolOutline.expandNodes": [
"Module",
"Class",
"Interface",
"Namespace",
"Object",
"Package",
"Struct"
],
ignored in golang file
If you only get a single flat list then I suggest that you open an issue with the Go extension.