refactor: use more flexible paths (#1381)

This commit is contained in:
kylo252 2021-09-13 11:28:15 +02:00 committed by GitHub
parent 38b0c3d860
commit 8eed75d67f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 216 additions and 153 deletions

View file

@ -1,16 +1,6 @@
local M = {}
local Log = require "core.log"
function M.config()
vim.lsp.protocol.CompletionItemKind = lvim.lsp.completion.item_kind
for _, sign in ipairs(lvim.lsp.diagnostics.signs.values) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
end
require("lsp.handlers").setup()
end
local function lsp_highlight_document(client)
if lvim.lsp.document_highlight == false then
return -- we don't need further
@ -159,4 +149,29 @@ function M.setup(lang)
end
end
function M.global_setup()
vim.lsp.protocol.CompletionItemKind = lvim.lsp.completion.item_kind
for _, sign in ipairs(lvim.lsp.diagnostics.signs.values) do
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
end
require("lsp.handlers").setup()
local null_status_ok, null_ls = pcall(require, "null-ls")
if null_status_ok then
null_ls.config()
require("lspconfig")["null-ls"].setup(lvim.lsp.null_ls.setup)
end
local utils = require "utils"
local lsp_settings_status_ok, lsp_settings = pcall(require, "nlspsettings")
if lsp_settings_status_ok then
lsp_settings.setup {
config_home = utils.join_paths(get_config_dir(), "lsp-settings"),
}
end
end
return M