Skip to content

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

@mickaelistria

Description

@mickaelistria

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions