aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/basedpyright.lua
Commit message (Collapse)AuthorAgeFilesLines
* fix: luals warningsJustin M. Keyes2025-11-141-0/+2
|
* fix(pyright): prioritize "pyrightconfig.json" root marker #4171Trevor Hauter2025-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Problem**: When working in a python monorepo with a base `pyproject.toml`, and `pyrightconfig.json` files that extend this base configuration in subdirectories, `pyright` will not recognize these `pyrightconfig.json` and identify these subdirectories (project1 | project2) as root directories because `pyproject.toml` takes precedence. ```sh # Example structure monorepo ├── project1 │   ├── pyrightconfig.json │   └── src │   └── main.py ├── project2 │   ├── pyrightconfig.json │   └── src │   └── main.py └── pyproject.toml ``` From the pyright docs [1] > A “pyrightconfig.json” file always takes precedent over “pyproject.toml” if both are present **Solution**: Update the order of the `root_markers` to prefer `pyrightconfig.json` so priority is in line with pyrights documentation. **Testing**: When creating a simple monorepo structure with the following command ```sh mkdir monorepo && touch monorepo/pyproject.toml && mkdir monorepo/project1 && touch monorepo/project1/pyrightconfig.json && mkdir monorepo/project1/src && touch monorepo/project1/src/main.py && cp -r monorepo/project1 monorepo/project2 ``` You should be able to open one of the subdirectories `nvim monorepo/project1/src/main.py` and check your LSP root dir with `:LspInfo`, and it should be attached to the subdirectory. 1. https://github.com/microsoft/pyright/blob/main/docs/configuration.md#pyright-configuration
* fix(pyright): command :LspPyrightSetPythonPath fails #4045Stanislav Asunkin2025-08-301-1/+2
| | | | | `vim.api.nvim_buf_create_user_command` callback is called with a table argument that contains a parsed command. Need to use `args` or `fargs` key to get command arguments.
* fix(pyright): command :LspPyrightOrganizeImports fails #3971Michele Sorcinelli2025-08-301-2/+7
| | | | | | | | | | Problem: The `pyright.organizeimports` is private, so client:exec_cmd() fails because it refuses to run commands that are not advertised as capabilities. Solution: Call client.request() to side-step the check in client:exec_cmd(). YOLO
* chore: miscellaneous type fixesIgor2025-08-181-1/+1
|
* chore: add type annotation for configsIgor2025-08-181-0/+1
|
* fix: some `on_attach` callbacks may act on the wrong buffer #3916Dmytro Meleshko2025-06-201-1/+1
| | | | | | | | | Problem: If a server is attached to a non-current buffer by `vim.lsp.buf_attach_client`, then the Language Server-related commands may be created in the current (wrong) buffer. Solution: Always use the `bufnr` arg provided to `on_attach`.
* ci(lint): use client:exec_cmd() #3755Justin M. Keyes2025-04-211-17/+7
| | | | Use `client:exec_cmd()` instead of calling `request("workspace/executeCommand")` directly.
* fix: use "Lsp" prefix for config-defined commandsJustin M. Keyes2025-04-211-2/+2
|
* 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/+68
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>