Skip to content

Unable to use lsp dependent keymaps #1517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saksham-sharma opened this issue May 9, 2025 · 2 comments
Closed

Unable to use lsp dependent keymaps #1517

saksham-sharma opened this issue May 9, 2025 · 2 comments

Comments

@saksham-sharma
Copy link

Hi, I am very new to neovim. I am using an older version of teej's kickstart init.lua file and after recently updating to latest versions of my language servers (typescript specifically) and neovim as well as all the dependencies via Lazy. I am no longer able to use any keymaps that are LSP dependent. Can anyone here help me find out the issue?

Here is my init.lua: https://gist.github.com/saksham-sharma/c0680ab9d2d5008174fee21ff44ef0c6

@DavidRambo
Copy link

Hello, the mason_lspconfig.nvim plugin recently released a new major version (2.0.0), which has some breaking changes. I suspect this is the issue. You can pin the version to the previous major version as shown here.

In your config, on lines 86 and 87, change this:

      'williamboman/mason.nvim',
      'williamboman/mason-lspconfig.nvim',

to this:

      { "williamboman/mason.nvim", version = "^1.0.0" },
      { "williamboman/mason-lspconfig.nvim", version = "^1.0.0" },

Save, and then be sure to run the Update command in Lazy. This will switch back to the previous version.

I based my config on kickstart.nvim a while ago as well and am going to look into updating it to work with the latest mason versions.

@SetsuikiHyoryu
Copy link

You need to use Neovim 0.11’s native functions, vim.lsp.config and vim.lsp.enable, to activate the config. This is because mason-lspconfig 2.0 removed the handlers property that was used in kickstart.

You can refer to #1475 for how to do this.

I created a video 【编程备忘录 | Neovim】关于 mason-lspconfig 更新 2.0 后 Vue 文件 LSP 失效的问题【星ノ谷雪風】(变声器) explaining how to do it, but it’s in Chinese.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@saksham-sharma @DavidRambo @SetsuikiHyoryu and others