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

Trying csharp-ls #63

Open
queil opened this issue May 12, 2024 · 0 comments
Open

Trying csharp-ls #63

queil opened this issue May 12, 2024 · 0 comments

Comments

@queil
Copy link

queil commented May 12, 2024

Thanks for the great plugin. I've been successfully using it with F# (fsautocomplete) with a few mods in my fork. However, I had little success with csharp-ls. It seems the server tries to register a dynamic capability which I do not think it is supported here. The LSP spec highlights we can prevent the server from trying register it but I am not sure how to modify the plugin code to set this up. Any ideas?

Micro debug log:

2024/05/12 11:29:24 Micro started
2024/05/12 11:29:24 ONBUFFEROPEN unknown
2024/05/12 11:29:24 ONBUFFEROPEN unknown
2024/05/12 11:29:24 ONBUFFEROPEN csharp
2024/05/12 11:29:24 Server Options map[1:csharp=csharp-ls 2:fsharp=fsautocomplete --adaptive-lsp-server-enabled --project-graph-enabled={"fsiExtraParameters":["--compilertool:/home/queil/.fsharp/fsx-extensions/.fsch"]} 3:python=pylsp 4:go=gopls 5:typescript=deno lsp 6:javascript=deno lsp 7:markdown=deno lsp 8:json=deno lsp 9:jsonc=deno lsp 10:rust=rust-analyzer 11:lua=lua-language-server 12:c++=clangd 13:dart=dart language-server]
2024/05/12 11:29:24 Starting server csharp
2024/05/12 11:29:24 csharp>>> initialize
2024/05/12 11:29:24 ONSTDERR [11:29:24.663 INF] [Initialization] initializing, csharp-ls version 0.13.0.0

2024/05/12 11:29:24 csharp <<< window/showMessage
2024/05/12 11:29:24 DATA map[jsonrpc:2.0 method:window/showMessage params:map[message:csharp-ls: initializing, version 0.13.0.0 type:3]]

... TRUNCATED MANY LINES LIKE THE ABOVE ...

2024/05/12 11:29:24 DATA map[jsonrpc:2.0 method:window/showMessage params:map[message:csharp-ls: initializing, version 0.13.0.0 type:3]]
2024/05/12 11:29:24 Parsing failed Content-Length: 121

{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":3,"message":"csharp-ls: initializing, version 0.13.0.0"}}
2024/05/12 11:29:24 ONSTDERR [11:29:24.702 INF] [Initialization] csharp-ls is released under MIT license and is not affiliated with Microsoft Corp.; see https://github.com/razzmatazz/csharp-language-server

2024/05/12 11:29:24 csharp <<< window/showMessage
2024/05/12 11:29:24 DATA map[jsonrpc:2.0 method:window/showMessage params:map[message:csharp-ls: csharp-ls is released under MIT license and is not affiliated with Microsoft Corp.; see https://github.com/razzmatazz/csharp-language-server type:3]]
2024/05/12 11:29:24 ONSTDERR [11:29:24.712 INF] [Initialization] MSBuildLocator: will register ".NET Core SDK", Version=8.0.104 as default instance

2024/05/12 11:29:24 csharp <<< no method
2024/05/12 11:29:24 DATA map[id:0 jsonrpc:2.0 result:map[capabilities:map[callHierarchyProvider:true codeActionProvider:map[resolveProvider:true] codeLensProvider:map[resolveProvider:true] completionProvider:map[triggerCharacters:map[1:. 2:']] definitionProvider:true documentFormattingProvider:true documentHighlightProvider:true documentOnTypeFormattingProvider:map[firstTriggerCharacter:; moreTriggerCharacter:map[1:} 2:)]] documentRangeFormattingProvider:true documentSymbolProvider:true hoverProvider:true implementationProvider:true inlayHintProvider:map[resolveProvider:false] referencesProvider:true renameProvider:true semanticTokensProvider:map[full:true legend:map[tokenModifiers:map[1:static] tokenTypes:map[1:class 2:comment 3:property 4:enumMember 5:enum 6:event 7:method 8:variable 9:interface 10:keyword 11:namespace 12:number 13:operator 14:parameter 15:struct 16:regex 17:string 18:typeParameter]] range:true] signatureHelpProvider:map[triggerCharacters:map[1:( 2:, 3:< 4:{ 5:[]] textDocumentSync:map[change:2 openClose:true save:map[includeText:true]] typeDefinitionProvider:true typeHierarchyProvider:true workspaceSymbolProvider:true]]]
2024/05/12 11:29:24 Received message for csharp initialize : map[id:0 jsonrpc:2.0 result:map[capabilities:map[callHierarchyProvider:true codeActionProvider:map[resolveProvider:true] codeLensProvider:map[resolveProvider:true] completionProvider:map[triggerCharacters:map[1:. 2:']] definitionProvider:true documentFormattingProvider:true documentHighlightProvider:true documentOnTypeFormattingProvider:map[firstTriggerCharacter:; moreTriggerCharacter:map[1:} 2:)]] documentRangeFormattingProvider:true documentSymbolProvider:true hoverProvider:true implementationProvider:true inlayHintProvider:map[resolveProvider:false] referencesProvider:true renameProvider:true semanticTokensProvider:map[full:true legend:map[tokenModifiers:map[1:static] tokenTypes:map[1:class 2:comment 3:property 4:enumMember 5:enum 6:event 7:method 8:variable 9:interface 10:keyword 11:namespace 12:number 13:operator 14:parameter 15:struct 16:regex 17:string 18:typeParameter]] range:true] signatureHelpProvider:map[triggerCharacters:map[1:( 2:, 3:< 4:{ 5:[]] textDocumentSync:map[change:2 openClose:true save:map[includeText:true]] typeDefinitionProvider:true typeHierarchyProvider:true workspaceSymbolProvider:true]]]
2024/05/12 11:29:24 csharp>>> initialized
2024/05/12 11:29:24 Found running lsp server for  csharp firing textDocument/didOpen...
2024/05/12 11:29:24 csharp>>> textDocument/didOpen
2024/05/12 11:29:24 ONSTDERR [11:29:24.775 VRB] [Initialization] handleInitialized: "initialized" notification received from client

2024/05/12 11:29:24 csharp <<< client/registerCapability
2024/05/12 11:29:24 DATA map[id:2 jsonrpc:2.0 method:client/registerCapability params:map[registrations:map[1:map[id:f6a442a6-1f98-4126-a64e-c0947bda6d5f method:textDocument/prepareTypeHierarchy registerOptions:map[documentSelector:map[1:map[pattern:**/*.cs scheme:file]]]]]]]
2024/05/12 11:29:24 Unhandled message 1 csharp Content-Length: 260

{"jsonrpc":"2.0","id":2,"method":"client/registerCapability","params":{"registrations":[{"id":"f6a442a6-1f98-4126-a64e-c0947bda6d5f","method":"textDocument/prepareTypeHierarchy","registerOptions":{"documentSelector":[{"scheme":"file","pattern":"**/*.cs"}]}}]}}

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