terraform updates

neovim_0.7
ray-x 2 years ago
parent 74eccbd799
commit 5773f66d14

@ -544,6 +544,11 @@ require'navigator'.setup({
```
Use lsp_installer configs
You can delegate the lsp server setup to lsp_installer with `server:setup{opts}`
Here is an example [init_lsp_installer.lua](https://github.com/ray-x/navigator.lua/blob/master/playground/init_lsp_installer.lua)
## Usage
Please refer to lua/navigator/lspclient/mapping.lua on key mappings. Should be able to work out-of-box.

@ -293,6 +293,9 @@ local setups = {
omnisharp = {
cmd = { 'omnisharp', '--languageserver', '--hostPID', tostring(vim.fn.getpid()) },
},
terraformls = {
filetypes = { 'terraform', 'tf'},
},
}
setups.sumneko_lua = vim.tbl_deep_extend('force', luadev, setups.sumneko_lua)
@ -379,7 +382,9 @@ local function load_cfg(ft, client, cfg, loaded)
end
local lspft = lspconfig[client].document_config.default_config.filetypes
local additional_ft = setups[client] and setups[client].filetypes or {}
local cmd = cfg.cmd
vim.list_extend(lspft, additional_ft)
local should_load = false
if lspft ~= nil and #lspft > 0 then
@ -703,6 +708,7 @@ local function setup(user_opts)
'defx',
'packer',
'gitcommit',
'windline',
}
for i = 1, #disable_ft do
if ft == disable_ft[i] or _LoadedFiletypes[ft] then
@ -721,7 +727,7 @@ local function setup(user_opts)
local clients = vim.lsp.buf_get_clients(bufnr)
for key, client in pairs(clients) do
if client.name ~= "null_ls" and client.name ~= "efm" then
if vim.tbl_contains(client.filetypes, vim.o.ft) then
if vim.tbl_contains(client.filetypes or {}, vim.o.ft) then
log('client already loaded', client.name)
end
end

@ -0,0 +1,86 @@
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
vim.g.coq_settings = {
['auto_start'] = 'shut-up',
}
local function load_plugins()
require('packer').startup({
function(use)
use('wbthomason/packer.nvim')
use('neovim/nvim-lspconfig')
use({
'williamboman/nvim-lsp-installer',
config = function()
local lsp_installer = require('nvim-lsp-installer')
local coq = require('coq')
local enhance_server_opts = {
['sumneko_lua'] = function(options)
options.settings = {
Lua = {
diagnostics = {
globals = { 'vim' },
},
},
}
end,
['tsserver'] = function(options)
options.on_attach = function(client)
client.resolved_capabilities.document_formatting = false
end
end,
}
lsp_installer.on_server_ready(function(server)
local options = {}
if enhance_server_opts[server.name] then
enhance_server_opts[server.name](options)
end
server:setup(coq.lsp_ensure_capabilities(options))
end)
end,
})
use({
'ray-x/navigator.lua',
config = function()
require('navigator').setup({
lsp_installer = true,
})
end,
})
use('ray-x/guihua.lua')
-- -- COQ (Autocompletion)
use('ms-jpq/coq_nvim')
use('ms-jpq/coq.artifacts')
use('ms-jpq/coq.thirdparty')
use('ray-x/aurora')
end,
config = {
package_root = package_root,
compile_path = install_path .. '/plugin/packer_compiled.lua',
},
})
-- navigator/LSP setup
end
if vim.fn.isdirectory(install_path) == 0 then
print('install packer')
vim.fn.system({
'git',
'clone',
'https://github.com/wbthomason/packer.nvim',
install_path,
})
load_plugins()
require('packer').sync()
vim.cmd('colorscheme aurora')
else
load_plugins()
vim.cmd('colorscheme aurora')
end
Loading…
Cancel
Save