lsp updates

06-LSP
christianchiarulli 3 years ago
parent 0116a44ec8
commit 0981b28382

@ -4,3 +4,4 @@ require "user.plugins"
require "user.colorscheme" require "user.colorscheme"
require "user.cmp" require "user.cmp"
require "user.lsp" require "user.lsp"

@ -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.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 = ({ vim_item.menu = ({
nvim_lsp = "[LSP]", nvim_lsp = "[LSP]",
nvim_lua = "[NVIM_LUA]",
luasnip = "[Snippet]", luasnip = "[Snippet]",
buffer = "[Buffer]", buffer = "[Buffer]",
path = "[Path]", path = "[Path]",
@ -111,6 +112,7 @@ cmp.setup {
}, },
sources = { sources = {
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "nvim_lua" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },

@ -21,6 +21,11 @@ lsp_installer.on_server_ready(function(server)
opts = vim.tbl_deep_extend("force", sumneko_opts, opts) opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end 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. -- 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 -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts) server:setup(opts)

@ -1,9 +1,4 @@
local default_schemas = nil -- Find more schemas here: https://www.schemastore.org/json/
local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
if status_ok then
default_schemas = jsonls_settings.get_default_schemas()
end
local schemas = { local schemas = {
{ {
description = "TypeScript compiler configuration file", 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 = { local opts = {
settings = { settings = {
json = { json = {
schemas = extended_schemas, schemas = schemas,
}, },
}, },
setup = { setup = {

@ -0,0 +1,10 @@
return {
settings = {
python = {
analysis = {
typeCheckingMode = "off"
}
}
},
}

@ -56,6 +56,7 @@ return packer.startup(function(use)
use "hrsh7th/cmp-cmdline" -- cmdline completions use "hrsh7th/cmp-cmdline" -- cmdline completions
use "saadparwaiz1/cmp_luasnip" -- snippet completions use "saadparwaiz1/cmp_luasnip" -- snippet completions
use "hrsh7th/cmp-nvim-lsp" use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/cmp-nvim-lua"
-- snippets -- snippets
use "L3MON4D3/LuaSnip" --snippet engine use "L3MON4D3/LuaSnip" --snippet engine
@ -64,7 +65,6 @@ return packer.startup(function(use)
-- LSP -- LSP
use "neovim/nvim-lspconfig" -- enable LSP use "neovim/nvim-lspconfig" -- enable LSP
use "williamboman/nvim-lsp-installer" -- simple to use language server installer 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 -- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins -- Put this at the end after all plugins

Loading…
Cancel
Save