maptz.vscode.extensions.customfolding
maptz.vscode.extensions.customfolding copied to clipboard
Some language services prevent `vscode.FoldingRangeProvider` from working correctly
There is a known issue that a custom vscode.FoldingRangeProvider
does not work correctly with some language services. A custom FoldingRangeProvider either prevents the default language folding to appear (C/C++), or prevents customization (Python)
This issue currently affects
- Lua
- Python
- C/C++
The issue is that the normal indentRangeProvider
functionality is no longer provided when a RangeProvider is supplied.
As far as I see it, the only option is to implement the indentRangeProvide
in custom code.
The implementation is available here, https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/folding/indentRangeProvider.ts
But it's not trivial to adapt it to an extension as it relies on a long import chain.
Is this issue being fixed? The bug is a show-stopper, i cannot use this extension if it breaks my other code folds and i cant find any references how to implement the indendRangeProvide linked above.
Any hints would be GREATLY appreciated!
Unfortunately not. I've been speaking to the VS Code team and it's definitely because of the way the folding providers are implemented. We can't see a way to fix it until the VS Code codebase changes. A pull request should have been made ok the VS Code repo though - but they haven't confirmed this yet.
With this vscode version
Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:45:54.515Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 19.6.0
and latest extension, python files have no folding, as opposed to previous statement of "no customisation". Changing the file type to plain text makes the folding appear again, as well as they are visible for a brief moment after opening a .py file or switching types (assumedly until this extension loads). I am disabling python in extension settings for now, as I don't extensively use vscode for python
I am uninstalling the extension as folding has stopped working for YAML, which is the other significant file type after python that I use. The extension is a good idea but not worth using until the extension and/or vs code itself are fixed
Update. This requires changes to VS Code under the hood. I'm short of time and so looking into this issue is hard for me to prioritize at the moment outside my day job.
Can I get a general sense of how much this is impacting people?
Can I get a general sense of how much this is impacting people?
Not sure why GitHub isn't showing me the normal upvote/emoji button, but big upvote from me
This looks like this has now been fixed.
I still occur bug with php language. So how to fix it?
I Just updated to Visual Code V.1.77.3, and I also updated this plugin, it's now at V.1.0.22
Still the bug persists for PHP. I use intelliphense, I don't know if it plays any role.
The deal is as soon as I disable the plugin, folding comes back :(
Yes, I confirm. Even disabling folding for the language does nothing.
Only setting [php]: {"editor.defaultFoldingRangeProvider": "bmewburn.vscode-intelephense-client"}
does the job, which is, in effect, disables this extension for the language.
Even when disabled with "disableFolding": true,
for the language, PHP folding does not come back...
Currently this plugin is unusable due to this :( I wander, is there any update on this? From you or the V.C. team?
I can also confirm this issue using C and the MS C/C++ Tools. Interestingly, the issue disappears when using mohammadbaqer.better-folding
in conjunction with this extension.
@Janfel love you man! You made my day! I was laughing for too much time out of joy when seeing this plugin!!! Thank you for sharing, you are my hero :D haha