Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the text of import class be folded by default? #1820

Closed
mozhuanzuojing opened this issue Jul 25, 2021 · 2 comments
Closed

Can the text of import class be folded by default? #1820

mozhuanzuojing opened this issue Jul 25, 2021 · 2 comments

Comments

@mozhuanzuojing
Copy link
Contributor

Many times you don’t need to look at the import code, and sometimes the import takes a long time and affects the preview code.

  • example

image

  • Desired effect

image

@rgrunber
Copy link
Contributor

rgrunber commented Jul 26, 2021

Looking through https://microsoft.github.io/language-server-protocol/specification#textDocument_foldingRange , FoldingRange doesn't seem to have a property to have it enabled by default. I'd hope microsoft/vscode#33449 would probably provide what's needed for this in terms of maybe an extra property to FoldingRange.

I do see some extensions on the VS Code marketplace that provide the ability to auto-fold, but these function on level, or comments, and not import types. In addition, a solution for LSP would be best.

@fbricon
Copy link
Contributor

fbricon commented Jul 26, 2021

That feature has been added upstream to vscode (see microsoft/vscode#40338 (comment)). It should be available with the next vscode release (1st week of August 2021).
In the meantime, you can try vscode insiders and set "editor.foldingImportsByDefault": true in your settings.json

@fbricon fbricon closed this as completed Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants