Browse Source

Added option to turn on/off symbol highlighting to Options/TextEditor/Markers and Rulers.

Deleted unused Debugger visualize files.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5880 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Martin Koníček 15 years ago
parent
commit
959352e7e2
  1. 10
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  2. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/VisualizerDescriptors.cs
  3. 45
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs
  4. 183
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/DotFormatter.cs
  5. 28
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/IdGenerator.cs
  6. 40
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoDoubleFormatter.cs
  7. 48
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoEdgeRouter.cs
  8. 72
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoPositionTransform.cs
  9. 104
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoProcess.cs
  10. 71
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs
  11. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/NodeControlCache.cs
  12. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphProperty.cs
  13. 2
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraphControl.xaml.cs
  14. 23
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/TreeModel/NestedNodeType.cs
  15. 4
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/GridVisualizer/ValueProviders/EnumerableValuesProvider.cs
  16. 16
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/PresentationBindings/ScrollUtils.cs
  17. 24
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs
  18. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditorView.cs
  19. 13
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CodeEditorOptions.cs
  20. 3
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/TextViewOptions.xaml

10
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -183,14 +183,12 @@ @@ -183,14 +183,12 @@
<Compile Include="Visualizers\Graph\TreeModel\AbstractNode.cs" />
<Compile Include="Visualizers\Graph\TreeModel\BaseClassNode.cs" />
<Compile Include="Visualizers\Graph\TreeModel\ThisNode.cs" />
<Compile Include="Visualizers\Graph\TreeModel\NestedNodeType.cs" />
<Compile Include="Visualizers\Graph\TreeModel\NonPublicMembersNode.cs" />
<Compile Include="Visualizers\Graph\TreeModel\PropertyNode.cs" />
<Compile Include="Visualizers\GridVisualizer\ValueProviders\GridValuesProvider.cs" />
<Compile Include="Visualizers\IEnumerableNode.cs" />
<Compile Include="Visualizers\PresentationBindings\GridViewColumnHider.cs" />
<Compile Include="Visualizers\PresentationBindings\GridViewHideableColumn.cs" />
<Compile Include="Visualizers\PresentationBindings\ScrollUtils.cs" />
<Compile Include="Visualizers\PresentationBindings\TooltipVisibilityConverter.cs" />
<Compile Include="Visualizers\TextVisualizer\TextVisualizerMode.cs" />
<Compile Include="Visualizers\TextVisualizer\TextVisualizerWindow.xaml.cs">
@ -248,15 +246,7 @@ @@ -248,15 +246,7 @@
<Compile Include="Visualizers\Graph\Layout\PositionedGraphNode.cs" />
<Compile Include="Visualizers\Graph\Layout\PositionedNodeProperty.cs" />
<Compile Include="Visualizers\Graph\Layout\PositionedPropertyEventArgs.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\BoxDotFormatter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\DotFormatter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\IdGenerator.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\LayoutDirection.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\NeatoDoubleFormatter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\NeatoEdgeRouter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\NeatoPositionTransform.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\NeatoProcess.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\RecordDotFormatter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\TreeEdge.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\TreeLayouter.cs" />
<Compile Include="Visualizers\Graph\Layout\Tree\TreeGraphNode.cs" />

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/VisualizerDescriptors.cs

@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers @@ -31,7 +31,7 @@ namespace Debugger.AddIn.Visualizers
public static ReadOnlyCollection<IVisualizerDescriptor> GetAllDescriptors()
{
if (allDescriptors == null) {
allDescriptors = new List<IVisualizerDescriptor>(CreateAllDescriptors()).AsReadOnly();
allDescriptors = CreateAllDescriptors().ToList().AsReadOnly();
}
return allDescriptors;
}

45
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/BoxDotFormatter.cs

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Text;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// <see cref="DotFormatter"/> that treats node as a atomic "box". Edges go from box to box.
/// </summary>
public class BoxDotFormatter : DotFormatter
{
public BoxDotFormatter(PositionedGraph posGraph) : base(posGraph)
{
}
protected override void appendPosNode(PositionedGraphNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;
Rect neatoInput = transform.NodeToNeatoInput(node);
string dotFormatNode =
string.Format(this.neatoDoubleFormatter,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\"];",
nodeName, neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height);
builder.AppendLine(dotFormatNode);
}
protected override void appendPosEdge(PositionedEdge edge, StringBuilder builder)
{
string sourceNodeName = nodeNames[edge.Source.ContainingNode];
string targetNodeName = nodeNames[edge.Target];
builder.AppendLine(string.Format("{0} -> {1}", sourceNodeName, targetNodeName));
}
}
}

