Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I followed the example setup word by word and even deleted airline but this plugin doesnt seem to update &statusline variable #75

Open
ta3pks opened this issue Apr 23, 2022 · 2 comments

Comments

@ta3pks
Copy link

ta3pks commented Apr 23, 2022

local lsp_status = require "lsp-status"
lsp_status.register_progress()
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
capabilities = vim.tbl_extend('keep', capabilities or {}, lsp_status.capabilities)
require("nvim-lsp-installer").on_server_ready(function(server)
  local status_handler = lsp_status.extensions[server.name] or {setup = function() end}
  local cfg = {
    handlers = status_handler.setup(),
    capabilities = capabilities,
    on_attach = on_attach,
    flags = {
      -- This will be the default in neovim 0.7+
      debounce_text_changes = 150,
    },
  }
  if server.name == "rust_analyzer"  then
    cfg.settings ={ ['rust-analyzer'] = ra_config }
  elseif server.name == "denols" then
    cfg.init_options = {
    lint = true,
  }
  end
  server:setup(cfg)
end)
vim.cmd [[
function! LspStatus() abort
  if luaeval('#vim.lsp.buf_get_clients() > 0')
    return luaeval("require('lsp-status').status()")
  endif

  return ''
endfunction
]]

now if I update statusline manually doing let &statusline = LspStatus() all fine but the plugin doesnt to anything on its own which also defeats the purpose of having a statusline plugin
Am I missing something. I followed everything that the readme suggested

@NullVoxPopuli
Copy link

I'm having the same issue, except, I do have some output:

Error executing vim.schedule lua callback: ....mount_nvimjm8lVJ/usr/share/nvim/runtime/lua/vim/uri.lua:105: attempt to index local 'uri' (a nil valu
e)
stack traceback:
        ....mount_nvimjm8lVJ/usr/share/nvim/runtime/lua/vim/uri.lua:105: in function 'uri_to_fname'
        ...ack/packer/start/lsp-status.nvim/lua/lsp-status/util.lua:20: in function 'extract_symbols'
        ...tart/lsp-status.nvim/lua/lsp-status/current_function.lua:31: in function 'fn'
        ...ack/packer/start/lsp-status.nvim/lua/lsp-status/util.lua:71: in function 'handler'
        ....mount_nvimjm8lVJ/usr/share/nvim/runtime/lua/vim/lsp.lua:1043: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>

🙃

@donbex
Copy link

donbex commented Sep 18, 2022

@NikosEfthias Since it's not included in your configuration snippet, what is the definition of that on_attach function? I suspect it might not be calling lsp-status's own on_attach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants