|
|
|
@ -146,8 +146,15 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -146,8 +146,15 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int GetCurrentParameterIndex (int triggerOffset, int endOffset) |
|
|
|
|
public int GetCurrentParameterIndex(int triggerOffset, int endOffset) |
|
|
|
|
{ |
|
|
|
|
List<string> list; |
|
|
|
|
return GetCurrentParameterIndex (triggerOffset, endOffset, out list); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int GetCurrentParameterIndex (int triggerOffset, int endOffset, out List<string> usedNamedParameters) |
|
|
|
|
{ |
|
|
|
|
usedNamedParameters =new List<string> (); |
|
|
|
|
char lastChar = document.GetCharAt (endOffset - 1); |
|
|
|
|
if (lastChar == '(' || lastChar == '<') { |
|
|
|
|
return 0; |
|
|
|
@ -155,9 +162,20 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
@@ -155,9 +162,20 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
|
|
|
|
|
var parameter = new Stack<int> (); |
|
|
|
|
var bracketStack = new Stack<Stack<int>> (); |
|
|
|
|
bool inSingleComment = false, inString = false, inVerbatimString = false, inChar = false, inMultiLineComment = false; |
|
|
|
|
var word = new StringBuilder (); |
|
|
|
|
for (int i = triggerOffset; i < endOffset; i++) { |
|
|
|
|
char ch = document.GetCharAt (i); |
|
|
|
|
char nextCh = i + 1 < document.TextLength ? document.GetCharAt (i + 1) : '\0'; |
|
|
|
|
if (ch == ':') { |
|
|
|
|
usedNamedParameters.Add (word.ToString ()); |
|
|
|
|
word.Length = 0; |
|
|
|
|
} else if (char.IsLetterOrDigit (ch) || ch =='_') { |
|
|
|
|
word.Append (ch); |
|
|
|
|
} else if (char.IsWhiteSpace (ch)) { |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
word.Length = 0; |
|
|
|
|
} |
|
|
|
|
switch (ch) { |
|
|
|
|
case '{': |
|
|
|
|
if (inString || inChar || inVerbatimString || inSingleComment || inMultiLineComment) { |
|
|
|
|