You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of course I did not find anyone having this exact issue online (but I found plenty cases of the opposite happening, quite ironically x) )
Description
Hi,
I tried for some time to get ltex-ls to not autostart on my config, without success. While I first thought that this was due to ltex plugin "barreiroleo/ltex-extra.nvim" being present, I found out after some troubleshooting that this was the case for other "bare" LSPs such as lua_ls.
And this is despite LspInfo reporting that autostart is indeed set to false :
lspconfig: require("lspconfig.health").check()
LSP configs active in this session (globally) ~
- Configured servers: jdtls, basedpyright, clangd, dockerls, docker_compose_language_service, cssls, intelephense, spectral, rust_analyzer, glsl_analyzer, lua_ls, ltex, arduino_language_server, bashls, omnisharp, asm_lsp, denols
- OK Deprecated servers: (none)
LSP configs active in this buffer (bufnr: 1) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `markdown`
- 1 client(s) attached to this buffer
- Client: `ltex` (id: 1, bufnr: [1])
root directory: Running in single file mode.
filetypes: latex, tex, bib, markdown
cmd: ~/ltex-ls
version: `"ltex-ls": "16.0.0",`
executable: true
autostart: false
Docs for active configs: ~
[...]
Here is my lsp config for reference
---- setup LSP list--localhelpers=require("helpers")
-- all config "presets" flavorslocaldefault_config= {"clangd", "jdtls", "basedpyright", "bashls", "dockerls", "docker_compose_language_service", "arduino_language_server", "cssls","intelephense","spectral","rust_analyzer", "glsl_analyzer"}
localroot_dir_config= {"omnisharp", "asm_lsp", "denols"}
localother_config= {"lua_ls", "ltex"}
locallsp_list=helpers.table_cat(helpers.table_cat(default_config, root_dir_config), other_config)
locallspconfig=require("lspconfig")
---- mason config--require("mason").setup({
ui= {
check_outdated_packages_on_open=true,
border="none",
icons= {
package_installed="",
package_pending="→",
package_uninstalled="✕"
}
}
})
---- mason-lspconfig config--require("mason-lspconfig").setup({
ensure_installed=lsp_list,
automatic_installation=false,
})
-- setup capabilities and on_attach according to what nvim_cmp can dolocalcapabilities=require('cmp_nvim_lsp').default_capabilities()
localon_attach=function(client, bufnr)
-- Mappings.-- See `:help vim.lsp.*` for documentation on any of the below functionslocalbufopts= { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
-- Apply action when "fix available" from lspvim.keymap.set('n', '<leader>a', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', require("telescope.builtin").lsp_references, bufopts)
vim.keymap.set('n', '<space>F', function() vim.lsp.buf.format { async=true } end, bufopts)
-- Cycle through code diagnosticsvim.keymap.set('n', '<leader>o', '<cmd>lua vim.diagnostic.open_float()<CR>', bufopts)
vim.keymap.set('n', '<leader>[', '<cmd>lua vim.diagnostic.goto_prev()<CR>', bufopts)
vim.keymap.set('n', '<leader>]', '<cmd>lua vim.diagnostic.goto_next()<CR>', bufopts)
end---- Sugar--local_border="none"vim.lsp.handlers["textDocument/hover"] =vim.lsp.with(
vim.lsp.handlers.hover, {
border=_border
}
)
vim.lsp.handlers["textDocument/signatureHelp"] =vim.lsp.with(
vim.lsp.handlers.signature_help, {
border=_border
}
)
vim.diagnostic.config{
float={border=_border}
}
---- activate LSPs...---- ... with a default configuration ...for_,lspinipairs(default_config) dolspconfig[lsp].setup{ capabilities=capabilities, on_attach=on_attach }
end-- ... specify the root directory for those that need it ...for_,lspinipairs(root_dir_config) dolspconfig[lsp].setup{ root_dir=function() returnvim.loop.cwd() end }
end-- and provide special care for some :)lspconfig.ltex.setup({
capabilities=capabilities,
on_attach=function(client, bufnr)
on_attach(client, bufnr)
require("ltex_extra").setup({
path=vim.fn.expand("~") .."/.local/share/ltex"
})
end,
autostart=false,
window_border=_border,
filetypes= { "latex", "tex", "bib", "markdown" },
settings= {
ltex= {
language="auto",
--disabledRules = { ["fr"] = { "MORFOLOGIK_RULE_FR_FR" }, },--dictionary = { ["fr"] = { "Dummy0", "Dummy1", "Dummy2", "Dummy3", "Dummy4", "Dummy5" } },
},
},
})
lspconfig.lua_ls.setup({
capabilities=capabilities,
on_attach=on_attach,
autostart=false,
settings= {
Lua= {
runtime= {
-- Tell the language server which version of Lua you're using-- (most likely LuaJIT in the case of Neovim)version='LuaJIT',
},
diagnostics= {
-- Get the language server to recognize the `vim` globalglobals= { 'vim', 'require' },
},
workspace= {
-- Make the server aware of Neovim runtime fileslibrary=vim.api.nvim_get_runtime_file("", true),
checkThirdParty=false, -- to avoid having the "do you want to use the luassert environment" every time
},
-- Do not send telemetry data containing a randomized but unique identifiertelemetry= { enable=false, },
},
},
})
lspconfig.omnisharp.setup({
capabilities=capabilities,
on_attach=on_attach,
enable_editorconfig_support=true,
enable_ms_build_load_projects_on_demand=false,
enable_roslyn_analyzers=true,
enable_import_completion=true,
handlers= {
["textDocument/definition"] =require('omnisharp_extended').handler,
},
cmd= { "omnisharp", '--languageserver', '--hostPID', tostring(vim.fn.getpid()) },
})
lspconfig.clangd.setup({
capabilities=capabilities,
on_attach=on_attach,
cmd= { "clangd", "--fallback-style=UseTab: Never", "--fallback-style=IndentWidth: 4", "--fallback-style=TabWidth: 4"},
})
The text was updated successfully, but these errors were encountered:
Description
Hi,
I tried for some time to get ltex-ls to not autostart on my config, without success. While I first thought that this was due to ltex plugin "barreiroleo/ltex-extra.nvim" being present, I found out after some troubleshooting that this was the case for other "bare" LSPs such as lua_ls.
And this is despite
LspInfo
reporting that autostart is indeed set to false :Here is my lsp config for reference
The text was updated successfully, but these errors were encountered: