-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Support fold regions for lambda without block #38597
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
Comments
Please post a complete example. Several functions/methods have no declaration so it's impossible to know what they do. |
@jessetrinity do we have any sort of heuristics where things that aren't blocks but are multi-line still get an outlining span? |
Also, in this case the declarations aren't really necessary, outlining spans don't currently need semantic information. |
@jessetrinity Great Job! Also, can we fold long parameters list? For example: const bar$ = foo$.pipe(
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
map(x => x),
shareReplay(1)
); It would be great if we can fold in |
I would say arrow function body provided it spans 3 lines at least. |
Happy to work on this if @jessetrinity did not start the work. |
Go for it, I just added a case for arrow functions to the switch statement here:
It looked like there was more tweaking to do to to correctly fold the body when the function call is on the same line as the arrow e.g. a => map(
...
) |
Thanks @Kingwl! |
Search Terms
VSCode, Language Service
Suggestion
Support fold regions for lambda without block
This TypeScript code can't fold unless we change all
x=>y
tox=>{ return y; }
Checklist
My suggestion meets these guidelines:
Related issue
microsoft/vscode#97415
The text was updated successfully, but these errors were encountered: