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

Add option to fold import statements - VS Code Extension #2037

Closed
fev4 opened this issue May 27, 2023 · 1 comment
Closed

Add option to fold import statements - VS Code Extension #2037

fev4 opened this issue May 27, 2023 · 1 comment

Comments

@fev4
Copy link

fev4 commented May 27, 2023

Description

Hey there!

Sometimes imports can get really long and it takes a couple of scrolls to get to the actual start of the code within a script tag.

VS Code has an option called:

"editor.foldingImportsByDefault": true

But this doesn't seem to work.

Proposed solution

It would be nice to be able to auto-fold after a certain number of import statements (let's say 5), and then they are auto-folded. Or even being able to fold manually or with a keyboard shortcut would be perfect.

This would make getting to the code a little faster.

Alternatives

As mentioned, VS Code has an option for folding imports, but this doesn't work. Aside from that I haven't found an extension to fold imports in Svelte files.

I'm also able to fold the entire script tag with Ctrl+Shift+[, but this is not useful for the problem described here.

Additional Information, eg. Screenshots

Here's an example of one the files I have where the import statements take the first full page:

image

These are the folds available:
image

This is a nice to have, nothing critical.

Thanks for reading.

@jasonlyu123
Copy link
Member

Closing as duplicate of #1704. The current folding is indentation based provided by VSCode. This should work as expected once we provide a more "semantic" folding range support.

@jasonlyu123 jasonlyu123 closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants