Comments (7)
hey @ianzhang366, thank you for your kind words;
I am running/testing csharp-ls on both m1 mac and linux, so things should be ok.
as for your problem, I believe this is how it should be, when you start csharp-ls
it enters LSP protocol mode where it waits for initialize
command from the editor -- thus there is no output.
you can verify things work by running it with --help
or --version
parameter:
bob@mbp ~ % csharp-ls --help
USAGE: csharp-ls [--help] [--version] [--loglevel <level>] [--solution <solution>]
OPTIONS:
--version, -v display versioning information
--loglevel, -l <level>
log level, <log|info|warning|error>; default is `log`
--solution, -s <solution>
.sln file to load (relative to CWD)
--help display this list of options.
bob@mbp ~ %
what are you trying to achieve?
from csharp-language-server.
Hi @razzmatazz thanks for your reply.
I'm trying to setup csharp-ls
on acme
editor with acme-lsp.
Now, I'm seeing the go to definition request goes to csharp-ls
and gets a response, but it seems the acme-lsp
don't know how to handle the response...
acme-lsp: $HOME/golang/src/acme-lsp/internal/golang_org_x_tools/jsonrpc2/jsonrpc2.go:144: Call, method: "textDocument/definition"
acme-lsp: $HOME/golang/src/acme-lsp/internal/golang_org_x_tools/jsonrpc2/jsonrpc2.go:197: Call, method: "textDocument/definition": response: "[{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1038,\"character\":20,\"debuggerDisplay\":\"(1038,20)\"},\"end\":{\"line\":1038,\"character\":29,\"debuggerDisplay\":\"(1038,29)\"},\"debuggerDisplay\":\"(1038,20)-(1038,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1045,\"character\":20,\"debuggerDisplay\":\"(1045,20)\"},\"end\":{\"line\":1045,\"character\":29,\"debuggerDisplay\":\"(1045,29)\"},\"debuggerDisplay\":\"(1045,20)-(1045,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1052,\"character\":20,\"debuggerDisplay\":\"(1052,20)\"},\"end\":{\"line\":1052,\"character\":29,\"debuggerDisplay\":\"(1052,29)\"},\"debuggerDisplay\":\"(1052,20)-(1052,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1074,\"character\":20,\"debuggerDisplay\":\"(1074,20)\"},\"end\":{\"line\":1074,\"character\":29,\"debuggerDisplay\":\"(1074,29)\"},\"debuggerDisplay\":\"(1074,20)-(1074,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1081,\"character\":20,\"debuggerDisplay\":\"(1081,20)\"},\"end\":{\"line\":1081,\"character\":29,\"debuggerDisplay\":\"(1081,29)\"},\"debuggerDisplay\":\"(1081,20)-(1081,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1088,\"character\":20,\"debuggerDisplay\":\"(1088,20)\"},\"end\":{\"line\":1088,\"character\":29,\"debuggerDisplay\":\"(1088,29)\"},\"debuggerDisplay\":\"(1088,20)-(1088,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1095,\"character\":20,\"debuggerDisplay\":\"(1095,20)\"},\"end\":{\"line\":1095,\"character\":29,\"debuggerDisplay\":\"(1095,29)\"},\"debuggerDisplay\":\"(1095,20)-(1095,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1102,\"character\":20,\"debuggerDisplay\":\"(1102,20)\"},\"end\":{\"line\":1102,\"character\":29,\"debuggerDisplay\":\"(1102,29)\"},\"debuggerDisplay\":\"(1102,20)-(1102,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1109,\"character\":20,\"debuggerDisplay\":\"(1109,20)\"},\"end\":{\"line\":1109,\"character\":29,\"debuggerDisplay\":\"(1109,29)\"},\"debuggerDisplay\":\"(1109,20)-(1109,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1116,\"character\":20,\"debuggerDisplay\":\"(1116,20)\"},\"end\":{\"line\":1116,\"character\":29,\"debuggerDisplay\":\"(1116,29)\"},\"debuggerDisplay\":\"(1116,20)-(1116,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1171,\"character\":20,\"debuggerDisplay\":\"(1171,20)\"},\"end\":{\"line\":1171,\"character\":29,\"debuggerDisplay\":\"(1171,29)\"},\"debuggerDisplay\":\"(1171,20)-(1171,29)\"}},{\"uri\":\"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs\",\"range\":{\"start\":{\"line\":1179,\"character\":20,\"debuggerDisplay\":\"(1179,20)\"},\"end\":{\"line\":1179,\"character\":29,\"debuggerDisplay\":\"(1179,29)\"},\"debuggerDisplay\":\"(1179,20)-(1179,29)\"}}]"
with error:
can't open /csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs: No such file or directory
To my understanding, the csharp:/metadata
already has the source file in memory, but it's not putting the source file to disk... that's why I got the above error...
but my question is, how do I let the csharp-ls
put source file to disk? or how would the acme-lsp
adapt to make this happen?
from csharp-language-server.
Hi @razzmatazz
I was able to send request to csharp/metadata
, but I'm getting error from the response, any idea what went wrong?
definition locations
L: /Users/ianzhang/golang/src/acme-lsp/internal/lsp/acmelsp/remote.go:133: ianzhang RemoteCmd Call, method:
locations: []protocol.Location{protocol.Location{
URI:"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs",
Range:1038:20-1038:29
},
request to csharp/metadata
L: /Users/ianzhang/golang/src/acme-lsp/internal/lsp/acmelsp/remote.go:135: ianzhang RemoteCmd Call, method: csharp/metadata with params:
&protocol.MetadataParams{
URI:"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs"
},
source: (*protocol.MetaSource)(nil),
response error: response error: Object reference not set to an instance of an object.
Object reference not set to an instance of an object
sounds like the metadata is not generated when I send out the csharp/metadata
request..
from csharp-language-server.
Mhm, null ref exception sounds weird.
You could look into emacs and nvim implementations to figure out what things to do:
- regarding nvim, @chen244 wrote this:
- I have emacs implementation here:
there is more info here #21 (comment)
But basically the editor should:
- recognize
csharp:/
uri coming from "go to definition" request (versus "normal" files on disk where uri prefix isfile:/
) - invoke csharp/metadata request with the uri
- collect the parsed source and path components from response and
- pass it somehow for the editor for the metadata to be rendered
not sure why you get object not found response.. can you pass me test project in a .zip or somehow so I could test it works for me with emacs?
from csharp-language-server.
Hi @razzmatazz
thanks for your reply.
Here's the sample code, I'm working with.
I will call 'text/Definition' at setup/Program.cs:7
, which will call csharp/metadata
with URI csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs
Then the error will show up.
from csharp-language-server.
hmm, I think it is working for me with emacs, here is lsp trace when i do "go to definition" with cursor on Console
on line 6 (7 if 1-based numbering)
[Trace - 09:18:32 PM] Sending request 'textDocument/definition - (201)'.
Params: {
"textDocument": {
"uri": "file:///Users/bob/Downloads/setup/Program.cs"
},
"position": {
"line": 6,
"character": 8
}
}
[Trace - 09:18:32 PM] Received response 'textDocument/definition - (201)' in 3ms.
Result: [
{
"uri": "csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs",
"range": {
"start": {
"line": 7,
"character": 20,
"debuggerDisplay": "(7,20)"
},
"end": {
"line": 7,
"character": 27,
"debuggerDisplay": "(7,27)"
},
"debuggerDisplay": "(7,20)-(7,27)"
}
}
]
[Trace - 09:18:32 PM] Sending request 'csharp/metadata - (202)'.
Params: {
"textDocument": {
"uri": "csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs"
}
}
[Trace - 09:18:32 PM] Received response 'csharp/metadata - (202)' in 3ms.
Result: {
"projectName": "setup",
"assemblyName": "System.Console",
"symbolName": "System.Console",
"source": "<decompiled source>"
}
does it look different in your case, maybe you just need to tune the params a bit?
from csharp-language-server.
Hi @razzmatazz thanks for the input!
You are right, I was sending bad request parameters... Now with
request: {"jsonrpc":"2.0","method":"csharp/metadata","params":{"textDocument":{"uri":"csharp:/metadata/projects/setup/assemblies/System.Console/symbols/System.Console.cs"}},"id":15}
I'm getting the metadata
back! Thanks a lot.
from csharp-language-server.
Related Issues (20)
- Code Action: Extract Interface (Produces Error) HOT 5
- charp-ls cannot work properly with coc.nvim HOT 4
- Doesn't show arguments of the function HOT 3
- Accepting action causes error HOT 3
- Rename action modifies comment and string words equal to Symbol text HOT 2
- Insert better namespace managing HOT 4
- Late diagnostic population HOT 1
- Move type to code action not creating file in nvim
- Deleting error
- Self-contained build
- Lsp keep reload the project HOT 7
- Snippets are not expandable using nvim-cmp
- Errors not showing up until I open file where error occurs HOT 1
- Objects in Linq queries missing type definition on hover
- Very slow on large amount of projects / Large codebases HOT 11
- Loggin with 0.14 doesn't work anymore HOT 3
- disable the autoformater
- Emacs LSP: Unrecognized command or argument 'csharp-ls' HOT 1
- lsp stop working after staing in standby for a while
- Go to definition of partial class involved with source generators errors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csharp-language-server.