aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/gopls.lua
Commit message (Collapse)AuthorAgeFilesLines
* chore: add type annotation for configsIgor2025-08-181-0/+1
|
* feat(gopls): refactor root_dir identification #3942Benjamin Alpert2025-07-081-19/+72
| | | | | | | | | Refactor the logic on how to identify the root_dir for gopls. This will provide a viable solution to the issue where multiple gopls lsp client instances are started, causing adverse effects in certain areas like diagnostics, lsp functionality (such as `go to definition`, workspace-enabled projects). The identification for required directories are based on golang-specific environment variables which are set by default.
* fix(gopls): schedule vim.notify in on_exit #3860Kir Kolyshkin2025-05-221-1/+3
| | | | | | | | | | | This fixes the following error > E5560: nvim_echo must not be called in a fast event context when gopls fails. Similar to commit 48f4475. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* fix(gopls): prioritise `go.work` over `go.mod`Peter Lithammer2025-05-141-1/+1
| | | | | | | | | The purpose of a `go.work` file is to handle multi-module workspaces. A common such scenario is a monorepo. This is also how the legacy config works because it's using `lsponfig.util.root_pattern()` which has similar semantics as `root_markers`.
* docs: cleanupJustin M. Keyes2025-04-181-5/+6
| | | | | - brief should live at the top of each file - fix indentation for some docs
* fix(docs): docgen.lua reads from `lua/*.lua` #3708Justin M. Keyes2025-04-121-1/+1
| | | | | | | | Problem: Since configs now live in `lsp/`, the docgen needs to be updated. Solution: Read the configs from `lsp/`. Parse the `@brief` docstring to get the docs.
* feat: migrate to vim.lsp.config #3659Lorenzo Bellina2025-04-121-0/+42
Problem: Nvim 0.11 has vim.lsp.config, which mostly replaces the legacy nvim-lspconfig "framework". Solution: Migrate all configs to `lsp/*` variants. The old configs in `lua/lspconfig/` are "frozen". The new configs include these changes: - `commands` field became raw calls to `vim.api.nvim_buf_create_user_command` inside `on_attach`. - `root_dir` became: - `root_markers` whenever the file list was simple didn't need to mach `*` - if the logic was complicated, or needed to match something like '\*.c', it was defined as a vim.lsp.Config `root_dir` callback. - `on_config_change` became `before_init`. I don't actually know if this is the correct approach, but looking around the documentation of `nvim-lspconfig` a saw that it was defined as the function that gets called as soon as the config have `root_dir`, and so I thought `before_init` might be the closest alternative. - `docs.description` became a luadoc `@brief` docstring. - `single_file_support = false`? Co-authored-by: Aliou Diallo <aliou@users.noreply.github.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com>