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

charp-ls cannot work properly with coc.nvim #153

Closed
kalium222 opened this issue Apr 24, 2024 · 4 comments
Closed

charp-ls cannot work properly with coc.nvim #153

kalium222 opened this issue Apr 24, 2024 · 4 comments

Comments

@kalium222
Copy link

Hello guys, I am trying csharp-ls for both c# project and unity project with vim and coc.nvim. I met these problems

  • csharp-ls cannot recognize some newer features in c#, such as file scoped namespace:

    namespace A;  // report error here 

    or simplified new expression:

    List<int> A = new();   // report error here

    but they can be build with dotnet build.

  • csharp-ls cannot recognize all the unity things, such as UnityEngine, or Monobehaviour.

But when I was trying csharp-ls in the vscode with the extension, it works well. How to deal with this?

Some possibly useful information.

$ dotnet --version
8.0.104

$ mono --version
Mono JIT compiler version 6.12.0 (makepkg/0cbf0e290c3 Sat Mar  9 11:37:33 UTC 2024)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        Interpreter:   yes
        LLVM:          supported, not enabled.
        Suspend:       hybrid
        GC:            sgen (concurrent by default)

$ ~/.dotnet/tools/csharp-ls --version
csharp-ls, 0.12.0.0


$ vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Apr 18 2024 16:54:46)
Included patches: 1-346
Compiled by Arch Linux
...

And configure for coc.nvim:

        "csharp-ls": {
             "command": "~/.dotnet/tools/csharp-ls",
             "filetypes": ["cs"],
             "rootPatterns": ["*.csproj",  "*.sln"]
        }

Thanks very much.

@kalium222
Copy link
Author

Also, I found that csharp-ls is very slow in completion, for every client. I tried both coc.nvim and the vscode extension, and both have this problem.

@razzmatazz
Copy link
Owner

slowness problem has been reported in #151, a regression in 0.12.0

@kalium222
Copy link
Author

Ok, sorry for redundant issue; And I tweaked something in my lsp config, now it work well now.

@Kevinizevbigie
Copy link

What did you tweak @kalium222 ?

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