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

Context not updating on buffer change. #150

Open
Wiper-R opened this issue Aug 21, 2024 · 0 comments
Open

Context not updating on buffer change. #150

Wiper-R opened this issue Aug 21, 2024 · 0 comments

Comments

@Wiper-R
Copy link

Wiper-R commented Aug 21, 2024

nvim-navic Configuration

return {
    "SmiteshP/nvim-navic",
    config = function()
        local navic = require("nvim-navic")
        navic.setup({
            icons = {
                File = "",
                Module = "",
                Namespace = "",
                Package = "",
                Class = "",
                Method = "",
                Property = "",
                Field = "",
                Constructor = "",
                Enum = "",
                Interface = "",
                Function = "",
                Variable = "",
                Constant = "",
                String = "",
                Number = "",
                Boolean = "",
                Array = "",
                Object = "",
                Key = "",
                Null = "",
                EnumMember = "",
                Struct = "",
                Event = "",
                Operator = "",
                TypeParameter = "",
            },
            lsp = {
                auto_attach = false,
                preference = nil,
            },
            highlight = false,
            separator = "",
            depth_limit = 0,
            depth_limit_indicator = "..",
            safe_output = true,
            click = false,
            format_text = function(text)
                return text
            end,
        })
    end,
}

LSP Configuration

local on_attach = function(client, bufnr)
    -- Attach navic only if the server supports document symbols
    if client.server_capabilities.documentSymbolProvider then
        navic.attach(client, bufnr)
    end
end

local lsp_servers = { "pyright", "lua_ls", "tsserver", "jsonls" }

for _, server in ipairs(lsp_servers) do
    lspconfig[server].setup({
        capabilities = capabilities,
        on_attach = on_attach,
    })
end
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

1 participant