コード例 #1
0
        private LSP.CompletionContext GetContextFromTrigger(CompletionTrigger trigger)
        {
            var context = new LSP.CompletionContext {
                TriggerCharacter = trigger.Character.ToString()
            };

            switch (trigger.Reason)
            {
            case CompletionTriggerReason.Invoke:
            case CompletionTriggerReason.InvokeAndCommitIfUnique:
            case CompletionTriggerReason.InvokeMatchingType:
                context.TriggerKind = LSP.CompletionTriggerKind.Invoked;
                break;

            case CompletionTriggerReason.Backspace:
            case CompletionTriggerReason.Deletion:
            case CompletionTriggerReason.FilterChange:
            case CompletionTriggerReason.Insertion:
                context.TriggerKind = LSP.CompletionTriggerKind.TriggerCharacter;
                break;

            default:
                context.TriggerKind = default(LSP.CompletionTriggerKind);
                break;
            }

            return(context);
        }
コード例 #2
0
        public async Task <object> GetCompletions(LSP.Position position, LSP.CompletionContext context, CancellationToken token)
        {
            var completionParams = new LSP.CompletionParams()
            {
                TextDocument = new LSP.TextDocumentIdentifier()
                {
                    Uri = DocumentUri,
                },
                Position = GetDocumentPosition(position),
                Context  = context,
            };

            var res = await _client.InvokeTextDocumentCompletionAsync(completionParams, token);

            return(res);
        }
コード例 #3
0
 public async Task <object> GetAnalysisCompletions(LSP.Position position, LSP.CompletionContext context, CancellationToken token)
 {
     return((await(_evaluator as IPythonInteractiveIntellisense)?.GetAnalysisCompletions(position, context, token))
            ?? Array.Empty <LSP.CompletionItem>());
 }
コード例 #4
0
 public Task <object> GetAnalysisCompletions(LSP.Position triggerPoint, LSP.CompletionContext context, CancellationToken token)
 {
     // No analysis completions for debug repl
     return(Task.FromResult <object>(null));
 }