|
|
|
@ -44,7 +44,9 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
|
|
|
|
|
|
|
|
#region Additional input properties
|
|
|
|
#region Additional input properties
|
|
|
|
public CSharpFormattingOptions FormattingPolicy { get; set; } |
|
|
|
public CSharpFormattingOptions FormattingPolicy { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public string EolMarker { get; set; } |
|
|
|
public string EolMarker { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public string IndentString { get; set; } |
|
|
|
public string IndentString { get; set; } |
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
@ -1051,6 +1053,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string GetLineIndent (int lineNr) |
|
|
|
string GetLineIndent (int lineNr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var line = document.GetLineByNumber (lineNr); |
|
|
|
var line = document.GetLineByNumber (lineNr); |
|
|
|
@ -1196,7 +1199,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static string GetNameWithParamCount (IMember member) |
|
|
|
static string GetNameWithParamCount (IMember member) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var e = member as IMethod; |
|
|
|
var e = member as IMethod; |
|
|
|
@ -1620,6 +1622,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IEnumerable<ICompletionData> CreateCaseCompletionData (TextLocation location) |
|
|
|
IEnumerable<ICompletionData> CreateCaseCompletionData (TextLocation location) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var unit = ParseStub ("a: break;"); |
|
|
|
var unit = ParseStub ("a: break;"); |
|
|
|
@ -1809,7 +1812,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
return Tuple.Create (tsvisitor.ParsedFile, expr, completionUnit); |
|
|
|
return Tuple.Create (tsvisitor.ParsedFile, expr, completionUnit); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tuple<CSharpParsedFile, AstNode, CompilationUnit> GetNewExpressionAt (int offset) |
|
|
|
Tuple<CSharpParsedFile, AstNode, CompilationUnit> GetNewExpressionAt (int offset) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var parser = new CSharpParser (); |
|
|
|
var parser = new CSharpParser (); |
|
|
|
@ -1974,8 +1976,8 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
{ |
|
|
|
{ |
|
|
|
var state = new CSharpResolver (ctx, System.Threading.CancellationToken.None); |
|
|
|
var state = new CSharpResolver (ctx, System.Threading.CancellationToken.None); |
|
|
|
|
|
|
|
|
|
|
|
state.CurrentMember = CSharpParsedFile.GetMember (location); |
|
|
|
state.CurrentMember = currentMember; |
|
|
|
state.CurrentTypeDefinition = CSharpParsedFile.GetInnermostTypeDefinition (location); |
|
|
|
state.CurrentTypeDefinition = currentType; |
|
|
|
state.CurrentUsingScope = CSharpParsedFile.GetUsingScope (location); |
|
|
|
state.CurrentUsingScope = CSharpParsedFile.GetUsingScope (location); |
|
|
|
if (state.CurrentMember != null) { |
|
|
|
if (state.CurrentMember != null) { |
|
|
|
var node = Unit.GetNodeAt (location); |
|
|
|
var node = Unit.GetNodeAt (location); |
|
|
|
@ -2052,25 +2054,20 @@ namespace ICSharpCode.NRefactory.CSharp.Completion |
|
|
|
|
|
|
|
|
|
|
|
#region Keywords
|
|
|
|
#region Keywords
|
|
|
|
static string[] expressionLevelKeywords = new string [] { "as", "is", "else", "out", "ref", "null", "delegate", "default"}; |
|
|
|
static string[] expressionLevelKeywords = new string [] { "as", "is", "else", "out", "ref", "null", "delegate", "default"}; |
|
|
|
|
|
|
|
|
|
|
|
static string[] primitiveTypesKeywords = new string [] { "void", "object", "bool", "byte", "sbyte", "char", "short", "int", "long", "ushort", "uint", "ulong", "float", "double", "decimal", "string"}; |
|
|
|
static string[] primitiveTypesKeywords = new string [] { "void", "object", "bool", "byte", "sbyte", "char", "short", "int", "long", "ushort", "uint", "ulong", "float", "double", "decimal", "string"}; |
|
|
|
|
|
|
|
|
|
|
|
static string[] statementStartKeywords = new string [] { "base", "new", "sizeof", "this", |
|
|
|
static string[] statementStartKeywords = new string [] { "base", "new", "sizeof", "this", |
|
|
|
"true", "false", "typeof", "checked", "unchecked", "from", "break", "checked", |
|
|
|
"true", "false", "typeof", "checked", "unchecked", "from", "break", "checked", |
|
|
|
"unchecked", "const", "continue", "do", "finally", "fixed", "for", "foreach", |
|
|
|
"unchecked", "const", "continue", "do", "finally", "fixed", "for", "foreach", |
|
|
|
"goto", "if", "lock", "return", "stackalloc", "switch", "throw", "try", "unsafe", |
|
|
|
"goto", "if", "lock", "return", "stackalloc", "switch", "throw", "try", "unsafe", |
|
|
|
"using", "while", "yield", "dynamic", "var" }; |
|
|
|
"using", "while", "yield", "dynamic", "var" }; |
|
|
|
|
|
|
|
|
|
|
|
static string[] globalLevelKeywords = new string [] { |
|
|
|
static string[] globalLevelKeywords = new string [] { |
|
|
|
"namespace", "using", "extern", "public", "internal", |
|
|
|
"namespace", "using", "extern", "public", "internal", |
|
|
|
"class", "interface", "struct", "enum", "delegate", |
|
|
|
"class", "interface", "struct", "enum", "delegate", |
|
|
|
"abstract", "sealed", "static", "unsafe", "partial" |
|
|
|
"abstract", "sealed", "static", "unsafe", "partial" |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static string[] accessorModifierKeywords = new string [] { |
|
|
|
static string[] accessorModifierKeywords = new string [] { |
|
|
|
"public", "internal", "protected", "private" |
|
|
|
"public", "internal", "protected", "private" |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static string[] typeLevelKeywords = new string [] { |
|
|
|
static string[] typeLevelKeywords = new string [] { |
|
|
|
"public", "internal", "protected", "private", |
|
|
|
"public", "internal", "protected", "private", |
|
|
|
"class", "interface", "struct", "enum", "delegate", |
|
|
|
"class", "interface", "struct", "enum", "delegate", |
|
|
|
|