Beispiel #1
0
        internal virtual void Completion(LanguageClient client)
        {
            RequestId requestId;
            {
                var param = new CompletionParams();
#if false
                param.context.triggerKind      = CompletionTriggerKind.TriggerCharacter;
                param.context.triggerCharacter = ".";
#else
                param.context.triggerKind      = CompletionTriggerKind.TriggerCharacter;
                param.context.triggerCharacter = ".";
#endif
                param.textDocument.uri   = sourceUri.AbsoluteUri;
                param.position.line      = compilationPosition.line;
                param.position.character = compilationPosition.character;

                requestId = client.Send.TextDocumentCompletion(param);
            }
            var millisecondsTimeout = 6000;
            //Console.WriteLine(string.Format("millisecondsTimeout={0}", millisecondsTimeout));
            var completion = (CompletionList)client.QueryResponse(requestId, millisecondsTimeout).item;
            if (completion == null)
            {
                Console.WriteLine("Compilation is failed or timeout.");
                //throw new Exception();
            }
            else
            {
                Console.WriteLine("[Success]completion.items.Length={0}", completion.items.Length);
            }
        }
Beispiel #2
0
        internal virtual void Shutdown(LanguageClient client)
        {
            var requestId = client.Send.Shutdown();
            var error     = client.QueryResponse(requestId).item as ResponseError;

            if (error != null)
            {
                Console.WriteLine("[Failed]Shutdown.");
                return;
            }
            client.Send.Exit();
            client.Send.LoggingResponseLeak();
            Console.WriteLine("[Success]Shutdown.");
        }