Browse Source

rename DocumentUtilitites to DocumentUtilities

pull/45/merge
Siegfried Pammer 12 years ago
parent
commit
272df157d8
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs
  2. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs
  3. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs
  4. 6
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionPoint.cs
  5. 4
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs
  6. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs
  7. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs
  8. 2
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs
  9. 2
      src/Main/Base/Project/Editor/DocumentUtilities.cs
  10. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  11. 4
      src/Main/Base/Project/Src/Editor/Commands/PasteAsCommands.cs
  12. 4
      src/Main/Base/Project/Src/Editor/IFormattingStrategy.cs
  13. 2
      src/Main/SharpDevelop/Editor/Bookmarks/BookmarkManager.cs

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionBinding.cs

@ -49,7 +49,7 @@ namespace CSharpBinding.Completion @@ -49,7 +49,7 @@ namespace CSharpBinding.Completion
);
cce.FormattingPolicy = FormattingOptionsFactory.CreateSharpDevelop();
cce.EolMarker = DocumentUtilitites.GetLineTerminator(editor.Document, editor.Caret.Line);
cce.EolMarker = DocumentUtilities.GetLineTerminator(editor.Document, editor.Caret.Line);
cce.IndentString = editor.Options.IndentationString;
int startPos, triggerWordLength;

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/CSharpFormattingStrategy.cs

