JavaHello / spring-boot.nvim

Neovim + Spring Boot LS
Apache License 2.0
38 stars 7 forks source link

fix:解决开启inlay hints功能时,neovim会报Invalid 'col': out of range的问题,关闭sprin… #9

Closed CcccX2017 closed 3 months ago

CcccX2017 commented 3 months ago

…g-boot的textDocument/inlayHint,保留jdtls的 1723191277062

JavaHello commented 3 months ago

image image

我这边测试不会出现异常x,尝试只保留 spring-boot.nvim 和 nvim-jdtls 插件测试一下

CcccX2017 commented 3 months ago

我是用LazyVim预设的那一套来配置的,如果不引入spring-boot或者把spring-boot里面的textDocument/inlayHint处理一下就不会报错,或许给sprint-boot.nvim加一个允许自定义配置handlers可能会更好 报错的视频

https://github.com/user-attachments/assets/610dd8dc-1d74-4d51-ae78-6474fde3210b

处理了spring-boot.nvim的textDocument/inlayHint后,正常

https://github.com/user-attachments/assets/593be6fe-e9fe-4bd6-af42-62bd0a2a2bcd

JavaHello commented 3 months ago

register_java_data_service 是自定义的实现,不适合放在这里,我修改了配置https://github.com/JavaHello/spring-boot.nvim/commit/995a705becbc711b703f9ab344745ececf6471a3 。尝试这样指定下 handlers

  require("spring_boot").setup {
    server = {
      handlers = {
        ["textDocument/inlayHint"] = function(_, _, params, client_id, _)
         -- ...
        end
      }
    },
  }
CcccX2017 commented 3 months ago

嗯嗯,试过了。可以的。我也觉得加一个配置handlers会更好,没想到这么快就加了,感谢