Преглед изворни кода

fix(lsp): set the handlers opts for v0.6 as well (#2109)

kylo252 пре 3 година
родитељ
комит
5593499828
4 измењених фајлова са 14 додато и 8 уклоњено
  1. 1 0
      README.md
  2. 5 0
      lua/lvim/config/init.lua
  3. 5 1
      lua/lvim/lsp/config.lua
  4. 3 7
      lua/lvim/lsp/handlers.lua

+ 1 - 0
README.md

@@ -129,6 +129,7 @@ lvim.plugins = {
 ## Breaking changes
 ## Breaking changes
 
 
 - `lvim.lang.FOO` is no longer supported. Refer to <https://www.lunarvim.org/languages> for up-to-date instructions.
 - `lvim.lang.FOO` is no longer supported. Refer to <https://www.lunarvim.org/languages> for up-to-date instructions.
+- `lvim.lsp.popup_border` has been deprecated in favor of `lvim.lsp.float.border` and `lvim.lsp.diagnostics.float.border`.
 
 
 ## Resources
 ## Resources
 
 

+ 5 - 0
lua/lvim/config/init.lua

@@ -66,6 +66,11 @@ local function handle_deprecated_settings()
       deprecation_notice(string.format("lvim.lang.%s", lang))
       deprecation_notice(string.format("lvim.lang.%s", lang))
     end
     end
   end
   end
+
+  -- lvim.lsp.popup_border
+  if vim.tbl_contains(vim.tbl_keys(lvim.lsp), "popup_border") then
+    deprecation_notice "lvim.lsp.popup_border"
+  end
 end
 end
 
 
 --- Override the configuration with a user provided one
 --- Override the configuration with a user provided one

+ 5 - 1
lua/lvim/lsp/config.lua

@@ -32,7 +32,11 @@ return {
   },
   },
   document_highlight = true,
   document_highlight = true,
   code_lens_refresh = true,
   code_lens_refresh = true,
-  popup_border = "single",
+  float = {
+    focusable = false,
+    style = "minimal",
+    border = "rounded",
+  },
   on_attach_callback = nil,
   on_attach_callback = nil,
   on_init_callback = nil,
   on_init_callback = nil,
   automatic_servers_installation = true,
   automatic_servers_installation = true,

+ 3 - 7
lua/lvim/lsp/handlers.lua

@@ -28,15 +28,11 @@ function M.setup()
       end
       end
       vim.lsp.diagnostic.display(diagnostics, bufnr, client_id, config)
       vim.lsp.diagnostic.display(diagnostics, bufnr, client_id, config)
     end
     end
+  end
 
 
-    vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
-      border = lvim.lsp.popup_border,
-    })
+  vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, lvim.lsp.float)
 
 
-    vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
-      border = lvim.lsp.popup_border,
-    })
-  end
+  vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, lvim.lsp.float)
 end
 end
 
 
 function M.show_line_diagnostics()
 function M.show_line_diagnostics()