pmizio / typescript-tools.nvim

⚡ TypeScript integration NeoVim deserves ⚡
MIT License
1.26k stars 36 forks source link

LspRestart (and LspStop) generates error #255

Closed Drew-Daniels closed 1 week ago

Drew-Daniels commented 3 months ago

When I run :LspStop or :LspRestart, I am getting this error:

[ERROR][2024-03-26 11:10:18] ...m/lsp/client.lua:979    "LSP[typescript-tools]" "on_error"  {  code = "ON_EXIT_CALLBACK_ERROR",  err = "...r/neovim/HEAD-3f3c729/share/nvim/runtime/lua/vim/lsp.lua:355: attempt to index local 'client' (a nil value)"}

My configuration for typescript-tools is:

{
  "pmizio/typescript-tools.nvim",
  dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
  opts = {},
}

I can start up the LSP again with :LspStart, but it would just be nice if running :LspRestart worked as it has previously.

❯ nvim --version
NVIM v0.10.0-dev-2701+g3f3c7299a-Homebrew
Build type: Release
LuaJIT 2.1.1710088188
Run "nvim -V1 -v" for more info

❯ brew --version
Homebrew 4.2.15

                 ,xNMM.          -----------------------------------------
               .OMMMMo           OS: macOS 14.3 23D56 arm64
               OMMM0,            Host: Mac15,7
     .;loddo:' loolloddol;.      Kernel: 23.3.0
   cKMMMMMMMMMMNWMMMMMMMMMM0:    Uptime: 21 hours, 20 mins
 .KMMMMMMMMMMMMMMMMMMMMMMMWd.    Packages: 69 (brew)
 XMMMMMMMMMMMMMMMMMMMMMMMX.      Shell: zsh 5.9
;MMMMMMMMMMMMMMMMMMMMMMMM:       Resolution: 1920x1080, 1920x1080
:MMMMMMMMMMMMMMMMMMMMMMMM:       DE: Aqua
.MMMMMMMMMMMMMMMMMMMMMMMMX.      WM: Rectangle
 kMMMMMMMMMMMMMMMMMMMMMMMMWd.    Terminal: tmux
 .XMMMMMMMMMMMMMMMMMMMMMMMMMMk   CPU: Apple M3 Pro
  .XMMMMMMMMMMMMMMMMMMMMMMMMK.   GPU: Apple M3 Pro
    kMMMMMMMMMMMMMMMMMMMMMMd     Memory: 3439MiB / 18432MiB
     ;KMMMMMMMWXXWMMMMMMMk.
       .cooc,.    .,coo:.

typescript-tools version:

"typescript-tools.nvim": { "branch": "master", "commit": "c43d9580c3ff5999a1eabca849f807ab33787ea7" },

My lazy.nvim configuration:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)
shyamayadav154 commented 3 months ago

running into same issue in nighlty version of nvim, however it is working fine in nvim stable version

marcomaiermm commented 3 months ago

running into the same issue

marcoSven commented 2 months ago

Same here

kapral18 commented 1 month ago

same

KostkaBrukowa commented 2 weeks ago

Hey! I've linked a PR. Can you check if it works for you? Because LspRestart worked for me on nightly, but it was throwing an error so I want to be sure if my fix works for you. Basically the problem was that on_exit was called twice if you have had enabled separate_diagnostic_server enabled (endabled by default)