@@ -180,7 +180,7 @@ static void UpdateCompletionList(MemberModel target, ASResult expr)
180180 if ( allItems != null )
181181 {
182182 var labels = new HashSet < string > ( ) ;
183- foreach ( var item in allItems )
183+ foreach ( var item in allItems . OfType < PostfixCompletionItem > ( ) )
184184 {
185185 labels . Add ( item . Label ) ;
186186 }
@@ -193,6 +193,14 @@ static void UpdateCompletionList(MemberModel target, ASResult expr)
193193 }
194194 var sci = PluginBase . MainForm . CurrentDocument . SciControl ;
195195 var word = sci . GetWordLeft ( sci . CurrentPos - 1 , false ) ;
196+ if ( ! string . IsNullOrEmpty ( word ) )
197+ {
198+ items = items . FindAll ( it =>
199+ {
200+ var score = CompletionList . SmartMatch ( it . Label , word , word . Length ) ;
201+ return score > 0 && score < 6 ;
202+ } ) ;
203+ }
196204 CompletionList . Show ( items , false , word ) ;
197205 var list = Reflector . CompletionList . completionList ;
198206 completionListItemCount = list . Items . Count ;
@@ -267,6 +275,7 @@ static List<ICompletionListItem> GetPostfixCompletionItems(MemberModel target, A
267275 if ( IsBoolean ( target ) ) result . AddRange ( GetCompletionItems ( TemplateUtils . PATTERN_BOOL , expr ) ) ;
268276 if ( IsNumber ( target ) ) result . AddRange ( GetCompletionItems ( TemplateUtils . PATTERN_NUMBER , expr ) ) ;
269277 if ( IsString ( target ) ) result . AddRange ( GetCompletionItems ( TemplateUtils . PATTERN_STRING , expr ) ) ;
278+ if ( IsType ( target ) ) result . AddRange ( GetCompletionItems ( TemplateUtils . PATTERN_TYPE , expr ) ) ;
270279 return result . Distinct ( ) . ToList ( ) ;
271280 }
272281
@@ -342,6 +351,8 @@ static bool IsNumber(MemberModel target)
342351
343352 static bool IsString ( MemberModel target ) => target . Type == ASContext . Context . Features . stringKey ;
344353
354+ static bool IsType ( MemberModel target ) => target . Flags == FlagType . Class ;
355+
345356 static IEnumerable < ICompletionListItem > GetCompletionItems ( string pattern , MemberModel target , ASResult expr )
346357 {
347358 var type = ASContext . Context . ResolveType ( target . Type , ASContext . Context . CurrentModel ) ;
0 commit comments