In advance, I apologize if the code looks messy; I tried pasting my code into the "add code here" thing and it kinda only took the first line and ignored formatting on the rest.
I use Neovim. I want autocompletion so I've installed a few language servers for languages that I'm using a the moment (you'll see in my cmp.lua under lspconfig). Despite installing language servers and configuring them, when I call :LspInfo while in a file with a matching language to one of my servers I see "no active clients" from vim.lsp. The .git root marker exists for every project I've tried this on. I'll show you my :LspInfo on a Python file with a .git root marker for the project and then my cmp.lua. I just want to know if there's anything obvious I'm missing.
:LspInfo ============================================================================== vim.lsp: ✅ - LSP log level : WARN - Log path: /home/c3/.local/state/nvim/lsp.log - Log size: 240 KB vim.lsp: Active Clients ~ - No active clients vim.lsp: Enabled Configurations ~ - cssls: - capabilities: { textDocument = { completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "additionalTextEdits", "insertTextFormat", "insertTextMode", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 } } } - cmd: { "vscode-css-language-server", "--stdio" } - filetypes: css, scss, less - init_options: { provideFormatter = true } - root_markers: package.json, .git - settings: { css = { validate = true }, less = { validate = true }, scss = { validate = true } } - html: - capabilities: { textDocument = { completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "additionalTextEdits", "insertTextFormat", "insertTextMode", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 } } } - cmd: { "vscode-html-language-server", "--stdio" } - filetypes: html, templ - init_options: { configurationSection = { "html", "css", "javascript" }, embeddedLanguages = { css = true, javascript = true }, provideFormatter = true } - root_markers: package.json, .git - settings: {} - pyright: - capabilities: { textDocument = { completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "additionalTextEdits", "insertTextFormat", "insertTextMode", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 } } } - cmd: { "pyright-langserver", "--stdio" } - filetypes: python - on_attach: <function @/home/c3/.local/share/nvim/lazy/nvim-lspconfig/lsp/pyright.lua:43> - root_markers: pyproject.toml, setup.py, setup.cfg, requirements.txt, Pipfile, pyrightconfig.json, .git - settings: { python = { analysis = { autoSearchPaths = true, diagnosticMode = "openFilesOnly", useLibraryCodeForTypes = true } } } - ts_ls: - capabilities: { textDocument = { completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "additionalTextEdits", "insertTextFormat", "insertTextMode", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionList = { itemDefaults = { "commitCharacters", "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false, insertTextMode = 1 } } } - cmd: { "typescript-language-server", "--stdio" } - filetypes: javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx - handlers: { ["_typescript.rename"] = <function 1> } - init_options: { hostInfo = "neovim" } - on_attach: <function @/home/c3/.local/share/nvim/lazy/nvim-lspconfig/lsp/ts_ls.lua:100> - root_markers: tsconfig.json, jsconfig.json, package.json, .git vim.lsp: File Watcher ~ - file watching "(workspace/didChangeWatchedFiles)" disabled on all clients vim.lsp: Position Encodings ~ - No active clients cmp.lua
-- Set up nvim-cmp. local cmp = require'cmp' require("luasnip.loaders.from_vscode").lazy_load() cmp.setup({ snippet = { expand = function(args) require('luasnip').lsp_expand(args.body) -- For `luasnip` users. end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ ['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-Space>'] = cmp.mapping.complete(), ['<C-e>'] = cmp.mapping.abort(), ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, -- For luasnip users. { name = 'path' }, }, { { name = 'buffer'}, }), formatting = { format = require("nvim-highlight-colors").format } }) -- Set configuration for specific filetype. cmp.setup.filetype('gitcommit', { sources = cmp.config.sources({ { name = 'git' }, }, { { name = 'buffer' }, }) }) require("cmp_git").setup() -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }), matching = { disallow_symbol_nonprefix_matching = false } }) -- Set up lspconfig local capabilities = require('cmp_nvim_lsp').default_capabilities() vim.lsp.config('html', { capabilities = capabilities }) vim.lsp.enable('html') vim.lsp.config('ts_ls', { capabilities = capabilities }) vim.lsp.enable('ts_ls') vim.lsp.config('cssls', { capabilities = capabilities }) vim.lsp.enable('cssls') vim.lsp.config('pyright', { capabilities = capabilities }) vim.lsp.enable('pyright') Any help would be appreciated, including letting me know whether I posted this question wrong or anything like that. Thank you so much for your help.