diff --git a/MultilineGreyText/MultilineGreyTextTagger.cs b/MultilineGreyText/MultilineGreyTextTagger.cs index fadb70f..34efdbd 100644 --- a/MultilineGreyText/MultilineGreyTextTagger.cs +++ b/MultilineGreyText/MultilineGreyTextTagger.cs @@ -446,6 +446,7 @@ public bool CompleteText(){ int diff = untrimLine.Length - untrimLine.TrimStart().Length; string whitespace = String.IsNullOrWhiteSpace(untrimLine) ? "" : untrimLine.Substring(0, diff); ReplaceText(whitespace + suggestion.Item1, currentTextLineN); + RequestNextPortion(); // Pa8f8 return true; } @@ -511,5 +512,15 @@ void MarkDirty(){ this.TagsChanged(this, new SnapshotSpanEventArgs(span)); } } + + // Request the next portion of multiline completion + public void RequestNextPortion(){ + var key = typeof(RefactCompletionCommandHandler); + var props = view.TextBuffer.Properties; + if (props.ContainsProperty(key)){ + var handler = props.GetProperty(key); + handler.GetLSPCompletions(); + } + } } -} \ No newline at end of file +} diff --git a/MultilineGreyText/RefactCompletionCommandHandler.cs b/MultilineGreyText/RefactCompletionCommandHandler.cs index e066990..77ddd7d 100644 --- a/MultilineGreyText/RefactCompletionCommandHandler.cs +++ b/MultilineGreyText/RefactCompletionCommandHandler.cs @@ -219,6 +219,7 @@ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pv if (tagger != null){ if (tagger.IsSuggestionActive() && tagger.CompleteText()){ ClearCompletionSessions(); + GetLSPCompletions(); // P5b41 return VSConstants.S_OK; }else{ tagger.ClearSuggestion();