pappasam / jedi-language-server

A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
MIT License
574 stars 44 forks source link

Not disable hover #317

Open snomfake opened 3 weeks ago

snomfake commented 3 weeks ago

I want to disable hover but for some reason the following error appears:

LSP[jedi_language_server]: Error ON_ATTACH_ERROR: "/home/darein/.config/nvim/lua/plugins/lspconfig.lua:11: attem
pt to index field 'resolved_capabilities' (a nil value)"

code

return {
  "neovim/nvim-lspconfig",
  dependencies = {
    "onsails/lspkind.nvim",
    "ray-x/lsp_signature.nvim",
    "williamboman/mason.nvim"
  },
  config = function()
    -- lspconfig
    local function on_attach(client, bufnr)
      client.resolved_capabilities.hover = false
      require("lsp_signature").on_attach(bufnr)
    end

    local capabilities = vim.lsp.protocol.make_client_capabilities()

    local lspconfig = require("lspconfig")
    lspconfig.jedi_language_server.setup({
      on_attach = on_attach,
      capabilities = capabilities,
      settings = {
        init_option = {
          completion = { disableSnippets = true },
          diagnostics = { enable = false },
          hover = { enable = false }
        }
      }
    })

    vim.lsp.handlers["textDocument/publishDiagnostics"] =
      vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
        update_in_insert = false
      })

    -- mason
    require("mason").setup({})
  end
}