Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
lsp_workspace_symbols returns results only from the current workspace, whereas lsp_dynamic_workspace_symbols returns results from all the workspaces. Also, lsp_workspace_symbols returns an error of no results from workspace if the query is empty. So you need to also append a valid query to get back results. lsp_dynamic_workspace_symbols does not appear to have such a problem, but there have been some worries regarding its performance on large workspaces. I don't know the internal intricancies of LSP myself, but I found myself getting an error when using pyright with lsp_workspace_symbols so I transitioned to lsp_dynamic_workspace_symbols which solves this problem. There is an issue on telescope repo, which also discussed this problem, so you might want to read it through to get a better understanding.
A workspace (according to my basic understanding) usually constitutes a collection of files that LSP is aware of and is able to return information about text tokens used in those files. Usually LSP detects this based on a pattern (can be a file or something else i'm not sure exactly). For example, rust-analyzer expects a Cargo.toml or tsserver (for typescript) expects a package.json or tsconfig.json. You can read more about what each server expects in nvim-lspconfig. I'm sure there's more ex0lanation that i'm not aware of due to my basic understanding.
Related posts
- Trying really hard to get into Neovim but I’ve had such a hard time trying to configure it!
- Are there any examples of how to use nvim_create_autocmd?
- Neovim 0.5 is awesome
- Need resources for porting init.vim to init.lua, following the norm
- lsp, pyls: how to get autocompletion and signatures of imported library