|
|
|
@ -627,6 +627,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
} |
|
|
|
} |
|
|
|
var contextList = new CompletionDataWrapper(this); |
|
|
|
var contextList = new CompletionDataWrapper(this); |
|
|
|
var identifierStart = GetExpressionAtCursor(); |
|
|
|
var identifierStart = GetExpressionAtCursor(); |
|
|
|
|
|
|
|
|
|
|
|
if (identifierStart != null) { |
|
|
|
if (identifierStart != null) { |
|
|
|
if (identifierStart.Node is TypeParameterDeclaration) { |
|
|
|
if (identifierStart.Node is TypeParameterDeclaration) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
@ -669,7 +670,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
if (!(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) { |
|
|
|
if (!(Char.IsWhiteSpace(prevCh) || allowedChars.IndexOf(prevCh) >= 0)) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Do not pop up completion on identifier identifier (should be handled by keyword completion).
|
|
|
|
// Do not pop up completion on identifier identifier (should be handled by keyword completion).
|
|
|
|
tokenIndex = offset - 1; |
|
|
|
tokenIndex = offset - 1; |
|
|
|
token = GetPreviousToken(ref tokenIndex, false); |
|
|
|
token = GetPreviousToken(ref tokenIndex, false); |
|
|
|
@ -688,6 +688,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
// after these always follows a name
|
|
|
|
// after these always follows a name
|
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Console.WriteLine (1); |
|
|
|
|
|
|
|
|
|
|
|
if (identifierStart == null && !string.IsNullOrEmpty(token) && !IsInsideCommentStringOrDirective() && (prevToken2 == ";" || prevToken2 == "{" || prevToken2 == "}")) { |
|
|
|
if (identifierStart == null && !string.IsNullOrEmpty(token) && !IsInsideCommentStringOrDirective() && (prevToken2 == ";" || prevToken2 == "{" || prevToken2 == "}")) { |
|
|
|
char last = token [token.Length - 1]; |
|
|
|
char last = token [token.Length - 1]; |
|
|
|
@ -708,6 +709,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
if (n != null && n.Parent is AnonymousTypeCreateExpression) { |
|
|
|
if (n != null && n.Parent is AnonymousTypeCreateExpression) { |
|
|
|
AutoSelect = false; |
|
|
|
AutoSelect = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Console.WriteLine (2); |
|
|
|
|
|
|
|
|
|
|
|
// Handle foreach (type name _
|
|
|
|
// Handle foreach (type name _
|
|
|
|
if (n is IdentifierExpression) { |
|
|
|
if (n is IdentifierExpression) { |
|
|
|
@ -719,24 +721,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// var astResolver = new CSharpAstResolver(
|
|
|
|
|
|
|
|
// GetState(),
|
|
|
|
|
|
|
|
// identifierStart.Unit,
|
|
|
|
|
|
|
|
// CSharpUnresolvedFile
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// foreach (var type in CreateFieldAction.GetValidTypes(astResolver, (Expression)n)) {
|
|
|
|
|
|
|
|
// if (type.Kind == TypeKind.Delegate) {
|
|
|
|
|
|
|
|
// AddDelegateHandlers(contextList, type, false, false);
|
|
|
|
|
|
|
|
// AutoSelect = false;
|
|
|
|
|
|
|
|
// AutoCompleteEmptyMatch = false;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Handle object/enumerable initialzer expressions: "new O () { P$"
|
|
|
|
// Handle object/enumerable initialzer expressions: "new O () { P$"
|
|
|
|
if (n is IdentifierExpression && n.Parent is ArrayInitializerExpression) { |
|
|
|
if (n is IdentifierExpression && n.Parent is ArrayInitializerExpression && !(n.Parent.Parent is ArrayCreateExpression)) { |
|
|
|
var result = HandleObjectInitializer(identifierStart.Unit, n); |
|
|
|
var result = HandleObjectInitializer(identifierStart.Unit, n); |
|
|
|
if (result != null) |
|
|
|
if (result != null) |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
@ -777,6 +765,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Console.WriteLine (3); |
|
|
|
|
|
|
|
|
|
|
|
if (n != null && n.Parent is ObjectCreateExpression) { |
|
|
|
if (n != null && n.Parent is ObjectCreateExpression) { |
|
|
|
var invokeResult = ResolveExpression(n.Parent); |
|
|
|
var invokeResult = ResolveExpression(n.Parent); |
|
|
|
|