Closed Melandel closed 4 years ago
Hi @Melandel, I don't think I've seen that code action offered before. How do I repro?
Let me try to get a simple scenario for you :)
I can reproduce with 4 projects (sorry if I couldn't do better)
Here's a repo with the code: git@github.com:Melandel/AddAProjectReference.git
You can reproduce by running omnisharp on the sln
file and put the cursor on C/OtherInterfaceImplementation.cs
, raw 3 on the interface OtherInterface
, then trigger GetCodeActions
.
I get these options:
Basically, C.csproj
has a reference to B.csproj
- C.csproj
tries to implement an interface defined in B.csproj
.
However, that interface requires O.csproj
for a return type (DataStructure
).
So C.csproj
knows the interface but misses the link with O.csproj
's DataStructure
- that our sln
knows of.
I think the tricky part to reproduce is to have the cursor on the Interface
, the code action doesn't seem to appear when the cursor is on another location.
OK I see what you mean. Running that code action, we get this response from the server:
{
"Request_seq": 1009,
"Command": "/v2/runcodeaction",
"Running": true,
"Success": true,
"Message": null,
"Body": {
"Changes": []
},
"Seq": 1625,
"Type": "response"
}
It might be that we should be requesting it differently, I'll try to see what happens in VSCode
I tried in VSCode and got the exact same result. I think you're going to need to ask this in omnisharp-rolsyn/issues
@Melandel I created an issue: https://github.com/OmniSharp/omnisharp-roslyn/issues/1873
Thanks for the repro, that makes it easy to demonstrate.
Hello,
Omnisharp proposes to add a project reference for me, which is nice, but for now, when I select that action, a
No action taken
is displayed.Is it possible to implement this code action?