183
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/DotFormatter.cs

@ -1,183 +0,0 @@ @@ -1,183 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// Converts <see cref="PositionedGraph/> to Graphviz's string (dot format) and back (from plain format).
/// </summary>
public abstract class DotFormatter
{
protected PositionedGraph posGraph;
protected NeatoPositionTransform transform;
protected NeatoDoubleFormatter neatoDoubleFormatter = new NeatoDoubleFormatter();
// state (node and edge names) needed for parsing back
protected Dictionary<PositionedGraphNode, string> nodeNames = new Dictionary<PositionedGraphNode, string>();
protected Dictionary<PositionedEdge, string> edgeNames = new Dictionary<PositionedEdge, string>();
/// <summary>
/// Used for generating node and edge names.
/// </summary>
protected IdGenerator genId = new IdGenerator();
public DotFormatter(PositionedGraph posGraph)
{
if (posGraph.Nodes.Count() == 0)
{
throw new ArgumentException("Cannot process empty graphs.");
}
this.posGraph = posGraph;
this.transform = new NeatoPositionTransform(this.posGraph.BoundingRect);
}
protected abstract void appendPosNode(PositionedGraphNode node, StringBuilder builder);
protected abstract void appendPosEdge(PositionedEdge edge, StringBuilder builder);
protected virtual string getGraphHeader()
{
return "digraph G { node [shape = box];";
}
protected virtual string getGraphFooter()
{
return "}";
}
/// <summary>
/// Gets Graphviz's dot format string for wrapped positioned graph.
/// </summary>
public string OutputGraphInDotFormat()
{
StringBuilder dotStringBuilder = new StringBuilder(getGraphHeader());
foreach (PositionedGraphNode posNode in this.posGraph.Nodes)
{
appendPosNode(posNode, dotStringBuilder);
}
foreach (PositionedEdge posEdge in this.posGraph.Edges)
{
appendPosEdge(posEdge, dotStringBuilder);
}
dotStringBuilder.AppendLine(getGraphFooter());
return dotStringBuilder.ToString();
}
private bool validateSplinePoints(PositionedEdge edge)
{
// must have correct number of points: one start point and 3 points per bezier segment
return ((edge.SplinePoints.Count - 1) % 3) == 0;
}
/// <summary>
/// Parses edge positions (from Graphviz's plain format) and sets these positions to underlying positioned graph.
/// </summary>
/// <param name="dotGraphString">Graph with positions in Graphviz's plain format</param>
/// <returns><see cref="PositionedGraph"/> with edge positions filled.</returns>
public PositionedGraph ParseEdgePositions(string dotGraphString)
{
using (StringReader reader = new System.IO.StringReader(dotGraphString))
{
skipAfterPattern(reader, "node " + nodeNames[posGraph.Nodes.First()] + " ");
Point neatoFirstNodePos = readPoint(reader);
PositionedGraphNode firstNode = posGraph.Nodes.First();
Point firstNodePosOur = transform.AsNeato(firstNode.Center);
// determine how Neato shifted the nodes
transform.NeatoShiftX = neatoFirstNodePos.X - firstNodePosOur.X;
transform.NeatoShiftY = neatoFirstNodePos.Y - firstNodePosOur.Y;
// assume that edges on output are in the same order as posGraph.Edges (!)
foreach (PositionedEdge posEdge in posGraph.Edges)
{
skipAfterPattern(reader, "edge ");
readWord(reader); // source node name
readWord(reader); // target node name
int splinePointCount = readInt(reader);
for (int i = 0; i < splinePointCount; i++)
{
Point edgePoint = readPoint(reader);
edgePoint = transform.FromNeatoOutput(edgePoint);
posEdge.SplinePoints.Add(edgePoint);
}
bool edgeOk = validateSplinePoints(posEdge);
if (!edgeOk)
throw new DebuggerVisualizerException("Parsed edge invalid");
}
}
// return original graph with filled edge positions
return this.posGraph;
}
private Point readPoint(TextReader reader)
{
double x = readDouble(reader);
double y = readDouble(reader);
return new Point(x, y);
}
private double readDouble(TextReader reader)
{
return double.Parse(readWord(reader), this.neatoDoubleFormatter.DoubleCulture);
}
private int readInt(TextReader reader)
{
return int.Parse(readWord(reader));
}
private string readWord(TextReader reader)
{
StringBuilder word = new StringBuilder();
int ch = ' ';
while ((ch = reader.Read()) != ' ')
{
if (ch == -1 || ch == '\n' || ch == '\t')
break;
word.Append((char)ch);
}
return word.ToString();
}
private bool skipAfterPattern(StringReader reader, string pattern)
{
int ch = -1;
int pIndex = 0;
int pTarget = pattern.Length;
while ((ch = reader.Read()) != -1)
{
if (ch == pattern[pIndex])
{
pIndex++;
if (pIndex == pTarget)
return true;
}
else
{
pIndex = 0;
}
}
return false;
}
}
}

