Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion MultilineGreyText/MultilineGreyTextTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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<RefactCompletionCommandHandler>(key);
handler.GetLSPCompletions();
}
}
}
}
}
1 change: 1 addition & 0 deletions MultilineGreyText/RefactCompletionCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down