summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorchristianchiarulli <chrisatmachine@gmail.com>2021-12-20 23:27:38 -0500
committerchristianchiarulli <chrisatmachine@gmail.com>2021-12-20 23:27:38 -0500
commit0981b2838275468ad1863aba908379af63209e7a (patch)
tree756a59aedf24fdb0766eeb0a795f4e985281ae91 /lua
parent0116a44ec810e9fdd05b2a6a838a550e98eda8b3 (diff)
lsp updates
Diffstat (limited to 'lua')
-rw-r--r--lua/user/cmp.lua2
-rw-r--r--lua/user/lsp/lsp-installer.lua5
-rw-r--r--lua/user/lsp/settings/jsonls.lua18
-rw-r--r--lua/user/lsp/settings/pyright.lua10
-rw-r--r--lua/user/plugins.lua2
5 files changed, 20 insertions, 17 deletions
diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua
index a151214..0ba1fc7 100644
--- a/lua/user/cmp.lua
+++ b/lua/user/cmp.lua
@@ -102,6 +102,7 @@ cmp.setup {
-- vim_item.kind = string.format('%s %s', kind_icons[vim_item.kind], vim_item.kind) -- This concatonates the icons with the name of the item kind
vim_item.menu = ({
nvim_lsp = "[LSP]",
+ nvim_lua = "[NVIM_LUA]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
@@ -111,6 +112,7 @@ cmp.setup {
},
sources = {
{ name = "nvim_lsp" },
+ { name = "nvim_lua" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
diff --git a/lua/user/lsp/lsp-installer.lua b/lua/user/lsp/lsp-installer.lua
index 2fe4af2..f539050 100644
--- a/lua/user/lsp/lsp-installer.lua
+++ b/lua/user/lsp/lsp-installer.lua
@@ -21,6 +21,11 @@ lsp_installer.on_server_ready(function(server)
opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end
+ if server.name == "pyright" then
+ local pyright_opts = require("user.lsp.settings.pyright")
+ opts = vim.tbl_deep_extend("force", pyright_opts, opts)
+ end
+
-- This setup() function is exactly the same as lspconfig's setup function.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)
diff --git a/lua/user/lsp/settings/jsonls.lua b/lua/user/lsp/settings/jsonls.lua
index 1fffa68..be362c9 100644
--- a/lua/user/lsp/settings/jsonls.lua
+++ b/lua/user/lsp/settings/jsonls.lua
@@ -1,9 +1,4 @@
-local default_schemas = nil
-local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
-if status_ok then
- default_schemas = jsonls_settings.get_default_schemas()
-end
-
+-- Find more schemas here: https://www.schemastore.org/json/
local schemas = {
{
description = "TypeScript compiler configuration file",
@@ -168,19 +163,10 @@ local schemas = {
},
}
-local function extend(tab1, tab2)
- for _, value in ipairs(tab2) do
- table.insert(tab1, value)
- end
- return tab1
-end
-
-local extended_schemas = extend(schemas, default_schemas)
-
local opts = {
settings = {
json = {
- schemas = extended_schemas,
+ schemas = schemas,
},
},
setup = {
diff --git a/lua/user/lsp/settings/pyright.lua b/lua/user/lsp/settings/pyright.lua
new file mode 100644
index 0000000..6354274
--- /dev/null
+++ b/lua/user/lsp/settings/pyright.lua
@@ -0,0 +1,10 @@
+return {
+ settings = {
+
+ python = {
+ analysis = {
+ typeCheckingMode = "off"
+ }
+ }
+ },
+}
diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua
index 45141e2..17dd7b5 100644
--- a/lua/user/plugins.lua
+++ b/lua/user/plugins.lua
@@ -56,6 +56,7 @@ return packer.startup(function(use)
use "hrsh7th/cmp-cmdline" -- cmdline completions
use "saadparwaiz1/cmp_luasnip" -- snippet completions
use "hrsh7th/cmp-nvim-lsp"
+ use "hrsh7th/cmp-nvim-lua"
-- snippets
use "L3MON4D3/LuaSnip" --snippet engine
@@ -64,7 +65,6 @@ return packer.startup(function(use)
-- LSP
use "neovim/nvim-lspconfig" -- enable LSP
use "williamboman/nvim-lsp-installer" -- simple to use language server installer
- use "tamago324/nlsp-settings.nvim" -- language server settings defined in json for
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins