Register fold import action#227216
Conversation
|
The folding model already knows which ranges are import ranges: type === FoldingRangeKind.Imports See here as an example: Of course this only works for languages that have a provider. Your PR also has the same problem. |
563a18b to
740fa3e
Compare
I have update the code get regions from folding model.
That seems to make sense to have a provider figure out what range is import range in different language? |
|
You can use the already existing function Depending on what extensions are installed, some language have rich language support and a folding provider, some don't. |
If we reuse the function we might need to know if the import range is collapsed or expanded.
If I understand right we should toggle fold import when there are provider provided? Like getFoldingRangeProviders here? |
Do you want to toggle or set? I assumed from the name of the command The command will just be a no-op if there's folding provider that knows about imports. That's fine. |
Maybe |
|
Toggle is probably more useful. |
0e4d995 to
89b2b66
Compare
|
Thanks @BABA983 ! |

Close #130678
demo.mp4