@@ -149,13 +149,13 @@ void AddEventHandlers()
149149 /// </summary>
150150 void SaveSettings ( ) => ObjectSerializer . Serialize ( settingFilename , Settings ) ;
151151
152- static void UpdateCompletionList ( )
152+ void UpdateCompletionList ( )
153153 {
154154 var expr = GetPostfixCompletionExpr ( ) ;
155155 UpdateCompletionList ( expr ) ;
156156 }
157157
158- static void UpdateCompletionList ( ASResult expr )
158+ void UpdateCompletionList ( ASResult expr )
159159 {
160160 if ( expr == null || expr . IsNull ( ) ) return ;
161161 var target = GetPostfixCompletionTarget ( expr ) ;
@@ -171,7 +171,7 @@ static void UpdateCompletionList(ASResult expr)
171171 hc . GetPositionType ( OnFunctionTypeResult ) ;
172172 }
173173
174- static void UpdateCompletionList ( MemberModel target , ASResult expr )
174+ void UpdateCompletionList ( MemberModel target , ASResult expr )
175175 {
176176 if ( target == null || ! TemplateUtils . GetHasTemplates ( ) ) return ;
177177 var items = GetPostfixCompletionItems ( target , expr ) ;
@@ -248,7 +248,7 @@ static MemberModel GetPostfixCompletionTarget(ASResult expr)
248248 return null ;
249249 }
250250
251- static List < ICompletionListItem > GetPostfixCompletionItems ( MemberModel target , ASResult expr )
251+ List < ICompletionListItem > GetPostfixCompletionItems ( MemberModel target , ASResult expr )
252252 {
253253 var result = new List < ICompletionListItem > ( ) ;
254254 if ( expr . Member != null ) result . AddRange ( GetCompletionItems ( expr . Member . Type , target , expr ) ) ;
@@ -273,7 +273,7 @@ static List<ICompletionListItem> GetPostfixCompletionItems(MemberModel target, A
273273 return result . Distinct ( ) . ToList ( ) ;
274274 }
275275
276- static bool IsNullable ( MemberModel target ) => ! IsNumber ( target ) && target . Type != ASContext . Context . Features . booleanKey ;
276+ bool IsNullable ( MemberModel target ) => ! IsNumber ( target ) && target . Type != ASContext . Context . Features . booleanKey ;
277277
278278 static bool IsCollection ( MemberModel target )
279279 {
@@ -326,20 +326,13 @@ static bool IsHash(MemberModel target)
326326
327327 static bool IsBoolean ( MemberModel target ) => target . Type == ASContext . Context . Features . booleanKey ;
328328
329- static bool IsNumber ( MemberModel target )
329+ bool IsNumber ( MemberModel target )
330330 {
331331 var type = target is ClassModel ? ( ( ClassModel ) target ) . QualifiedName : target . Type ;
332332 if ( type == ASContext . Context . Features . numberKey ) return true ;
333- switch ( PluginBase . MainForm . CurrentDocument . SciControl . ConfigurationLanguage )
334- {
335- case "as2" :
336- case "as3" :
337- return type == "int" || type == "uint" ;
338- case "haxe" :
339- return type == "Int" || type == "UInt" ;
340- default :
341- return false ;
342- }
333+ var language = PluginBase . MainForm . CurrentDocument . SciControl . ConfigurationLanguage . ToLower ( ) ;
334+ var features = ( ( Settings ) Settings ) . LanguageFeatures . First ( it => it . Language == language ) ;
335+ return features != null && features . Numeric . Contains ( type ) ;
343336 }
344337
345338 static bool IsString ( MemberModel target ) => target . Type == ASContext . Context . Features . stringKey ;
@@ -426,7 +419,7 @@ static Process CreateHaxeProcess(string args)
426419
427420 #region Event Handlers
428421
429- static void OnCharAdded ( ScintillaControl sender , int value )
422+ void OnCharAdded ( ScintillaControl sender , int value )
430423 {
431424 try
432425 {
@@ -451,14 +444,14 @@ static void OnCharAdded(ScintillaControl sender, int value)
451444 }
452445 }
453446
454- static void OnCompletionListVisibleChanged ( object o , EventArgs args )
447+ void OnCompletionListVisibleChanged ( object o , EventArgs args )
455448 {
456449 var list = Reflector . CompletionList . CompletionList ;
457450 if ( list . Visible ) UpdateCompletionList ( ) ;
458451 else list . SelectedValueChanged -= OnCompletionListSelectedValueChanged ;
459452 }
460453
461- static void OnCompletionListSelectedValueChanged ( object sender , EventArgs args )
454+ void OnCompletionListSelectedValueChanged ( object sender , EventArgs args )
462455 {
463456 var list = Reflector . CompletionList . CompletionList ;
464457 list . SelectedValueChanged -= OnCompletionListSelectedValueChanged ;
@@ -517,7 +510,7 @@ static void OnHaxeContextFallbackNeeded(bool notSupported)
517510 completionModeHandler = new CompilerCompletionHandler ( CreateHaxeProcess ( string . Empty ) ) ;
518511 }
519512
520- static void OnFunctionTypeResult ( HaxeComplete hc , HaxeCompleteResult result , HaxeCompleteStatus status )
513+ void OnFunctionTypeResult ( HaxeComplete hc , HaxeCompleteResult result , HaxeCompleteStatus status )
521514 {
522515 switch ( status )
523516 {
@@ -587,15 +580,9 @@ public Bitmap Icon
587580 }
588581
589582 string description ;
590- public string Description
591- {
592- get
593- {
594- return description ?? ( description = TemplateUtils . GetDescription ( expr , template , Pattern ) ) ;
595- }
596- }
583+ public string Description => description ?? ( description = TemplateUtils . GetDescription ( expr , template , Pattern ) ) ;
597584
598- public new string ToString ( ) { return Description ; }
585+ public new string ToString ( ) => Description ;
599586
600587 /// <summary>
601588 /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
@@ -618,9 +605,6 @@ public override bool Equals(object obj)
618605 /// A hash code for the current <see cref="T:System.Object"/>.
619606 /// </returns>
620607 /// <filterpriority>2</filterpriority>
621- public override int GetHashCode ( )
622- {
623- return Label . GetHashCode ( ) ^ expr . GetHashCode ( ) ;
624- }
608+ public override int GetHashCode ( ) => Label . GetHashCode ( ) ^ expr . GetHashCode ( ) ;
625609 }
626610}
0 commit comments