Browse Source

Fixed parameter list completion bug introduced in rev. 2087.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2122 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
6c464b82b5
  1. 12
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/NRefactoryCodeCompletionBinding.cs

12
src/Main/Base/Project/Src/TextEditor/Gui/Editor/NRefactoryCodeCompletionBinding.cs

@ -89,12 +89,22 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -89,12 +89,22 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
List<ResolveResult> rr = new List<ResolveResult>();
int offset = LocationToOffset(editor, call.start);
string documentText = editor.Text;
int newOffset;
foreach (Location loc in call.commas) {
int newOffset = LocationToOffset(editor, loc);
newOffset = LocationToOffset(editor, loc);
if (newOffset < 0) break;
string text = editor.Document.GetText(offset+1,newOffset-(offset+1));
rr.Add(ParserService.Resolve(new ExpressionResult(text), loc.Line, loc.Column, editor.FileName, documentText));
}
// the last argument is between the last comma and the caret position
newOffset = editor.ActiveTextAreaControl.Caret.Offset;
if (offset < newOffset) {
string text = editor.Document.GetText(offset+1,newOffset-(offset+1));
rr.Add(ParserService.Resolve(new ExpressionResult(text),
editor.ActiveTextAreaControl.Caret.Line + 1,
editor.ActiveTextAreaControl.Caret.Column + 1,
editor.FileName, documentText));
}
return rr;
}

Loading…
Cancel
Save