28
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/IdGenerator.cs

@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// Generates sequential ids, usefull for node and edge ids.
/// </summary>
public class IdGenerator
{
int currentId = 0;
public IdGenerator()
{
}
public int GetNextId()
{
return currentId++;
}
}
}

40
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoDoubleFormatter.cs

@ -1,40 +0,0 @@ @@ -1,40 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Globalization;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// When used as IFormatProvider in string.Format, formats doubles to be suitable for Neato.
/// </summary>
public class NeatoDoubleFormatter : IFormatProvider, ICustomFormatter
{
private CultureInfo doubleCulture = CultureInfo.GetCultureInfo("en-US");
/// <summary>
/// CultureInfo used for formatting and parsing doubles (en-US).
/// </summary>
public CultureInfo DoubleCulture
{
get { return this.doubleCulture; }
}
public object GetFormat(Type formatType)
{
if (formatType == typeof(ICustomFormatter))
return this;
else
return null;
}
public string Format(string format, object arg, IFormatProvider formatProvider)
{
return string.Format(doubleCulture, "{0:0.000}", arg);
}
}
}

48
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoEdgeRouter.cs

@ -1,48 +0,0 @@ @@ -1,48 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Linq;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// Given <see cref="PositionedGraph" /> with positions of nodes, calculates positions of edges.
/// </summary>
public class NeatoEdgeRouter
{
public NeatoEdgeRouter()
{
}
/// <summary>
/// Given <see cref="PositionedGraph" /> with node positions, calculates edge positions.
/// </summary>
/// <param name="graphWithNodesPositioned"><see cref="PositionedGraph" />, the nodes must have positions filled.</param>
/// <returns><see cref="PositionedGraph" /> with preserved node positions and calculated edge positions.</returns>
public PositionedGraph CalculateEdges(PositionedGraph graphWithNodesPositioned)
{
DotFormatter dotFormatter = new BoxDotFormatter(graphWithNodesPositioned);
// convert PosGraph to .dot string
string dotGraphString = dotFormatter.OutputGraphInDotFormat();
// pass to neato.exe and wait for output
string dotGraphStringWithPositions = NeatoProcess.Start().CalculatePositions(dotGraphString);
// parse edge positions from neato's plain output format
PositionedGraph result = dotFormatter.ParseEdgePositions(dotGraphStringWithPositions);
return result;
}
}
}

72
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoPositionTransform.cs

