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

Using language server protocal requires preliminary dotnet restore on local project #265

Open
mickaelistria opened this issue Jul 21, 2016 · 5 comments

Comments

@mickaelistria
Copy link

I'm connecting a Java client to omnisharp-node-client Language Server implementation. However, I don't manage to get completion or other output from it, whereas the same requests work with VSCode's Language Server implementation for CSS and JSON.

I always get something like (OUT is sent by my client to OmniSharp LS; IN is set by OmniSharp LS to my client:

OUT: 2.0
{"id":"2","method":"textDocument/completion","params":{"textDocument":{"uri":"file:/home/mistria/git/3dLocalizer/test.cs"},"uri":"file:/home/mistria/git/3dLocalizer/test.cs","position":{"line":6,"character":16}},"jsonrpc":"2.0"}
IN: 2.0
{"jsonrpc":"2.0","method":"telemetry/event","params":{"clientId":"client1","command":"/autocomplete","request":{"FileName":"/home/mistria/git/3dLocalizer/test.cs","Column":16,"Line":6,"WantDocumentationForEveryCompletionResult":true,"WantKind":true,"WantImportableTypes":true,"WantMethodHeader":true,"WantReturnType":true,"WantSnippet":false,"WordToComplete":""},"silent":false,"sequence":"__request6","time":"2016-07-21T13:45:07.902Z"}}
IN: 2.0
{"jsonrpc":"2.0","method":"telemetry/event","params":{"command":"/autocomplete","response":[],"clientId":"client1","request":{"FileName":"/home/mistria/git/3dLocalizer/test.cs","Column":16,"Line":6,"WantDocumentationForEveryCompletionResult":true,"WantKind":true,"WantImportableTypes":true,"WantMethodHeader":true,"WantReturnType":true,"WantSnippet":false,"WordToComplete":""},"sequence":"__request6","time":"2016-07-21T13:45:07.941Z","silent":false,"failed":false,"responseTime":39}}
IN: 2.0
{"jsonrpc":"2.0","id":"2","result":{"isIncomplete":false,"items":[]}}
IN: 2.0
{"jsonrpc":"2.0","method":"telemetry/event","params":{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Middleware.LoggingMiddleware","Message":"/autocomplete: 200 37ms"},"Seq":18,"Type":"event"}}

The code I'm trying to complete is

using System;
public class HelloWorld
{
    public static void hello()
    {
        Console.WriteLine("Hello world !");
        Console.ReadLine();
    }
}

just before ReadLine(), so I was expecting all fields is Console to be returned.

@david-driscoll
Copy link
Member

Is the project restored? I wonder if it's missing dependencies and just not able to offer any completions.

What about diagnostics, are those getting reported?

@mickaelistria
Copy link
Author

I have to do dotnet restore before connecting to the language-server? I didn't do it, as I expect the language server to take care of all such language-specific stuff.

@david-driscoll
Copy link
Member

We have a known issue in the language server where it sometimes doesn't restore like it should... that is something I need to tackle.

@mickaelistria
Copy link
Author

Ok, thanks for the hint, I'll try to restore first. Is the issue you mention already reported on another GitHub issue I could follow?

@mickaelistria
Copy link
Author

As you advised, I tried a dotnet restore and it works. Should I close the issue then or do we keep it alive to track the issue regarding running restore from the language server?

@mickaelistria mickaelistria changed the title Empty completion response using the language server protocal Using language server protocal requires preliminary dotnet restore on local project Jul 28, 2016
LucasBullen pushed a commit to LucasBullen/aCute that referenced this issue Nov 21, 2017
LucasBullen pushed a commit to LucasBullen/aCute that referenced this issue Nov 21, 2017
Re-add previously removed workaround for
OmniSharp/omnisharp-node-client#265

Signed-off-by: Lucas Bullen <lbullen@redhat.com>
LucasBullen pushed a commit to LucasBullen/aCute that referenced this issue Nov 21, 2017
Re-add previously removed workaround for
OmniSharp/omnisharp-node-client#265

Signed-off-by: Lucas Bullen <lbullen@redhat.com>
LucasBullen pushed a commit to LucasBullen/aCute that referenced this issue Nov 21, 2017
Re-add previously removed workaround for
OmniSharp/omnisharp-node-client#265

Signed-off-by: Lucas Bullen <lbullen@redhat.com>
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

2 participants