vscode-code-outline
vscode-code-outline copied to clipboard
Feature Request: Detect and fold Import Statements
Really nice add-on, the first of its kind that really works for me! Has the potential to be a major game changer for VSCode in my opinion.
One thing that I would like to see is a smart detection of import statements for JavaScript and TypeScript files. Those statements should receive a different icon than, say, a constant, should be grouped together in a single tree node and folded by default.
I do realize that this will be a lot more difficult for JavaScript and Typescript than other languages (like Java), because imports can theoretically appear in any place in the file, and distinguishing an import from a constant declaration based on the AST could be difficult. But this would really be a great feature.
This would be nice to have but to do it properly I will need VSCode to know that a symbol comes from an import. I'll open an issue there.
Related: https://github.com/Microsoft/vscode/issues/28649
The upstream issue was closed because they aren't planning to do it in the next 6-12 months. Sad face.
There is still hope as the new folding provider API (currently in preview so not usable yet) lists "imports" as one of the folding region kinds.