@ -1,72 +0,0 @@ @@ -1,72 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// Transforms positions to and from Neato.
/// </summary>
public class NeatoPositionTransform
{
private Rect graphBoundingRect;
// So that Neato works with smaller numbers. Always > 1
double ourInputScale = 40;
// Neato itself scales input by this constant. Always > 1, 1 for plain output, 72 for .dot output
double neatoOutputScale = 1;
public NeatoPositionTransform(Rect graphBoundingRectangle)
{
graphBoundingRect = graphBoundingRectangle;
}
/// <summary>
/// X shift, in Neato coords.
/// </summary>
public double NeatoShiftX { get; set; }
/// <summary>
/// Y shift, in Neato coords.
/// </summary>
public double NeatoShiftY { get; set; }
public Point ToNeatoInput(Point ourPoint)
{
// invert Y axis, as Neato expects this
return new Point(ourPoint.X / ourInputScale, (graphBoundingRect.Bottom - ourPoint.Y) / ourInputScale);
}
public System.Windows.Point FromNeatoOutput(Point neatoPoint)
{
// Neato multiplies coords by 72 and adds arbitrary shift (which has to be parsed)
double ourX = (neatoPoint.X - NeatoShiftX) / neatoOutputScale * ourInputScale;
double ourYInverted = (neatoPoint.Y - NeatoShiftY) / neatoOutputScale * ourInputScale;
// invert back - our Y axis grows down
return new Point(ourX, graphBoundingRect.Bottom - ourYInverted);
}
/// <summary>
/// Transform points as Neato would transform it if Neato used no shift
/// </summary>
/// <param name="ourPoint"></param>
/// <returns></returns>
public System.Windows.Point AsNeato(Point ourPoint)
{
return new Point(ourPoint.X * neatoOutputScale / ourInputScale, (graphBoundingRect.Bottom - ourPoint.Y) * neatoOutputScale / ourInputScale);
}
public Rect NodeToNeatoInput(PositionedGraphNode node)
{
// don't transform size
return new Rect(ToNeatoInput(node.Center),
new Size(node.Width / ourInputScale, node.Height / ourInputScale));
}
}
}

104
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/NeatoProcess.cs

@ -1,104 +0,0 @@ @@ -1,104 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using System.Text;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// Encapsulates Neato.exe.
/// </summary>
public class NeatoProcess
{
private System.Diagnostics.Process neatoProcess;
/// <summary>
/// Starts neato.exe
/// </summary>
public static NeatoProcess Start()
{
System.Diagnostics.Process neatoProcess = new System.Diagnostics.Process();
neatoProcess.StartInfo.FileName = getNeatoExePath();
neatoProcess.StartInfo.RedirectStandardInput = true;
neatoProcess.StartInfo.RedirectStandardError = true;
neatoProcess.StartInfo.RedirectStandardOutput = true;
neatoProcess.StartInfo.UseShellExecute = false;
neatoProcess.StartInfo.CreateNoWindow = true;
// tell neato to use splines instead of straigt lines
// output type = Graphviz's plain format
neatoProcess.StartInfo.Arguments = " -Gsplines=true -Tplain";
//p.EnableRaisingEvents = true;
neatoProcess.Exited += delegate {
neatoProcess.Dispose();
};
/*p.OutputDataReceived += delegate(object sender, DataReceivedEventArgs e) {
};
p.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs e) {
};*/
neatoProcess.Start();
return new NeatoProcess(neatoProcess);
}
/// <summary>Creates new NeatoProcess.</summary>
/// <param name="neatoProcess">Underlying neato.exe process</param>
private NeatoProcess(System.Diagnostics.Process neatoProcess)
{
this.neatoProcess = neatoProcess;
}
/// <summary>Gets directory where Debugger.AddIn.dll resides</summary>
private static string getCurrentAssemblyPath()
{
return Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
}
private static string getNeatoExePath()
{
return Path.Combine(getCurrentAssemblyPath(), "neato.exe");
}
/// <summary>
/// Passes given graph to neato and reads output.
/// </summary>
/// <param name="dotGraph">Graph in Graphviz dot format.</param>
/// <returns>Same graph in Graphviz plain format with position information added.</returns>
public string CalculatePositions(string dotGraph)
{
// write the input to neato.exe to a file for testing purposes
/*using (var writer = new StreamWriter(Path.Combine(getCurrentAssemblyPath(), "logIn.gv")))
{
writer.Write(dotGraph);
}*/
neatoProcess.StandardInput.Write(dotGraph);
neatoProcess.StandardInput.Flush();
neatoProcess.StandardInput.Close();
StringBuilder output = new StringBuilder();
while(true)
{
string line = neatoProcess.StandardOutput.ReadLine();
if (line == null)
{
// happens if neato.exe is killed
throw new DebuggerVisualizerException("Problem getting layout information from neato.exe");
}
if (line == "stop")
{
break;
}
output.AppendLine(line);
}
return output.ToString();
}
}
}

71
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/Layout/Tree/RecordDotFormatter.cs

