Open igorlfs opened 2 months ago
are these folding ranges? if so, vscode seems to add these on its own without pylance/pyright installed:
just to make sure we're on the same page, are you using a different editor and want this feature added to the language server?
Yep, those are the folds!
I assume VS Code has a built-in implementation for some languages, or something like that.
I'm using neovim, which also provides a "default" implementation, but having as it language server capability would be nice. Some servers allow folding imports / comments, for instance.
alright, i just removed "pylance feature parity" because as far as i can tell the functionality doesn't come from pylance but vscode itself
Can we automatically fold the import blocks, PyCharm does this and it's very appreciated: I don't like seeing 1000 lines of generated code at the top of every file
I do think the capability comes from pylance, see this issue
Folding support was added in 2022.1.1
https://github.com/microsoft/pylance-release/issues/372#issuecomment-1023726101
currently (in bpr) folding is based on indentation:
def foo():
print(
)
print(2)
Try this out, you will observe that it is broken.
LSP Spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_foldingRange
Other servers that implement this capability are rust-analyzer and tsserver.