Skip to content

Builtin LSP

smolck edited this page May 9, 2021 · 6 revisions

Configuration

Using nvim_lspconfig and the builtin LSP (requires neovim built from the latest master):

  -- Only want to do this config when Uivonim is in use, so do a check for that.
  if vim.g.uivonim == 1 then
    -- Get the override callbacks.
    local lsp_callbacks = require'uivonim.lsp'.callbacks

    nvim_lsp.texlab.setup {
      -- Pass in the callbacks to override the defaults with Uivonim's.
      handlers = lsp_callbacks;
      
      -- Can still use other options, like this on_attach function
      -- from nvim-lua/completion-nvim (recommended).
      on_attach = require('completion').on_attach
    }

    nvim_lsp.tsserver.setup {
      callbacks = lsp_callbacks;
    }

    -- Etc.
  end

Commands such as :lua vim.lsp.buf.code_action(), :lua vim.lsp.buf.hover(), or :lua vim.lsp.buf.references() then use Uivonim GUI elements rather than neovim floats or quickfix lists.

Clone this wiki locally