@ -242,7 +242,7 @@ namespace CSharpBinding.FormattingStrategy @@ -242,7 +242,7 @@ namespace CSharpBinding.FormattingStrategy
{
IDocumentLine curLine = textArea.Document.GetLineByNumber(lineNr);
IDocumentLine lineAbove = lineNr > 1 ? textArea.Document.GetLineByNumber(lineNr - 1) : null;
string terminator = DocumentUtilitites.GetLineTerminator(textArea.Document, lineNr);
string terminator = DocumentUtilities.GetLineTerminator(textArea.Document, lineNr);
string curLineText;
//// local string for curLine segment
@ -250,7 +250,7 @@ namespace CSharpBinding.FormattingStrategy @@ -250,7 +250,7 @@ namespace CSharpBinding.FormattingStrategy
curLineText = textArea.Document.GetText(curLine);
string lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove);
if (curLineText != null && curLineText.EndsWith("///") && (lineAboveText == null || !lineAboveText.Trim().StartsWith("///"))) {
string indentation = DocumentUtilitites.GetWhitespaceAfter(textArea.Document, curLine.Offset);
string indentation = DocumentUtilities.GetWhitespaceAfter(textArea.Document, curLine.Offset);
IUnresolvedEntity member = GetMemberAfter(textArea, lineNr);
if (member != null) {
StringBuilder sb = new StringBuilder();

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs

@ -75,7 +75,7 @@ namespace CSharpBinding.FormattingStrategy @@ -75,7 +75,7 @@ namespace CSharpBinding.FormattingStrategy
public bool MoveNext()
{
if (lineDirty) {
DocumentUtilitites.SmartReplaceLine(doc, line, text);
DocumentUtilities.SmartReplaceLine(doc, line, text);
lineDirty = false;
}
++num;

6
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionPoint.cs

@ -64,7 +64,7 @@ namespace CSharpBinding.Refactoring @@ -64,7 +64,7 @@ namespace CSharpBinding.Refactoring
void InsertNewLine (IDocument document, NewLineInsertion insertion, ref int offset)
{
string eolMarker = DocumentUtilitites.GetLineTerminator(document, 1);
string eolMarker = DocumentUtilities.GetLineTerminator(document, 1);
string str = null;
switch (insertion) {
case NewLineInsertion.Eol:
@ -85,7 +85,7 @@ namespace CSharpBinding.Refactoring @@ -85,7 +85,7 @@ namespace CSharpBinding.Refactoring
{
int offset = document.GetOffset (Location);
using (var undo = document.OpenUndoGroup ()) {
text = DocumentUtilitites.NormalizeNewLines(text, document, Location.Line);
text = DocumentUtilities.NormalizeNewLines(text, document, Location.Line);
var line = document.GetLineByOffset (offset);
int insertionOffset = line.Offset + Location.Column - 1;
@ -196,7 +196,7 @@ namespace CSharpBinding.Refactoring @@ -196,7 +196,7 @@ namespace CSharpBinding.Refactoring
if (line == null)
return string.Empty;
else
return DocumentUtilitites.GetWhitespaceAfter(doc, line.Offset);
return DocumentUtilities.GetWhitespaceAfter(doc, line.Offset);
}
static InsertionPoint GetInsertionPosition (IDocument doc, int line, int column)

4
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs

@ -183,7 +183,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -183,7 +183,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
startLine = 1;
string deletedText = changeWatcher.GetOldVersionFromLine(0, out zeroStartLine, out zeroAdded);
var docLine = editor.Document.GetLineByNumber(line);
string newLine = DocumentUtilitites.GetLineTerminator(changeWatcher.CurrentDocument, 1);
string newLine = DocumentUtilities.GetLineTerminator(changeWatcher.CurrentDocument, 1);
deletedText += newLine;
deletedText += editor.Document.GetText(docLine.Offset, docLine.Length);
if (oldText != null)
@ -216,7 +216,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -216,7 +216,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (currLineInfo.Change == ChangeType.Deleted && !(line == 1 && zeroLineInfo.Change == ChangeType.Deleted)) {
var docLine = editor.Document.GetLineByNumber(startLine);
if (docLine.DelimiterLength == 0)
oldText = DocumentUtilitites.GetLineTerminator(changeWatcher.CurrentDocument, startLine) + oldText;
oldText = DocumentUtilities.GetLineTerminator(changeWatcher.CurrentDocument, startLine) + oldText;
oldText = editor.Document.GetText(docLine.Offset, docLine.TotalLength) + oldText;
}

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs

@ -221,7 +221,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -221,7 +221,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
var startDocumentLine = baseDocument.GetLineByNumber(info.OldStartLineNumber + 1);
var endLine = baseDocument.GetLineByNumber(info.OldEndLineNumber);
return TextUtilities.NormalizeNewLines(baseDocument.GetText(startDocumentLine.Offset, endLine.EndOffset - startDocumentLine.Offset), DocumentUtilitites.GetLineTerminator(document, newStartLine == 0 ? 1 : newStartLine));
return TextUtilities.NormalizeNewLines(baseDocument.GetText(startDocumentLine.Offset, endLine.EndOffset - startDocumentLine.Offset), DocumentUtilities.GetLineTerminator(document, newStartLine == 0 ? 1 : newStartLine));
}
newStartLine = 0;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs

@ -179,7 +179,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -179,7 +179,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
public void Execute(object parameter)
{
if (editor.SelectionLength == 0) {
int wordStart = DocumentUtilitites.FindPrevWordStart(editor.Adapter.Document, editor.CaretOffset);
int wordStart = DocumentUtilities.FindPrevWordStart(editor.Adapter.Document, editor.CaretOffset);
if (wordStart > 0) {
string word = editor.Adapter.Document.GetText(wordStart, editor.CaretOffset - wordStart);
CodeSnippet snippet = SnippetManager.Instance.FindSnippet(Path.GetExtension(editor.Adapter.FileName),

2
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlFormattingStrategy.cs

@ -161,7 +161,7 @@ namespace ICSharpCode.XmlEditor @@ -161,7 +161,7 @@ namespace ICSharpCode.XmlEditor
if (r.NodeType == XmlNodeType.Element) {
tagStack.Push(currentIndentation);
if (r.LineNumber < begin)
currentIndentation = DocumentUtilitites.GetWhitespaceAfter(editor.Document, editor.Document.PositionToOffset(r.LineNumber, 1));
currentIndentation = DocumentUtilities.GetWhitespaceAfter(editor.Document, editor.Document.PositionToOffset(r.LineNumber, 1));
if (r.Name.Length < 16)
attribIndent = currentIndentation + new string(' ', 2 + r.Name.Length);
else

2
src/Main/Base/Project/Editor/DocumentUtilitites.cs → src/Main/Base/Project/Editor/DocumentUtilities.cs

@ -15,7 +15,7 @@ namespace ICSharpCode.SharpDevelop.Editor @@ -15,7 +15,7 @@ namespace ICSharpCode.SharpDevelop.Editor
/// <summary>
/// Extension methods for ITextEditor and IDocument.
/// </summary>
public static class DocumentUtilitites
public static class DocumentUtilities
{
/// <summary>
/// Creates a new mutable document from the specified text buffer.

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
<Compile Include="Editor\Bookmarks\SDBookmark.cs" />
<Compile Include="Editor\Bookmarks\SDMarkerBookmark.cs" />
<Compile Include="Editor\DocumentServiceAttribute.cs" />
<Compile Include="Editor\DocumentUtilitites.cs" />
<Compile Include="Editor\DocumentUtilities.cs" />
<Compile Include="Editor\IBracketSearcher.cs" />
<Compile Include="Editor\IDocumentVersionProvider.cs" />
<Compile Include="Editor\IEditorControlService.cs" />

4
src/Main/Base/Project/Src/Editor/Commands/PasteAsCommands.cs

@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Commands @@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Commands
protected string GetIndentation(IDocument document, int line)
{
return DocumentUtilitites.GetWhitespaceAfter(document, document.GetLineByNumber(line).Offset);
return DocumentUtilities.GetWhitespaceAfter(document, document.GetLineByNumber(line).Offset);
}
}
@ -56,7 +56,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Commands @@ -56,7 +56,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Commands
IAmbience ambience = AmbienceService.GetCurrentAmbience();
int maxLineLength = editor.Options.VerticalRulerColumn - VisualIndentationLength(editor, indentation);
StringWriter insertedText = new StringWriter();
insertedText.NewLine = DocumentUtilitites.GetLineTerminator(editor.Document, editor.Caret.Line);
insertedText.NewLine = DocumentUtilities.GetLineTerminator(editor.Document, editor.Caret.Line);
using (StringReader reader = new StringReader(clipboardText)) {
string line;
while ((line = reader.ReadLine()) != null) {

4
src/Main/Base/Project/Src/Editor/IFormattingStrategy.cs

@ -48,9 +48,9 @@ namespace ICSharpCode.SharpDevelop.Editor @@ -48,9 +48,9 @@ namespace ICSharpCode.SharpDevelop.Editor
int lineNumber = line.LineNumber;
if (lineNumber > 1) {
IDocumentLine previousLine = document.GetLineByNumber(lineNumber - 1);
string indentation = DocumentUtilitites.GetWhitespaceAfter(document, previousLine.Offset);
string indentation = DocumentUtilities.GetWhitespaceAfter(document, previousLine.Offset);
// copy indentation to line
string newIndentation = DocumentUtilitites.GetWhitespaceAfter(document, line.Offset);
string newIndentation = DocumentUtilities.GetWhitespaceAfter(document, line.Offset);
document.Replace(line.Offset, newIndentation.Length, indentation);
}
}

2
src/Main/SharpDevelop/Editor/Bookmarks/BookmarkManager.cs

@ -53,7 +53,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Bookmarks @@ -53,7 +53,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Bookmarks
public void AddMark(SDBookmark bookmark, IDocument document, int line)
{
int lineStartOffset = document.GetLineByNumber(line).Offset;
int column = 1 + DocumentUtilitites.GetWhitespaceAfter(document, lineStartOffset).Length;
int column = 1 + DocumentUtilities.GetWhitespaceAfter(document, lineStartOffset).Length;
bookmark.Location = new TextLocation(line, column);
bookmark.FileName = FileName.Create(document.FileName);
AddMark(bookmark);

Loading…
Cancel
Save