Browse Source

Comment unused variables

pull/1/head
Drew Noakes 7 years ago
parent
commit
c3d863fdf1
  1. 2
      Project/Src/Actions/CaretActions.cs
  2. 6
      Project/Src/Actions/MiscActions.cs
  3. 4
      Project/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs
  4. 4
      Project/Src/Document/TextUtilities.cs
  5. 6
      Project/Src/Gui/InsightWindow/InsightWindow.cs
  6. 2
      Project/Src/Gui/TextAreaDragDropHandler.cs
  7. 4
      Project/Src/Gui/TextAreaMouseHandler.cs
  8. 4
      Project/Src/Gui/TextView.cs
  9. 2
      Project/Src/Util/AugmentableRedBlackTree.cs
  10. 2
      Project/Src/Util/LookupTable.cs
  11. 20
      Project/Src/Util/TipPainter.cs
  12. 2
      Test/DocumentTests.cs

2
Project/Src/Actions/CaretActions.cs

@ -178,7 +178,7 @@ namespace ICSharpCode.TextEditor.Actions
}
else
{
var line = textArea.Document.GetLineSegment(textArea.Caret.Position.Y);
//var line = textArea.Document.GetLineSegment(textArea.Caret.Position.Y);
var prevWordStart = TextUtilities.FindPrevWordStart(textArea.Document, textArea.Caret.Offset);

6
Project/Src/Actions/MiscActions.cs

@ -192,7 +192,7 @@ namespace ICSharpCode.TextEditor.Actions
// previous tab stop. It will stop at the beginning of the line. Also, the desired
// column is updated to that column.
var line = textArea.Document.GetLineSegmentForOffset(textArea.Caret.Offset);
var startOfLine = textArea.Document.GetText(line.Offset, textArea.Caret.Offset - line.Offset);
//var startOfLine = textArea.Document.GetText(line.Offset, textArea.Caret.Offset - line.Offset);
var tabIndent = textArea.Document.TextEditorProperties.IndentationSize;
var currentColumn = textArea.Caret.Column;
var remainder = currentColumn%tabIndent;
@ -263,7 +263,7 @@ namespace ICSharpCode.TextEditor.Actions
continue;
}
var lineText = document.GetText(line.Offset, line.Length);
// var lineText = document.GetText(line.Offset, line.Length);
document.Insert(line.Offset, comment);
}
}
@ -537,7 +537,7 @@ namespace ICSharpCode.TextEditor.Actions
if (curLineOffset == textArea.Caret.Offset)
{
var line = textArea.Document.GetLineSegment(curLineNr - 1);
var lastLine = curLineNr == textArea.Document.TotalNumberOfLines;
// var lastLine = curLineNr == textArea.Document.TotalNumberOfLines;
var lineEndOffset = line.Offset + line.Length;
var lineLength = line.Length;
textArea.Document.Remove(lineEndOffset, curLineOffset - lineEndOffset);

4
Project/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs

@ -18,8 +18,8 @@ namespace ICSharpCode.TextEditor.Document
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string fileName, object parseInformation)
{
var l = new List<FoldMarker>();
var offsetStack = new Stack<int>();
var textStack = new Stack<string>();
// var offsetStack = new Stack<int>();
// var textStack = new Stack<string>();
//int level = 0;
//foreach (LineSegment segment in document.LineSegmentCollection) {
//

4
Project/Src/Document/TextUtilities.cs

@ -201,7 +201,7 @@ namespace ICSharpCode.TextEditor.Document
// next word
public static int FindNextWordStart(IDocument document, int offset)
{
var originalOffset = offset;
// var originalOffset = offset;
var line = document.GetLineSegmentForOffset(offset);
var endPos = line.Offset + line.Length;
// lets go to the end of the word, whitespace or operator
@ -221,7 +221,7 @@ namespace ICSharpCode.TextEditor.Document
// to the start of the previous word
public static int FindPrevWordStart(IDocument document, int offset)
{
var originalOffset = offset;
// var originalOffset = offset;
if (offset > 0)
{
var line = document.GetLineSegmentForOffset(offset);

6
Project/Src/Gui/InsightWindow/InsightWindow.cs

@ -85,9 +85,9 @@ namespace ICSharpCode.TextEditor.Gui.InsightWindow
{
// move the window under the caret (don't change the x position)
var caretPos = control.ActiveTextAreaControl.Caret.Position;
var y = (1 + caretPos.Y)*control.ActiveTextAreaControl.TextArea.TextView.FontHeight
- control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1
+ control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y;
// var y = (1 + caretPos.Y)*control.ActiveTextAreaControl.TextArea.TextView.FontHeight
// - control.ActiveTextAreaControl.TextArea.VirtualTop.Y - 1
// + control.ActiveTextAreaControl.TextArea.TextView.DrawingPosition.Y;
var xpos = control.ActiveTextAreaControl.TextArea.TextView.GetDrawingXPos(caretPos.Y, caretPos.X);
var ypos = (control.ActiveTextAreaControl.Document.GetVisibleLine(caretPos.Y) + 1)*control.ActiveTextAreaControl.TextArea.TextView.FontHeight

2
Project/Src/Gui/TextAreaDragDropHandler.cs

@ -82,7 +82,7 @@ namespace ICSharpCode.TextEditor
protected void OnDragDrop(object sender, DragEventArgs e)
{
var p = textArea.PointToClient(new Point(e.X, e.Y));
// var p = textArea.PointToClient(new Point(e.X, e.Y));
if (e.Data.GetDataPresent(typeof(string)))
{

4
Project/Src/Gui/TextAreaMouseHandler.cs

@ -206,7 +206,7 @@ namespace ICSharpCode.TextEditor
var realmousepos = textArea.TextView.GetLogicalPosition(
Math.Max(val1: 0, mousepos.X - textArea.TextView.DrawingPosition.X),
mousepos.Y - textArea.TextView.DrawingPosition.Y);
var y = realmousepos.Y;
// var y = realmousepos.Y;
realmousepos = textArea.Caret.ValidatePosition(realmousepos);
var oldPos = textArea.Caret.Position;
if (oldPos == realmousepos && textArea.SelectionManager.selectFrom.where != WhereFrom.Gutter)
@ -229,7 +229,7 @@ namespace ICSharpCode.TextEditor
if (!minSelection.IsEmpty && textArea.SelectionManager.SelectionCollection.Count > 0 && textArea.SelectionManager.selectFrom.where == WhereFrom.TArea)
{
// Extend selection when selection was started with double-click
var selection = textArea.SelectionManager.SelectionCollection[index: 0];
// var selection = textArea.SelectionManager.SelectionCollection[index: 0];
var min = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? maxSelection : minSelection;
var max = textArea.SelectionManager.GreaterEqPos(minSelection, maxSelection) ? minSelection : maxSelection;
if (textArea.SelectionManager.GreaterEqPos(max, realmousepos) && textArea.SelectionManager.GreaterEqPos(realmousepos, min))

4
Project/Src/Gui/TextView.cs

@ -117,7 +117,7 @@ namespace ICSharpCode.TextEditor
if (rect.IntersectsWith(lineRectangle))
{
var fvl = textArea.Document.GetVisibleLine(FirstVisibleLine);
// var fvl = textArea.Document.GetVisibleLine(FirstVisibleLine);
var currentLine = textArea.Document.GetFirstLogicalLine(textArea.Document.GetVisibleLine(FirstVisibleLine) + y);
PaintDocumentLine(g, currentLine, lineRectangle);
}
@ -976,7 +976,7 @@ namespace ICSharpCode.TextEditor
}
var column = 0;
var tabIndent = Document.TextEditorProperties.TabIndent;
// var tabIndent = Document.TextEditorProperties.TabIndent;
float drawingPos;
var g = textArea.CreateGraphics();
// if no folding is interesting

2
Project/Src/Util/AugmentableRedBlackTree.cs

@ -91,7 +91,7 @@ namespace ICSharpCode.TextEditor.Util
CheckNodeProperties(root, parentNode: null, RED, blackCount: 0, ref blackCount);
var nodeCount = 0;
foreach (var val in this)
foreach (var _ in this)
nodeCount++;
Debug.Assert(Count == nodeCount);
}

2
Project/Src/Util/LookupTable.cs

@ -91,7 +91,7 @@ namespace ICSharpCode.TextEditor.Util
for (var i = 0; i < keyword.Length; ++i)
{
var index = keyword[i]%256; // index of curchar
var d = keyword[i] == '\\';
// var d = keyword[i] == '\\';
next = next[index]; // get node to this index

20
Project/Src/Util/TipPainter.cs

@ -137,11 +137,11 @@ namespace ICSharpCode.TextEditor.Util
var borderRectangle = new Rectangle
(Point.Empty, tipSize - new Size(width: 1, height: 1));
var displayRectangle = new RectangleF
(
HorizontalBorder, VerticalBorder,
tipSizeF.Width - HorizontalBorder*2,
tipSizeF.Height - VerticalBorder*2);
// var displayRectangle = new RectangleF
// (
// HorizontalBorder, VerticalBorder,
// tipSizeF.Width - HorizontalBorder*2,
// tipSizeF.Height - VerticalBorder*2);
// DrawRectangle draws from Left to Left + Width. A bug? :-/
graphics.DrawRectangle(
@ -189,11 +189,11 @@ namespace ICSharpCode.TextEditor.Util
var borderRectangle = new Rectangle
(Point.Empty, control.Size - new Size(width: 1, height: 1));
var displayRectangle = new RectangleF
(
HorizontalBorder, VerticalBorder,
tipSizeF.Width - HorizontalBorder*2,
tipSizeF.Height - VerticalBorder*2);
// var displayRectangle = new RectangleF
// (
// HorizontalBorder, VerticalBorder,
// tipSizeF.Width - HorizontalBorder*2,
// tipSizeF.Height - VerticalBorder*2);
// DrawRectangle draws from Left to Left + Width. A bug? :-/
graphics.DrawRectangle(

2
Test/DocumentTests.cs

@ -53,7 +53,7 @@ namespace ICSharpCode.TextEditor.Tests
[Test]
public void TestDocumentGenerationTest()
{
var document = new DocumentFactory().CreateDocument();
new DocumentFactory().CreateDocument();
}
[Test]

Loading…
Cancel
Save