Skip to content

Commit

Permalink
feat(lsp): css_variables and cssls added to servers.
Browse files Browse the repository at this point in the history
Signed-off-by: Guennadi Maximov C <[email protected]>
  • Loading branch information
DrKJeff16 committed Sep 7, 2024
1 parent 61c1ce5 commit 4a457f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
26 changes: 8 additions & 18 deletions lua/plugin/lsp/init.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
local User = require('user_api')
local Check = User.check
local types = User.types.lspconfig
local WK = User.maps.wk

local exists = Check.exists.module
local executable = Check.exists.executable
local empty = Check.value.empty
local is_str = Check.value.is_str
local is_tbl = Check.value.is_tbl
local is_nil = Check.value.is_nil
local desc = User.maps.kmap.desc
local wk_avail = User.maps.wk.available
local map_dict = User.maps.map_dict
local hi = User.highlight.hl

Expand Down Expand Up @@ -42,17 +39,6 @@ require('plugin.lsp.neoconf')
require('plugin.lsp.trouble')
require('plugin.lsp.kinds').setup()

--[[ local border = {
{ '🭽', 'FloatBorder' },
{ '▔', 'FloatBorder' },
{ '🭾', 'FloatBorder' },
{ '▕', 'FloatBorder' },
{ '🭿', 'FloatBorder' },
{ '▁', 'FloatBorder' },
{ '🭼', 'FloatBorder' },
{ '▏', 'FloatBorder' },
} ]]

-- LSP settings (for overriding per client)
local handlers = {
['textDocument/hover'] = Lsp.with(lsp_handlers.hover, {
Expand Down Expand Up @@ -128,6 +114,8 @@ srv.lua_ls = executable('lua-language-server') and {} or nil
srv.bashls = executable({ 'bash-language-server', 'shellcheck' }) and {} or nil
srv.clangd = executable('clangd') and {} or nil
srv.cmake = executable('cmake-languqge-server') and {} or nil
srv.css_variables = executable('css-variables-language-server') and {} or nil
srv.cssls = executable('vscode-css-language-server') and {} or nil
srv.html = executable('vscode-html-language-server') and {} or nil
srv.jdtls = executable('jdtls') and {} or nil
srv.jsonls = executable('vscode-json-language-server') and {} or nil
Expand All @@ -147,6 +135,8 @@ function srv.new()
self.bashls = srv.bashls
self.clangd = srv.clangd
self.cmake = srv.cmake
self.css_variables = srv.css_variables
self.cssls = srv.cssls
self.html = srv.html
self.jdtls = srv.jdtls
self.jsonls = srv.jsonls
Expand Down Expand Up @@ -194,8 +184,8 @@ local Names = {
['<leader>l'] = { group = '+LSP' },
}

if WK.available() then
if WK.available() then
if wk_avail() then
if wk_avail() then
map_dict(Names, 'wk.register', false, 'n')
end

Expand Down Expand Up @@ -301,7 +291,7 @@ au('LspAttach', {
v = { ['<leader>lc'] = { group = '+Code Actions' } },
}

if WK.available() then
if wk_avail() then
map_dict(Names2, 'wk.register', true, nil, buf)
end
map_dict(K, 'wk.register', true, nil, buf)
Expand Down
2 changes: 2 additions & 0 deletions lua/user_api/types/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ require('user_api.types.user.highlight')
---@field bashls? LspServerOpts|nil
---@field clangd? LspServerOpts|nil
---@field cmake? LspServerOpts|nil
---@field css_variables? LspServerOpts|nil
---@field cssls? LspServerOpts|nil
---@field html? LspServerOpts|nil
---@field jdtls? LspServerOpts|nil
---@field jsonls? LspServerOpts|nil
Expand Down

0 comments on commit 4a457f5

Please sign in to comment.