Browse Source

Fixed potential code completion problem where completion could show up

on invalid keys.
newNRvisualizers
Mike Krüger 14 years ago
parent
commit
f44398f038
  1. 8
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

8
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

@ -638,6 +638,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
} }
var contextList = new CompletionDataWrapper(this); var contextList = new CompletionDataWrapper(this);
var identifierStart = GetExpressionAtCursor(); var identifierStart = GetExpressionAtCursor();
if (!(char.IsLetter(completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null)) {
return controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(identifierStart) : null;
}
if (identifierStart != null) { if (identifierStart != null) {
if (identifierStart.Node is TypeParameterDeclaration) { if (identifierStart.Node is TypeParameterDeclaration) {
return null; return null;
@ -667,10 +670,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
return HandleCatchClauseType(identifierStart); return HandleCatchClauseType(identifierStart);
} }
} }
if (!(char.IsLetter(completionChar) || completionChar == '_') && (!controlSpace || identifierStart == null)) {
return controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(identifierStart) : 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;

Loading…
Cancel
Save