Skip to content

Commit

Permalink
Add new LSP things
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 26, 2023
1 parent dd40503 commit 2700b76
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 31 deletions.
67 changes: 36 additions & 31 deletions nvim/lua/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-- top-level
--------------------------------------------------------------------------------
require("mason").setup({
PATH = "prepend",
ui = {
border = "single",
},
Expand All @@ -28,6 +29,8 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagn

--------------------------------------------------------------------------------
-- mappings
-- TODO rewrite as autocmd
-- if client.server_capabilities.hoverProvider then ... etc
--------------------------------------------------------------------------------
local mapx = require("mapx")

Expand Down Expand Up @@ -130,11 +133,13 @@ local options_html = {
local options_pyright = {
on_attach = on_attach,
capabilities = capabilities_cmp,
-- settings = {
-- pyright = {
-- disableLanguageServices = true,
-- },
-- },
settings = {
pyright = {
exclude = {
"**/build"
}
},
},
}

local options_python = {
Expand Down Expand Up @@ -178,19 +183,19 @@ local options_rust = {
--------------------------------------------------------------------------------
-- lua
--------------------------------------------------------------------------------
USER = vim.fn.expand("$USER")

local sumneko_root_path = ""
local sumneko_binary = ""

sumneko_binary = "/Users/"
.. USER
.. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server"
sumneko_root_path = "/Users/" .. USER .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server"
-- USER = vim.fn.expand("$USER")
--
-- local sumneko_root_path = ""
-- local sumneko_binary = ""
--
-- sumneko_binary = "/Users/"
-- .. USER
-- .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server"
-- sumneko_root_path = "/Users/" .. USER .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server"

local options_lua = {
on_attach = on_attach,
cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" },
-- cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" },
capabilities = capabilities_cmp,
settings = {
Lua = {
Expand Down Expand Up @@ -231,12 +236,12 @@ local options_ruby = {
--------------------------------------------------------------------------------
-- efm
--------------------------------------------------------------------------------
local prettierd_options = {
formatCommand = 'prettierd "${INPUT}"',
local prettier_options = {
formatCommand = 'prettier "${INPUT}"',
formatStdin = true,
env = {
string.format("PRETTIERD_DEFAULT_CONFIG=%s", vim.fn.expand("~/.prettierrc.json")),
},
-- env = {
-- string.format("PRETTIERD_DEFAULT_CONFIG=%s", vim.fn.expand("~/.prettierrc.json")),
-- },
}

local options_efm = {
Expand All @@ -258,22 +263,22 @@ local options_efm = {
formatCommand = "isort --quiet -",
formatStdin = true,
},
{
lintCommand = "flake8 -",
lintStdin = true,
lintFormats = { "%f:%l:%c: %m" },
},
-- {
-- lintCommand = "flake8 -",
-- lintStdin = true,
-- lintFormats = { "%f:%l:%c: %m" },
-- },
},
yaml = { prettierd_options },
html = { prettierd_options },
css = { prettierd_options },
yaml = { prettier_options },
html = { prettier_options },
css = { prettier_options },
json = {
prettierd_options,
prettier_options,
},
javascript = { prettierd_options },
javascript = { prettier_options },
},
},
filetypes = { "lua", "python", "yaml", "html", "css", "json", "javascript" },
-- filetypes = { "lua", "python", "yaml", "html", "css", "json", "javascript" },
}

--------------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions nvim/lua/packer_plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ return require("packer").startup({
{ "hrsh7th/nvim-cmp" },
{ "hrsh7th/vim-vsnip" },
{ "hrsh7th/vim-vsnip-integ" },
-- Plug 'hrsh7th/cmp-path' # TODO look at
-- Plug 'hrsh7th/cmp-cmdline'
{ "williamboman/mason.nvim" },
{ "williamboman/mason-lspconfig.nvim" },
},
Expand Down

0 comments on commit 2700b76

Please sign in to comment.