From e1d1a5c5a12127ded88dfcf66dd74aad1650977c Mon Sep 17 00:00:00 2001 From: Poliorcetics Date: Wed, 27 Nov 2024 20:24:57 +0100 Subject: [PATCH] cleanup: remove pr.md introduced in #11448 (#12140) --- pr.md | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 pr.md diff --git a/pr.md b/pr.md deleted file mode 100644 index 0ea65a5ad..000000000 --- a/pr.md +++ /dev/null @@ -1,24 +0,0 @@ -Syntax symbol pickers -== - -This adds two new symbol picker commands that use tree-sitter rather than LSP. We run a new `symbols.scm` query across the file and extract tagged things like function definitions, types, classes, etc. For languages with unambiguous syntax this behaves roughly the same as the LSP symbol picker (`s`). It's less precise though since we don't have semantic info about the language. For example it can easily produce false positives for C/C++ because of preprocessor magic. - -The hope is to start introducing LSP-like features for navigation that can work without installing or running a language server. I made these two pickers in particular because I don't like LSP equivalents in ErlangLS - the document symbol picker can take a long time to show up during boot and the workspace symbol picker only searches for module names. The other motivation is to have some navigation features in cases when running a language server is too cumbersome - either to set up or because of resource constraints. For example `clangd` needs a fair amount of setup (`compile_commands.json`) that you might not want to do when quickly reading through a codebase. - -GitHub already uses tree-sitter like this to provide [imprecise code navigation](https://docs.github.com/en/repositories/working-with-files/using-files/navigating-code-on-github#about-navigating-code-on-github). It should be possible to find definitions and references as well like `gd` and `gr` - this is left as a follow-up. - -This PR also adds commands that either open the LSP symbol picker or the syntax one if a language server is not available. This way you can customize a language to not use the LSP symbol pickers, for example: - -```toml -[[language]] -name = "erlang" -language-servers = [{ name = "erlang-ls", except-features = ["document-symbols", "workspace-symbols"] }] -``` - -and `s` will use the syntax symbol picker, while `s` on a Rust file will still prefer the language server. - ---- - -Outstanding question - how closely should we try to match LSP symbol kind? Not at all? Should we have markup specific symbol kinds? (For example see markdown's `symbols.scm`). - -Also this PR needs docs on writing `symbols.scm` queries.