vscode-code-outline icon indicating copy to clipboard operation
vscode-code-outline copied to clipboard

Golang code represented as list not as tree

Open kv-gits opened this issue 7 years ago • 4 comments

VSC 1.20.1 See only sorted list of golang symbols. No nesting.

kv-gits avatar Feb 17 '18 14:02 kv-gits

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.

reusing-code avatar Mar 05 '18 16:03 reusing-code

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.

kv-gits avatar Apr 03 '18 04:04 kv-gits

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

kv-gits avatar Apr 03 '18 04:04 kv-gits

If you only get a single flat list then I suggest that you open an issue with the Go extension.

patrys avatar Apr 03 '18 08:04 patrys