csharp-language-server icon indicating copy to clipboard operation
csharp-language-server copied to clipboard

Cmp documentation

Open dakamakat opened this issue 2 years ago • 3 comments

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 avatar Jun 01 '23 22:06 dakamakat

I think this could be related to https://github.com/razzmatazz/csharp-language-server/issues/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)

razzmatazz avatar Jun 19 '23 12:06 razzmatazz

Thanks for the responce , i will check this

dakamakat avatar Jun 25 '23 00:06 dakamakat

Have same problem. Hope it gets fixed.

AndreM222 avatar Nov 10 '23 14:11 AndreM222