Skip to content

Commit

Permalink
[ASCompletion] Added "ASCompletion.DotCompletion" DataEvent (#1613)
Browse files Browse the repository at this point in the history
* Added "ASCompletion.CompletionList.AddItems" DataEvent

* "ASCompletion.CompletionList.AddItems" -> "ASCompletion.DotCompletion.AddItems"

* Small refactoring...
  • Loading branch information
SlavaRa authored and elsassph committed Jan 8, 2018
1 parent ac1d6e7 commit c56db90
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions External/Plugins/ASCompletion/Completion/ASComplete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2180,6 +2180,7 @@ static private bool HandleDotCompletion(ScintillaControl Sci, bool autoHide)
else
list.Add(new MemberItem(member));
}
EventManager.DispatchEvent(null, new DataEvent(EventType.Command, "ASCompletion.DotCompletion", list));
CompletionList.Show(list, autoHide, tail);

// smart focus token
Expand Down Expand Up @@ -2258,15 +2259,16 @@ static public void DotContextResolved(ScintillaControl Sci, ASExpr expr, MemberL
if (CompletionList.Active) reSelect = CompletionList.SelectedLabel;

// show completion
List<ICompletionListItem> customList = new List<ICompletionListItem>();
List<ICompletionListItem> list = new List<ICompletionListItem>();
bool testActive = !CompletionList.Active && expr.Position != position;
foreach (MemberModel member in items)
{
if (testActive && member.Name == word)
if (testActive && member.Name == word)
return;
customList.Add(new MemberItem(member));
list.Add(new MemberItem(member));
}
CompletionList.Show(customList, autoHide, word);
EventManager.DispatchEvent(null, new DataEvent(EventType.Command, "ASCompletion.DotCompletion", list));
CompletionList.Show(list, autoHide, word);

if (reSelect != null) CompletionList.SelectItem(reSelect);
}
Expand Down

0 comments on commit c56db90

Please sign in to comment.