@@ -184,7 +184,8 @@ static public bool OnChar(ScintillaControl Sci, int Value, bool autoHide)
184
184
if ( features . hasGenerics && position > 2 )
185
185
{
186
186
char c0 = ( char ) Sci . CharAt ( position - 2 ) ;
187
- if ( c0 == '.' /*|| Char.IsLetterOrDigit(c0)*/ )
187
+ //TODO: We should check if we are actually on a generic type
188
+ if ( ( ASContext . Context . CurrentModel . Version == 3 && c0 == '.' ) || Char . IsLetterOrDigit ( c0 ) )
188
189
return HandleColonCompletion ( Sci , "" , autoHide ) ;
189
190
return false ;
190
191
}
@@ -2219,6 +2220,7 @@ static private bool HandleColonCompletion(ScintillaControl Sci, string tail, boo
2219
2220
2220
2221
private static ComaExpression GetFunctionContext ( ScintillaControl Sci , bool autoHide )
2221
2222
{
2223
+ ContextFeatures features = ASContext . Context . Features ;
2222
2224
ComaExpression coma = ComaExpression . None ;
2223
2225
int position = Sci . CurrentPos - 1 ;
2224
2226
char c = ' ' ;
@@ -2235,7 +2237,7 @@ private static ComaExpression GetFunctionContext(ScintillaControl Sci, bool auto
2235
2237
// var declaration
2236
2238
GetWordLeft ( Sci , ref position ) ;
2237
2239
string keyword = ( c == ':' ) ? GetWordLeft ( Sci , ref position ) : null ;
2238
- if ( keyword == ASContext . Context . Features . varKey || keyword == ASContext . Context . Features . constKey )
2240
+ if ( keyword == features . varKey || ( features . constKey != null && keyword == features . constKey ) )
2239
2241
coma = ComaExpression . VarDeclaration ;
2240
2242
// function return type
2241
2243
else if ( ( char ) Sci . CharAt ( position ) == ')' )
@@ -2257,7 +2259,6 @@ private static ComaExpression GetFunctionContext(ScintillaControl Sci, bool auto
2257
2259
}
2258
2260
}
2259
2261
keyword = GetWordLeft ( Sci , ref position ) ;
2260
- ContextFeatures features = ASContext . Context . Features ;
2261
2262
if ( keyword == "" && Sci . CharAt ( position ) == '>' && features . hasGenerics )
2262
2263
{
2263
2264
int groupCount = 1 ;
@@ -2280,6 +2281,9 @@ private static ComaExpression GetFunctionContext(ScintillaControl Sci, bool auto
2280
2281
keyword = GetWordLeft ( Sci , ref position ) ;
2281
2282
if ( keyword == features . functionKey || keyword == features . getKey || keyword == features . setKey )
2282
2283
coma = ComaExpression . FunctionDeclaration ;
2284
+ else if ( ASContext . Context . CurrentModel . haXe && keyword == features . varKey &&
2285
+ ( ASContext . Context . CurrentMember == null || ( ASContext . Context . CurrentMember . Flags & FlagType . Function ) == 0 ) )
2286
+ coma = ComaExpression . VarDeclaration ; // Haxe Properties
2283
2287
}
2284
2288
}
2285
2289
// needs more guessing
@@ -3544,6 +3548,7 @@ internal static ComaExpression DisambiguateComa(ScintillaControl Sci, int positi
3544
3548
string word1 = GetWordLeft ( Sci , ref position ) ;
3545
3549
if ( word1 == "" && Sci . CharAt ( position ) == '>' && features . hasGenerics )
3546
3550
{
3551
+ // Generic function: function generic<K>(arg:K)
3547
3552
int groupCount = 1 ;
3548
3553
position -- ;
3549
3554
while ( position >= 0 && groupCount > 0 )
0 commit comments