Stream: t-compiler/rust-analyzer

Topic: Regions in file structure


ivan770 (Mar 11 2021 at 14:38, on Zulip):

Hi! While trying to implement https://github.com/rust-analyzer/rust-analyzer/issues/7913 I stumbled upon difficulties describing regions in LSP (needed for SymbolKind::RegionStart and SymbolKind::RegionEnd). Is there a semantic token for region describing?

matklad (Mar 11 2021 at 15:02, on Zulip):

there isn't appropriate lsp symbol kind for this, I'd just re-used module

ivan770 (Mar 11 2021 at 15:59, on Zulip):

printer.mp4 Hope that suits the issue

Daniel Mcnab (Mar 11 2021 at 16:14, on Zulip):

One thought about this is if we introduce this as a first class feature, we're sort of extending the language by force
That is, if most peoples are using rust-analyzer, then the region marker becomes the de-facto standard to mark regions.
I don't think in this case it matters too much, since I don't think there's any other likely syntax.

matklad (Mar 11 2021 at 16:15, on Zulip):

agree here! but practicality beats purity -- vscode's in-editor region folding doesnt work if we provide any folds, so we have to provide our own impl. The LSP also has first-class support for region folds

Last update: Jul 24 2021 at 20:45UTC