@ -1,71 +0,0 @@ @@ -1,71 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
namespace Debugger.AddIn.Visualizers.Graph.Layout
{
/// <summary>
/// <see cref="DotFormatter"/> that treats nodes as records of properties.
/// Edges start at property, end at node.
/// </summary>
public class RecordDotFormatter : DotFormatter
{
private Dictionary<PositionedNodeProperty, string> propertyIds = new Dictionary<PositionedNodeProperty, string>();
public RecordDotFormatter(PositionedGraph posGraph) : base(posGraph)
{
}
protected override string getGraphHeader()
{
return "digraph G { rankdir=LR; node [shape = record];";
}
protected override void appendPosNode(PositionedGraphNode node, StringBuilder builder)
{
string nodeName = genId.GetNextId().ToString();
nodeNames[node] = nodeName;
Rect neatoInput = transform.NodeToNeatoInput(node);
StringBuilder recordLabel = new StringBuilder();
bool first = true;
foreach (var prop in node.Properties)
{
string propertyId = "f" + genId.GetNextId().ToString();
propertyIds[prop] = propertyId;
if (!first)
{
recordLabel.Append("|");
}
recordLabel.Append(string.Format("<{0}> l", propertyId));
first = false;
}
string dotFormatNode =
string.Format(this.neatoDoubleFormatter,
"{0} [pos=\"{1},{2}!\" width=\"{3}\" height=\"{4}\" label=\"{5}\"];",
nodeName,
neatoInput.Location.X, neatoInput.Location.Y, neatoInput.Width, neatoInput.Height,
recordLabel.ToString());
builder.AppendLine(dotFormatNode);
}
protected override void appendPosEdge(PositionedEdge edge, StringBuilder builder)
{
string sourceNodeName = nodeNames[edge.Source.ContainingNode];
string sourcePropertyName = propertyIds[edge.Source];
string targetNodeName = nodeNames[edge.Target];
builder.AppendLine(string.Format("{0}:{1} -> {2}", sourceNodeName, sourcePropertyName, targetNodeName));
}
}
}

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/NodeControlCache.cs

@ -13,7 +13,7 @@ using System.Linq; @@ -13,7 +13,7 @@ using System.Linq;
namespace Debugger.AddIn.Visualizers.Graph
{
/// <summary>
/// Description of NodeControlCache.
/// Store to reuse <see cref="NodeControl" />s so that they don't have to be created for every drawing.
/// </summary>
public class NodeControlCache
{

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraph/ObjectGraphProperty.cs

@ -64,7 +64,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -64,7 +64,7 @@ namespace Debugger.AddIn.Visualizers.Graph
this.IsAtomic = debuggerVal.Type.IsAtomic();
this.IsNull = debuggerVal.IsNull;
// null and complex properties evaluate to empty string
// null and complex properties will show empty string
this.Value = debuggerVal.IsNull || (!this.IsAtomic) ? string.Empty : debuggerVal.InvokeToString();
this.evaluateCalled = true;
}

2
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/ObjectGraphControl.xaml.cs

@ -109,7 +109,7 @@ namespace Debugger.AddIn.Visualizers.Graph @@ -109,7 +109,7 @@ namespace Debugger.AddIn.Visualizers.Graph
this.graphDrawer.ClearCanvas();
return;
}
if (debuggerService.IsProcessRunning) // TODO "Process not paused" exception still occurs
if (debuggerService.IsProcessRunning) // "Process not paused" exception still occurs
{
showErrorMessage("Cannot inspect when the process is running.");
return;

23
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Graph/TreeModel/NestedNodeType.cs

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger.AddIn.Visualizers.Graph
{
/// <summary>
/// Description of NestedNodeType.
/// </summary>
/*public enum NestedNodeType
{
ThisNode,
BaseClassNode,
NonPublicInstanceMembersNode,
StaticMembersNode,
NonPublicStaticMembersNode
}*/
}

4
src/AddIns/Debugger/Debugger.AddIn/Visualizers/GridVisualizer/ValueProviders/EnumerableValuesProvider.cs

@ -21,7 +21,7 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer @@ -21,7 +21,7 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer
/// <summary>
/// Provides <see cref="ObjectValue"/>s for debugee objects implementing IEnumerable.
/// </summary>
public class EnumerableValuesProvider : GridValuesProvider
/*public class EnumerableValuesProvider : GridValuesProvider
{
public EnumerableValuesProvider(Expression targetObject, DebugType iEnumerableType, DebugType itemType)
:base(targetObject, iEnumerableType, itemType)
@ -50,5 +50,5 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer @@ -50,5 +50,5 @@ namespace Debugger.AddIn.Visualizers.GridVisualizer
yield return ObjectValue.Create(currentValue, index++, this.memberFromNameMap);
}
}
}
}*/
}

