aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/ts_ls.lua
Commit message (Collapse)AuthorAgeFilesLines
* feat(ts_ls): add LspTypescriptGoToSourceDefinition command #4225Ilia Choly2025-12-031-0/+23
|
* fix(lsp): detect deno.jsonc as Deno project for ↵Thiago Marques2025-11-181-1/+1
| | | | | | | biome/eslint/ts_ls/tsgo/vtsls #4203 Even though Deno docs says that both deno.json and deno.jsonc files can be used for its configuration, deno.jsonc was not being considered to prevent biome/eslint/ts_ls/tsgo/vtsls to run in Deno projects.
* fix(ts_ls): broken in non-Deno repo #4198Daniel Imfeld2025-11-161-2/+2
|
* fix(lsp): improve ts_ls root detection for deno projects #4193Apocalypse2025-11-161-6/+4
| | | | | | Refactor project root detection logic to properly exclude ts_ls when deno.json/deno.lock are at the same or higher level than project markers. Co-authored-by: yzs <yuanzishuai@qq.com>
* fix: luals warningsJustin M. Keyes2025-11-141-4/+6
|
* fix: exclude deno from biome/eslint/ts_ls/tsgo/vtsls #4130Xubai Wang2025-11-131-0/+6
| | | | | Close https://github.com/neovim/nvim-lspconfig/issues/4129 Since cwd is a necessity for many JavaScript project (see discussions in https://github.com/neovim/nvim-lspconfig/issues/4015), this fix takes an alternative approach to manually exclude Deno projects from biome/eslint/ts_ls/tsgo/vtsls 's `root_dir` detection logic. There is no need to change svelte since it has a different filetype.
* Revert "add deno.lock root marker #4051"Justin M. Keyes2025-09-171-1/+1
| | | | | | | Reverts 33e318a3f0e729fb7ee82619a21172712b0ea288 (except for svelte). fix #4074 close #4076
* fix: ts/js LSPs require lockfile #4062Alexis Tacnet2025-09-101-5/+4
| | | | | | | | Problem: Some projects don't have a lockfile. Solution: - Fallback to ".git" as a lower-priority root-marker (Nvim 0.11.3+). - Fallback to CWD.
* feat(biome,eslint,svelte,ts_ls,tsgo,vtsls): add deno.lock root marker #4051Kai Moschcau2025-09-031-1/+1
| | | | | | | | Problem: `deno.lock` is not recognized as a root marker in JavaScript related servers. Solution: Add `deno.lock` as a root marker.
* fix(ts/js): support older Nvim 0.11.xJustin M. Keyes2025-08-211-2/+3
| | | | fix #4023
* fix(ts/js): give lockfiles equal priority when finding root #4013Oskar Haarklou Veileborg2025-08-201-1/+2
|
* fix(ts_ls): server not starting if there is no typescript #4011Vinícius Weigert2025-08-191-14/+0
|
* chore: miscellaneous type fixesIgor2025-08-181-2/+2
|
* chore: add type annotation for configsIgor2025-08-181-0/+1
|
* fix(ts/js): servers do not start when `bun.lock` exists #4008Methapon20012025-08-181-1/+1
|
* feat(ts/js): improve monorepo support for Typescript, ESLint #3955Alexis Tacnet2025-08-171-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: Monorepos (or "workspaces") in Typescript are more and more popular and the associated tooling is evolving to improve the developer experience in such setup. Especially, the `typescript-language-server` and the `vscode-eslint-language-server` now supports monorepos, **removing the need to spawn a different server for each package of a workspace**. Example: with a few packages as the servers need to load every other package to work (the `typescript-language-server`, even if spawned multiple times with different `root_dir`, will load in memory other packages to resolve the types), the amount of memory used grows exponentially. But in fact, those servers support monorepos: they support multiple configurations in subpackages and will load the correct one to process a buffer. The ESLint server even supports loading multiple ESLint binaries (and therefore versions), while keeping one instance of the server. SOLUTION: Instead of only relying on the configuration files as `root_markers`, discover the root of the package / monorepo by finding the Lock files created by node package managers: * `package-lock.json`: Npm * `yarn.lock`: Yarn * `pnpm-lock.yaml`: Pnpm * `bun.lockb`: Bun We still need to look at configuration files to enable the conditionnaly attachment of the LSP for a buffer (for ESLint, we want to attach the LSP only if there are ESLint configuration files) in case of LSP that operates on files that are "generic" (like `typescript` or `javascript`). To do that, I replace the `root_markers` that were the configuration files by a `root_dir` function that superseds them. It will both: * look for a configuration file upward to check if the LSP needs to be attached * look for the root of the "project" via the lock files to specify the `root_dir` of the LSP PRIOR EXPERIMENTATIONS: I've tried to play with the `reuse_client` quite a lot, trying to understand if we need to spawn a new server or not looking at the Typescript / ESLint binary that was loaded, but in fact it's way easier to just have a better `root_dir` that is the true root of the project for the LSP server: in case of those two servers, the root of the package / monorepo. I also tried to use the current directory opened as the `root_dir`, but it's less powerful on nvim compared to VSCode as we navigate more inside folders using terminal commands and then open vim. I think this method also removes the need from a project-local config (which could be quite useful anyway for ESLint flat config setting which auto-detection is a bit unreliable / compute heavy) as this should work normally accross all different setups. Fixes #3910
* fix(vue_ls): support `vue_ls` v3 #3943Fidel Yin2025-07-101-37/+0
| | | | | | | | | | | Problem: `vue_ls` made breaking changes to its config in v3. Solution: Change the typescript language server for `vue_ls` from `ts_ls` to `vtsls`. Add a client handler to communicate between `vue_ls` and `vtsls`. Remove `typescript.tsdk` option. Remove documentation for the deprecated takeover mode.
* feat(ts_ls): implement codelens support #3938Simon Engmann2025-07-061-0/+26
| | | | | | | | | | Implement the `editor.action.showReferences` client command, which is used by the references and implementation code lenses that TypeScript Language Server provides. I've mostly based the implementation on the existing code for `vim.lsp.buf.references()`. The main visible difference is that the latter includes the item being referenced at the top of the list. Although, if desired, this could be emulated by manually inserting the position passed along in the command arguments at the top of the list.
* fix: some `on_attach` callbacks may act on the wrong buffer #3916Dmytro Meleshko2025-06-201-2/+2
| | | | | | | | | 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`.
* feat(volar)!: rename to 'vue_ls'J.c2025-05-111-5/+5
| | | | | | The Vue language tooling does not use 'Volar' prominently in its documentation. The official name for the language server is '@vue/language-server'.
* docs: cleanup #3791Justin M. Keyes2025-04-261-1/+1
|
* ci: check legacy configs, drop "comment" #3781Justin M. Keyes2025-04-261-3/+5
| | | | - Disallow adding new legacy configs. - Drop the "comment" CI job. It is over-engineered, and adds redundant comments on PRs.
* feat(ts_ls): add :LspTypescriptSourceAction command #3780Thomas Dy2025-04-261-0/+17
| | | | | Source actions are code actions that apply to the whole file. They are not exposed via `vim.lsp.buf.code_action()` and must be requested explicitly.
* feat(ts_ls): add _typescript.rename handler #3779Thomas Dy2025-04-261-0/+15
| | | | | This handler is used when performing certain code actions such as extracting functions or types. The language server asks the editor to prompt for a rename for the newly created function or type.
* docs: cleanupJustin M. Keyes2025-04-181-65/+65
| | | | | - 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/+81
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>