Esempio n. 1
0
 protected static LSP.CompletionParams CreateCompletionParams(
     LSP.Location caret,
     LSP.VSCompletionInvokeKind invokeKind,
     string triggerCharacter,
     LSP.CompletionTriggerKind triggerKind)
 => new LSP.CompletionParams()
 {
     TextDocument = CreateTextDocumentIdentifier(caret.Uri),
     Position     = caret.Range.Start,
     Context      = new LSP.VSCompletionContext()
     {
         InvokeKind       = invokeKind,
         TriggerCharacter = triggerCharacter,
         TriggerKind      = triggerKind,
     }
 };
Esempio n. 2
0
        public static Completion.CompletionTriggerKind LSPToRoslynCompletionTriggerKind(LSP.CompletionTriggerKind triggerKind)
        {
            switch (triggerKind)
            {
            case LSP.CompletionTriggerKind.Invoked:
                return(Completion.CompletionTriggerKind.Invoke);

            case LSP.CompletionTriggerKind.TriggerCharacter:
                return(Completion.CompletionTriggerKind.Insertion);

            default:
                // LSP added a TriggerKind that we need to support.
                Logger.Log(FunctionId.LSPCompletion_MissingLSPCompletionTriggerKind);
                return(Completion.CompletionTriggerKind.Invoke);
            }
        }