vscode-code-outline
vscode-code-outline copied to clipboard
Is it possible to disable expand/collapse on click?
I click on tree nodes to jump to the source code in my editor, but when I do, it expands the tree even when I don't click on the collapse arrow (i.e. just when I click on the name of the thing I want to jump to). This means I end up with tons of expanded things in my code outline, or that I have to click extra times to collapse them again after I expand them.
I think it would be better to only expand when clicking on the arrow to explicitly expand the item. If that's unacceptable, a configuration option to disable it would also help.
Unfortunately that is a problem with how VSCode currently implements tree views 😞
Any [hope for] progress now? Any workaround not to use tree view then? For example, I need only function names to see. So, I tried:
"symbolOutline.expandNodes": [],
"symbolOutline.sortOrder": [
"Function",
],
but...it has no effect :D Functions still expanding and not only items in outline :(
I also use Code Outline for its table of contents of functions and methods, as a way to quickly jump to the right place in my code. Expanding the tree view interrupts this process, somewhat.
Would it be possible to add a config that causes the tree view to be populated with only the function name (so no disclosure widget)? It would be worthwhile (to me) to lose the ability to expand function names if it meant an easy way to jump straight to a function without the extra scrolling that an expanded tree view requires. Maybe "symbolOutline.expandNodes": false
?
Edit: I was able to hack this change by commenting out parent.addChild(currentNode);
at line 123.
set the following setting and it will stop expanding folders on singleClick "workbench.list.openMode": "doubleClick"
This seems worse to me as a solution, because you still need to double click to navigate to that section, and I prefer single click in the other explorer tabs personally. I could see this working if:
- Code Outline can have a setting that enables this for just its section
- Single clicking can still be detected, and this will navigate the user to the desired location