public async Task <CompletionList> Handle(CompletionParams request, CancellationToken cancellationToken)
        {
            // Util.Log("Handling completion request.");
            // return new CompletionList(new CompletionItem{Label ="new version op"});
            // var result = await CompletionInstance.ProvideCompletionItems(request, server, _bufferManager);
            var result = await CompletionInstance.ProvideCompletionItems(request, Server.Instance, LanguageServer);

            return(result);
        }
Example #2
0
        public static async Task <CompletionList> ProvideCompletionItems(CompletionParams request, Server server, ILanguageServer langServer)
        {
            var documentWalker = new DocumentWalker(request.TextDocument, langServer);
            var wordToComplete = documentWalker.GetWordToComplete(request.Position);
            var projectName    = VscodeUtil.GetProjectName(request.TextDocument.Uri.LocalPath);

            // The case in which is no project
            if (projectName == null)
            {
                return(new CompletionList());
            }
            var completionInstance = new CompletionInstance(documentWalker, projectName, wordToComplete, server);

            return(await completionInstance.ProvideCompletionItems(request));
        }