16
src/AddIns/Debugger/Debugger.AddIn/Visualizers/PresentationBindings/ScrollUtils.cs

@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Martin Koníček" email="martin.konicek@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Debugger.AddIn.Visualizers
{
}

24
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CaretReferencesRenderer.cs

@ -8,6 +8,7 @@ using System; @@ -8,6 +8,7 @@ using System;
using System.Collections.Generic;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.AddIn.Options;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
@ -26,6 +27,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -26,6 +27,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// </summary>
DispatcherTimer delayTimer;
const int delayMilliseconds = 800;
/// <summary>
/// Delays the Resolve check so that it does not get called too often when user holds an arrow.
/// </summary>
DispatcherTimer delayMoveTimer;
const int delayMoveMilliseconds = 100;
@ -51,10 +55,17 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -51,10 +55,17 @@ namespace ICSharpCode.AvalonEdit.AddIn
this.editorView.TextArea.Caret.PositionChanged += CaretPositionChanged;
}
public void ClearHighlight()
{
this.highlightRenderer.ClearHighlight();
}
void TimerTick(object sender, EventArgs e)
{
if (!CodeEditorOptions.Instance.HighlightSymbol)
return;
this.delayTimer.Stop();
LoggingService.Info("tick");
// almost the same as DebuggerService.HandleToolTipRequest
var referencesToBeHighlighted = GetReferencesInCurrentFile(this.lastResolveResult);
this.highlightRenderer.SetHighlight(referencesToBeHighlighted);
@ -62,7 +73,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -62,7 +73,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
void TimerMoveTick(object sender, EventArgs e)
{
LoggingService.Debug("move");
if (!CodeEditorOptions.Instance.HighlightSymbol)
return;
this.delayMoveTimer.Stop();
this.delayTimer.Stop();
var resolveResult = GetExpressionUnderCaret();
@ -120,6 +133,13 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -120,6 +133,13 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// </summary>
bool SameResolveResult(ResolveResult resolveResult, ResolveResult resolveResult2)
{
/*if (resolveResult == null && resolveResult2 == null)
return true;
if (resolveResult == null && resolveResult2 != null)
return false;
if (resolveResult != null && resolveResult2 == null)
return false;*/
// TODO determine if 2 ResolveResults refer to the same symbol
return false;
}
}

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

@ -72,6 +72,8 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -72,6 +72,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
HighlightBrackets(null, e);
else if (e.PropertyName == "EnableFolding")
UpdateParseInformation();
else if (e.PropertyName == "HighlightSymbol")
this.caretReferencesRenderer.ClearHighlight();
}
#region CaretPositionChanged - Bracket Highlighting

13
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CodeEditorOptions.cs

@ -135,6 +135,19 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -135,6 +135,19 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
}
}
bool highlightSymbol = true;
[DefaultValue(true)]
public bool HighlightSymbol {
get { return highlightSymbol; }
set {
if (highlightSymbol != value) {
highlightSymbol = value;
OnPropertyChanged("HighlightSymbol");
}
}
}
bool useSmartIndentation = true;
[DefaultValue(true)]

3
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/TextViewOptions.xaml

@ -21,6 +21,9 @@ @@ -21,6 +21,9 @@
<CheckBox
IsChecked="{core:OptionBinding local:CodeEditorOptions.HighlightBrackets}"
Content="{core:Localize Dialog.Options.IDEOptions.TextEditor.Markers.HiglightBracketCheckBox}" />
<CheckBox
IsChecked="{core:OptionBinding local:CodeEditorOptions.HighlightSymbol}"
Content="{core:Localize Dialog.Options.IDEOptions.TextEditor.Markers.HighlightSymbolCheckBox}" />
</StackPanel>
</GroupBox>
</StackPanel>

Loading…
Cancel
Save