Archived
0
0
Fork 0

added json schema store and lsp signature

This commit is contained in:
Daryl Ronningen 2022-06-28 02:10:26 +08:00
parent 2349531c10
commit 636203b151
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
7 changed files with 49 additions and 7 deletions

View file

@ -73,6 +73,7 @@ M.on_attach = function(client, bufnr)
end end
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")

View file

@ -1,9 +1,26 @@
local status_ok, _ = pcall(require, "lspconfig") local status_ok, lspconfig = pcall(require, "lspconfig")
if not status_ok then if not status_ok then
return return
end end
require("user.lsp.installer") local schemastore_status_ok, schemastore = pcall(require, "schemastore")
require("user.lsp.nlsp") if not schemastore_status_ok then
require("user.lsp.nullls") return
end
lspconfig.jsonls.setup({
on_attach = require("user.lsp.handlers").on_attach,
capabilities = require("user.lsp.handlers").capabilities,
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
})
require("user.lsp.handlers").setup() require("user.lsp.handlers").setup()
require("user.lsp.installer")
require("user.lsp.nullls")
require("user.lsp.nlsp")
require("user.lsp.signature")

View file

@ -5,6 +5,7 @@ end
nlspsettings.setup({ nlspsettings.setup({
config_home = vim.fn.stdpath("config") .. "/lua/user/lsp/settings", config_home = vim.fn.stdpath("config") .. "/lua/user/lsp/settings",
local_settings_dir = ".nlsp-settings",
local_settings_root_markers = { ".git" }, local_settings_root_markers = { ".git" },
append_default_schemas = true, append_default_schemas = true,
loader = "json", loader = "json",

View file

@ -1,5 +1,3 @@
{ {
"volar.preview.script.nuxi": "node {NUXI_BIN} dev --port {PORT}", "volar.takeOverMode.enabled": true
"volar.takeOverMode.enabled": true,
"volar.codeLens.pugTools": true
} }

View file

@ -0,0 +1,11 @@
local status_ok, signature = pcall(require, "lsp_signature")
if not status_ok then
return
end
local cfg = {
floating_window = false, -- show hint in a floating window, set to false for virtual text only mode
}
signature.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
signature.on_attach(cfg) -- no need to specify bufnr if you don't use toggle_key

View file

@ -66,6 +66,10 @@ return packer.startup(function(use)
use("williamboman/nvim-lsp-installer") use("williamboman/nvim-lsp-installer")
use("tamago324/nlsp-settings.nvim") use("tamago324/nlsp-settings.nvim")
use("jose-elias-alvarez/null-ls.nvim") use("jose-elias-alvarez/null-ls.nvim")
use("b0o/SchemaStore.nvim")
use("ray-x/lsp_signature.nvim")
-- Trouble
use("folke/trouble.nvim") use("folke/trouble.nvim")
-- Telescope -- Telescope

View file

@ -79,6 +79,11 @@ _G.packer_plugins = {
path = "/home/relms/.local/share/nvim/site/pack/packer/start/LuaSnip", path = "/home/relms/.local/share/nvim/site/pack/packer/start/LuaSnip",
url = "https://github.com/L3MON4D3/LuaSnip" url = "https://github.com/L3MON4D3/LuaSnip"
}, },
["SchemaStore.nvim"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/SchemaStore.nvim",
url = "https://github.com/b0o/SchemaStore.nvim"
},
["alpha-nvim"] = { ["alpha-nvim"] = {
loaded = true, loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/alpha-nvim", path = "/home/relms/.local/share/nvim/site/pack/packer/start/alpha-nvim",
@ -149,6 +154,11 @@ _G.packer_plugins = {
path = "/home/relms/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", path = "/home/relms/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
url = "https://github.com/lukas-reineke/indent-blankline.nvim" url = "https://github.com/lukas-reineke/indent-blankline.nvim"
}, },
["lsp_signature.nvim"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/lsp_signature.nvim",
url = "https://github.com/ray-x/lsp_signature.nvim"
},
["lualine.nvim"] = { ["lualine.nvim"] = {
loaded = true, loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/lualine.nvim", path = "/home/relms/.local/share/nvim/site/pack/packer/start/lualine.nvim",