Skip to content

Cmp documentation #95

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

Open
dakamakat opened this issue Jun 1, 2023 · 3 comments
Open

Cmp documentation #95

dakamakat opened this issue Jun 1, 2023 · 3 comments

Comments

@dakamakat
Copy link

dakamakat commented Jun 1, 2023

Hi , thanks for your work , I am currently using nvim with csharp-language-server with lsp-zero , installed through Mason , and noticed when I am choosing from the cmp there is no description being provided , is that my config issue or this feature does not provided ?

image

But i still can see description via vim.lsp.buf.hover().

image

here is my lsp config

local lsp = require('lsp-zero')

lsp.preset("recommended")

local cmp = require("cmp")

cmp.setup({
    snippet = {
        expand = function(args)
            require('luasnip').lsp_expand(args.body)
        end,
    },
    mapping = cmp.mapping.preset.insert({
        ['<C-d>'] = cmp.mapping.scroll_docs(-4),
        ['<C-f>'] = cmp.mapping.scroll_docs(4),
        ['<C-Space>'] = cmp.mapping.complete(),
        ['<C-e>'] = cmp.mapping.close(),
        ['<CR>'] = cmp.mapping.confirm({
            behavior = cmp.ConfirmBehavior.Replace,
            select = true
        }),
    }),
    sources = cmp.config.sources({
        { name = 'nvim_lsp' },
        { name = 'buffer' },
    }),
})

lsp.on_attach(function(client, bufnr)
    lsp.default_keymaps({ buffer = bufnr })
end)

-- Fix Undefined global 'vim'
lsp.configure('lua_ls', {
    settings = {
        Lua = {
            diagnostics = {
                globals = { 'vim' }
            }
        }
    }
})

local lspconfig = require('lspconfig');

lspconfig.csharp_ls.setup({
    root_dir = function(startpath)
        return lspconfig.util.root_pattern("*.sln")(startpath)
            or lspconfig.util.root_pattern("*.csproj")(startpath)
            or lspconfig.util.root_pattern("*.fsproj")(startpath)
            or lspconfig.util.root_pattern(".git")(startpath)
    end,
})

lsp.setup()

vim.diagnostic.config({
    virtual_text = true
})
@dakamakat dakamakat changed the title Cmp docs Cmp documentation Jun 1, 2023
@razzmatazz
Copy link
Owner

I think this could be related to #30

In particular autocompletion methods provided by roslyn do not provide this information (or did not provide it at the time -- I might need to revise this)

@dakamakat
Copy link
Author

Thanks for the responce , i will check this

@AndreM222
Copy link

Have same problem. Hope it gets fixed.

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