typescript-tools.nvim icon indicating copy to clipboard operation
typescript-tools.nvim copied to clipboard

LspRestart (and LspStop) generates error

Open Drew-Daniels opened this issue 1 year ago • 4 comments

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)

Drew-Daniels avatar Mar 26 '24 16:03 Drew-Daniels

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

shyamayadav154 avatar Apr 03 '24 14:04 shyamayadav154

running into the same issue

marcomaiermm avatar Apr 07 '24 15:04 marcomaiermm

Same here

marcoSven avatar Apr 11 '24 13:04 marcoSven

same

kapral18 avatar May 21 '24 09:05 kapral18

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)

KostkaBrukowa avatar Jun 19 '24 06:06 KostkaBrukowa