Browse Source

fix some wrong locations and tokens in InsertMissingTokensDecorator

newNRILSpyDebugger
Siegfried Pammer 12 years ago
parent
commit
8519f8bebd
  1. 81
      src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs
  2. 40
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs
  3. 6
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs
  4. 35
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
  5. 22
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs
  6. 14
      src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs
  7. 7
      src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs
  8. 5
      src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs
  9. 1
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs
  10. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs
  11. 11
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs
  12. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs
  13. 4
      src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs
  14. 5
      src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs
  15. 20
      src/Libraries/NRefactory/NRefactory.sln

81
src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs

@ -6,80 +6,51 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.NRefactory.CSharp;
using Mono.Cecil; using Mono.Cecil;
namespace ICSharpCode.ILSpyAddIn namespace ICSharpCode.ILSpyAddIn
{ {
public sealed class DebuggerTextOutput : ITextOutput public sealed class DebugInfoTokenWriterDecorator : DecoratingTokenWriter, ILocatable
{ {
readonly ITextOutput output; readonly Stack<MethodDebugSymbols> symbolsStack = new Stack<MethodDebugSymbols>();
readonly ILocatable locationProvider;
public readonly Dictionary<string, MethodDebugSymbols> DebugSymbols = new Dictionary<string, MethodDebugSymbols>(); public readonly Dictionary<string, MethodDebugSymbols> DebugSymbols = new Dictionary<string, MethodDebugSymbols>();
public readonly Dictionary<string, ICSharpCode.NRefactory.TextLocation> MemberLocations = new Dictionary<string, ICSharpCode.NRefactory.TextLocation>(); public readonly Dictionary<string, ICSharpCode.NRefactory.TextLocation> MemberLocations = new Dictionary<string, ICSharpCode.NRefactory.TextLocation>();
public DebuggerTextOutput(ITextOutput output) public DebugInfoTokenWriterDecorator(TokenWriter writer, ILocatable locationProvider)
: base(writer)
{ {
this.output = output; if (locationProvider == null)
throw new ArgumentNullException("locationProvider");
this.locationProvider = locationProvider;
} }
public ICSharpCode.NRefactory.TextLocation Location { public override void StartNode(AstNode node)
get { return output.Location; }
}
public void Indent()
{
output.Indent();
}
public void Unindent()
{
output.Unindent();
}
public void Write(char ch)
{
output.Write(ch);
}
public void Write(string text)
{
output.Write(text);
}
public void WriteLine()
{
output.WriteLine();
}
public void WriteDefinition(string text, object definition, bool isLocal)
{ {
if (definition is MemberReference) { base.StartNode(node);
MemberLocations[XmlDocKeyProvider.GetKey((MemberReference)definition)] = Location; if (node.Annotation<MethodDebugSymbols>() != null) {
symbolsStack.Push(node.Annotation<MethodDebugSymbols>());
} }
output.WriteDefinition(text, definition, isLocal);
}
public void WriteReference(string text, object reference, bool isLocal)
{
output.WriteReference(text, reference, isLocal);
} }
public void AddDebugSymbols(MethodDebugSymbols methodDebugSymbols) public override void EndNode(AstNode node)
{ {
var id = XmlDocKeyProvider.GetKey(methodDebugSymbols.CecilMethod); base.EndNode(node);
methodDebugSymbols.SequencePoints = methodDebugSymbols.SequencePoints.OrderBy(s => s.ILOffset).ToList(); if (node is EntityDeclaration && node.Annotation<MemberReference>() != null) {
this.DebugSymbols.Add(id, methodDebugSymbols); MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation<MemberReference>())] = node.StartLocation;
output.AddDebugSymbols(methodDebugSymbols); }
} if (node.Annotation<MethodDebugSymbols>() != null) {
var symbols = symbolsStack.Pop();
public void MarkFoldStart(string collapsedText, bool defaultCollapsed) symbols.SequencePoints = symbols.SequencePoints.OrderBy(s => s.ILOffset).ToList();
{ symbols.StartLocation = node.StartLocation;
output.MarkFoldStart(collapsedText, defaultCollapsed); DebugSymbols[XmlDocKeyProvider.GetKey(symbols.CecilMethod)] = symbols;
}
} }
public void MarkFoldEnd() public ICSharpCode.NRefactory.TextLocation Location {
{ get { return locationProvider.Location; }
output.MarkFoldEnd();
} }
} }
} }

40
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs

@ -65,7 +65,7 @@ namespace ICSharpCode.ILSpyAddIn
} }
} }
public class DecompiledTypeReference public class DecompiledTypeReference : IEquatable<DecompiledTypeReference>
{ {
public FileName AssemblyFile { get; private set; } public FileName AssemblyFile { get; private set; }
public FullTypeName Type { get; private set; } public FullTypeName Type { get; private set; }
@ -94,5 +94,43 @@ namespace ICSharpCode.ILSpyAddIn
return new DecompiledTypeReference(new FileName(asm), new FullTypeName(typeName)); return new DecompiledTypeReference(new FileName(asm), new FullTypeName(typeName));
} }
#region Equals and GetHashCode implementation
public override bool Equals(object obj)
{
DecompiledTypeReference other = (DecompiledTypeReference)obj;
if (other == null)
return false;
return Equals(other);
}
public bool Equals(DecompiledTypeReference other)
{
return object.Equals(this.AssemblyFile, other.AssemblyFile) && this.Type == other.Type;
}
public override int GetHashCode()
{
int hashCode = 0;
unchecked {
if (AssemblyFile != null)
hashCode += 1000000007 * AssemblyFile.GetHashCode();
hashCode += 1000000009 * Type.GetHashCode();
}
return hashCode;
}
public static bool operator ==(DecompiledTypeReference lhs, DecompiledTypeReference rhs) {
if (ReferenceEquals(lhs, rhs))
return true;
if (ReferenceEquals(lhs, null) || ReferenceEquals(rhs, null))
return false;
return lhs.Equals(rhs);
}
public static bool operator !=(DecompiledTypeReference lhs, DecompiledTypeReference rhs) {
return !(lhs == rhs);
}
#endregion
} }
} }

6
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs

@ -9,6 +9,7 @@ using System.Threading;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.NRefactory; using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.Resolver;
using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Editor;
using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.Semantics;
using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem;
@ -36,7 +37,10 @@ namespace ICSharpCode.ILSpyAddIn
public ResolveResult Resolve(ParseInformation parseInfo, TextLocation location, ICompilation compilation, CancellationToken cancellationToken) public ResolveResult Resolve(ParseInformation parseInfo, TextLocation location, ICompilation compilation, CancellationToken cancellationToken)
{ {
throw new NotImplementedException(); var decompiledParseInfo = parseInfo as ILSpyFullParseInformation;
if (decompiledParseInfo == null)
throw new ArgumentException("Parse info does not have SyntaxTree");
return ResolveAtLocation.Resolve(compilation, null, decompiledParseInfo.SyntaxTree, location, cancellationToken);
} }
public ResolveResult ResolveSnippet(ParseInformation parseInfo, TextLocation location, string codeSnippet, ICompilation compilation, CancellationToken cancellationToken) public ResolveResult ResolveSnippet(ParseInformation parseInfo, TextLocation location, string codeSnippet, ICompilation compilation, CancellationToken cancellationToken)

35
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs

@ -37,11 +37,11 @@ namespace ICSharpCode.ILSpyAddIn
public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset) public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset)
{ {
var symbols = GetSymbols(method); string id = IdStringProvider.GetIdString(method.MemberDefinition);
if (symbols == null)
return null;
var content = DecompiledViewContent.Get(method); var content = DecompiledViewContent.Get(method);
if (content == null || !content.DebugSymbols.ContainsKey(id))
return null;
var symbols = content.DebugSymbols[id];
var seqs = symbols.SequencePoints; var seqs = symbols.SequencePoints;
var seq = seqs.FirstOrDefault(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)); var seq = seqs.FirstOrDefault(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To));
if (seq == null) if (seq == null)
@ -50,8 +50,8 @@ namespace ICSharpCode.ILSpyAddIn
// Use the widest sequence point containing the IL offset // Use the widest sequence point containing the IL offset
iloffset = seq.ILOffset; iloffset = seq.ILOffset;
seq = seqs.Where(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)) seq = seqs.Where(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To))
.OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From) .OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From)
.FirstOrDefault(); .FirstOrDefault();
return seq.ToDebugger(symbols, content.PrimaryFileName); return seq.ToDebugger(symbols, content.PrimaryFileName);
} }
return null; return null;
@ -59,21 +59,22 @@ namespace ICSharpCode.ILSpyAddIn
public Debugger.SequencePoint GetSequencePoint(Module module, string filename, int line, int column) public Debugger.SequencePoint GetSequencePoint(Module module, string filename, int line, int column)
{ {
var decompiledFile = ILSpyDecompilerService.DecompileType(DecompiledTypeReference.FromFileName(filename)); var name = DecompiledTypeReference.FromFileName(filename);
if (decompiledFile == null) var content = DecompiledViewContent.Get(name);
if (content == null)
return null; return null;
if (!FileUtility.IsEqualFileName(module.FullPath, decompiledFile.AssemblyFile)) if (!FileUtility.IsEqualFileName(module.FullPath, content.AssemblyFile))
return null; return null;
TextLocation loc = new TextLocation(line, column); TextLocation loc = new TextLocation(line, column);
foreach(var symbols in decompiledFile.DebugSymbols.Values.Where(s => s.StartLocation <= loc && loc <= s.EndLocation)) { foreach(var symbols in content.DebugSymbols.Values.Where(s => s.StartLocation <= loc && loc <= s.EndLocation)) {
Decompiler.SequencePoint seq = null; Decompiler.SequencePoint seq = null;
if (column != 0) if (column != 0)
seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation); seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation);
if (seq == null) if (seq == null)
seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line); seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line);
if (seq != null) if (seq != null)
return seq.ToDebugger(symbols, decompiledFile.FileName); return seq.ToDebugger(symbols, content.PrimaryFileName);
} }
return null; return null;
} }
@ -96,12 +97,12 @@ namespace ICSharpCode.ILSpyAddIn
return null; return null;
return symbols.LocalVariables.Select(v => new Debugger.ILLocalVariable() { return symbols.LocalVariables.Select(v => new Debugger.ILLocalVariable() {
Index = v.OriginalVariable.Index, Index = v.OriginalVariable.Index,
Type = method.Compilation.FindType(KnownTypeCode.Object), // TODO Type = method.Compilation.FindType(KnownTypeCode.Object), // TODO
Name = v.Name, Name = v.Name,
IsCompilerGenerated = false, IsCompilerGenerated = false,
ILRanges = new [] { new Debugger.ILRange(0, int.MaxValue) } ILRanges = new [] { new Debugger.ILRange(0, int.MaxValue) }
}); });
} }
} }

22
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs

@ -19,7 +19,6 @@ namespace ICSharpCode.ILSpyAddIn
public class ILSpyUnresolvedFile : IUnresolvedFile public class ILSpyUnresolvedFile : IUnresolvedFile
{ {
DecompiledTypeReference name; DecompiledTypeReference name;
DebuggerTextOutput textOutput;
StringWriter writer; StringWriter writer;
IList<Error> errors; IList<Error> errors;
IList<IUnresolvedTypeDefinition> topLevel; IList<IUnresolvedTypeDefinition> topLevel;
@ -27,13 +26,20 @@ namespace ICSharpCode.ILSpyAddIn
public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilder builder) public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilder builder)
{ {
var writer = new StringWriter(); var writer = new StringWriter();
var output = new DebuggerTextOutput(new PlainTextOutput(writer)); var target = new TextWriterTokenWriter(writer) { IndentationString = "\t" };
builder.GenerateCode(output); var output = new DebugInfoTokenWriterDecorator(target, target);
builder.RunTransformations();
var syntaxTree = builder.SyntaxTree;
syntaxTree.AcceptVisitor(new InsertParenthesesVisitor { InsertParenthesesForReadability = true });
var outputFormatter = TokenWriter.WrapInWriterThatSetsLocationsInAST(output);
syntaxTree.AcceptVisitor(new CSharpOutputVisitor(outputFormatter, FormattingOptionsFactory.CreateSharpDevelop()));
ILSpyUnresolvedFile file = new ILSpyUnresolvedFile(name, builder.SyntaxTree.Errors); ILSpyUnresolvedFile file = new ILSpyUnresolvedFile(name, builder.SyntaxTree.Errors);
builder.SyntaxTree.FileName = name.ToFileName(); builder.SyntaxTree.FileName = name.ToFileName();
var ts = builder.SyntaxTree.ToTypeSystem(); var ts = builder.SyntaxTree.ToTypeSystem();
file.topLevel = ts.TopLevelTypeDefinitions; file.topLevel = ts.TopLevelTypeDefinitions;
file.textOutput = output; file.MemberLocations = output.MemberLocations;
file.DebugSymbols = output.DebugSymbols;
file.writer = writer; file.writer = writer;
return file; return file;
@ -45,9 +51,9 @@ namespace ICSharpCode.ILSpyAddIn
this.errors = errors; this.errors = errors;
} }
public DebuggerTextOutput TextOutput { public Dictionary<string, TextLocation> MemberLocations { get; private set; }
get { return textOutput; }
} public Dictionary<string, MethodDebugSymbols> DebugSymbols { get; private set; }
public StringWriter Writer { public StringWriter Writer {
get { return writer; } get { return writer; }
@ -57,8 +63,6 @@ namespace ICSharpCode.ILSpyAddIn
get { return name.AssemblyFile; } get { return name.AssemblyFile; }
} }
public Dictionary<string, MethodDebugSymbols> DebugSymbols { get; private set; }
public IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location) public IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location)
{ {
throw new NotImplementedException(); throw new NotImplementedException();

14
src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

@ -82,6 +82,12 @@ namespace ICSharpCode.ILSpyAddIn
} }
#endregion #endregion
public static DecompiledViewContent Get(DecompiledTypeReference name)
{
var viewContents = SD.Workbench.ViewContentCollection.OfType<DecompiledViewContent>();
return viewContents.FirstOrDefault(c => c.DecompiledTypeName == name);
}
public static DecompiledViewContent Get(IEntity entity) public static DecompiledViewContent Get(IEntity entity)
{ {
if (entity == null) if (entity == null)
@ -194,13 +200,9 @@ namespace ICSharpCode.ILSpyAddIn
void DecompilationThread() void DecompilationThread()
{ {
try { try {
StringWriter writer = new StringWriter();
var file = ILSpyDecompilerService.DecompileType(DecompiledTypeName); var file = ILSpyDecompilerService.DecompileType(DecompiledTypeName);
memberLocations = file.TextOutput.MemberLocations; memberLocations = file.MemberLocations;
this.DebugSymbols = file.TextOutput.DebugSymbols; DebugSymbols = file.DebugSymbols;
// if (!cancellation.IsCancellationRequested) {
// SD.MainThread.InvokeAsyncAndForget(() => OnDecompilationFinished(writer));
// }
OnDecompilationFinished(file.Writer); OnDecompilationFinished(file.Writer);
} catch (OperationCanceledException) { } catch (OperationCanceledException) {
// ignore cancellation // ignore cancellation

7
src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs

@ -150,13 +150,6 @@ namespace ICSharpCode.Decompiler.Ast
get { return syntaxTree; } get { return syntaxTree; }
} }
/// <summary>
/// Gets the context used by this AstBuilder.
/// </summary>
public DecompilerContext Context {
get { return context; }
}
/// <summary> /// <summary>
/// Generates C# code from the abstract source tree. /// Generates C# code from the abstract source tree.
/// </summary> /// </summary>

5
src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs

@ -274,7 +274,10 @@ namespace ICSharpCode.Decompiler.Ast
public override void WritePrimitiveType(string type) public override void WritePrimitiveType(string type)
{ {
output.Write(type);
if (type == "new") {
output.Write("()");
}
} }
Stack<TextLocation> startLocations = new Stack<TextLocation>(); Stack<TextLocation> startLocations = new Stack<TextLocation>();

1
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs

@ -46,6 +46,7 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
ThrowIfFrozen(); ThrowIfFrozen();
this.startLocation = value; this.startLocation = value;
this.endLocation = null;
} }
string literalValue; string literalValue;

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp
return new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new InsertMissingTokensDecorator(target, target))); return new InsertSpecialsDecorator(new InsertRequiredSpacesDecorator(new InsertMissingTokensDecorator(target, target)));
} }
public static TokenWriter WrapInWriterThatSetsLocationsInAST(TokenWriter writer, string indentation = "\t") public static TokenWriter WrapInWriterThatSetsLocationsInAST(TokenWriter writer)
{ {
if (!(writer is ILocatable)) if (!(writer is ILocatable))
throw new InvalidOperationException("writer does not provide locations!"); throw new InvalidOperationException("writer does not provide locations!");

11
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs

@ -61,7 +61,12 @@ namespace ICSharpCode.NRefactory.CSharp
public override void WriteToken(Role role, string token) public override void WriteToken(Role role, string token)
{ {
CSharpTokenNode t = new CSharpTokenNode(locationProvider.Location, (TokenRole)role); CSharpTokenNode t = new CSharpTokenNode(locationProvider.Location, (TokenRole)role);
currentList.Add(t); EmptyStatement node = nodes.Peek().LastOrDefault() as EmptyStatement;
if (node == null)
currentList.Add(t);
else {
node.Location = locationProvider.Location;
}
base.WriteToken(role, token); base.WriteToken(role, token);
} }
@ -77,6 +82,10 @@ namespace ICSharpCode.NRefactory.CSharp
ThisReferenceExpression node = nodes.Peek().LastOrDefault() as ThisReferenceExpression; ThisReferenceExpression node = nodes.Peek().LastOrDefault() as ThisReferenceExpression;
if (node != null) if (node != null)
node.Location = start; node.Location = start;
} else if (keyword == "base") {
BaseReferenceExpression node = nodes.Peek().LastOrDefault() as BaseReferenceExpression;
if (node != null)
node.Location = start;
} }
if (t != null) currentList.Add(t); if (t != null) currentList.Add(t);
base.WriteKeyword(role, keyword); base.WriteKeyword(role, keyword);

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs

@ -314,8 +314,10 @@ namespace ICSharpCode.NRefactory.CSharp
b.Append("L"); b.Append("L");
} }
textWriter.Write(b.ToString()); textWriter.Write(b.ToString());
column += b.Length;
} else { } else {
textWriter.Write(value.ToString()); textWriter.Write(value.ToString());
column += value.ToString().Length;
} }
} }

4
src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs

@ -92,9 +92,9 @@ namespace ICSharpCode.NRefactory.ConsistencyCheck.Xml
if (val == null) if (val == null)
return "null"; return "null";
else if (val is string) else if (val is string)
return "\"" + CSharpOutputVisitor.ConvertString((string)val) + "\""; return "\"" + TextWriterTokenWriter.ConvertString((string)val) + "\"";
else if (val is char) else if (val is char)
return "'" + CSharpOutputVisitor.ConvertChar((char)val) + "'"; return "'" + TextWriterTokenWriter.ConvertChar((char)val) + "'";
else else
return val.ToString(); return val.ToString();
} }

5
src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs

@ -68,12 +68,13 @@ namespace ICSharpCode.NRefactory.CSharp.Parser
static void CheckWhitespace(AstNode startNode, TextLocation whitespaceStart, AstNode endNode, TextLocation whitespaceEnd, string currentFileName, IDocument currentDocument) static void CheckWhitespace(AstNode startNode, TextLocation whitespaceStart, AstNode endNode, TextLocation whitespaceEnd, string currentFileName, IDocument currentDocument)
{ {
if (whitespaceStart == whitespaceEnd || startNode == endNode)
return;
Assert.Greater(whitespaceStart.Line, 0); Assert.Greater(whitespaceStart.Line, 0);
Assert.Greater(whitespaceStart.Column, 0); Assert.Greater(whitespaceStart.Column, 0);
Assert.Greater(whitespaceEnd.Line, 0); Assert.Greater(whitespaceEnd.Line, 0);
Assert.Greater(whitespaceEnd.Column, 0); Assert.Greater(whitespaceEnd.Column, 0);
if (whitespaceStart == whitespaceEnd || startNode == endNode) Assert.IsTrue(whitespaceEnd >= whitespaceStart, endNode.GetType().Name + ".StartLocation < " + startNode.GetType().Name + ".EndLocation: " + whitespaceEnd + " < " + whitespaceStart);
return;
int start = currentDocument.GetOffset(whitespaceStart.Line, whitespaceStart.Column); int start = currentDocument.GetOffset(whitespaceStart.Line, whitespaceStart.Column);
int end = currentDocument.GetOffset(whitespaceEnd.Line, whitespaceEnd.Column); int end = currentDocument.GetOffset(whitespaceEnd.Line, whitespaceEnd.Column);
string text = currentDocument.GetText(start, end - start); string text = currentDocument.GetText(start, end - start);

20
src/Libraries/NRefactory/NRefactory.sln

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
# SharpDevelop 5.0 # SharpDevelop 4.3
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC98210E-1646-483B-819A-2BB8272461E4}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC98210E-1646-483B-819A-2BB8272461E4}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
Packages\ICSharpCode.NRefactory.nuspec = Packages\ICSharpCode.NRefactory.nuspec Packages\ICSharpCode.NRefactory.nuspec = Packages\ICSharpCode.NRefactory.nuspec
@ -18,8 +18,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "..\cecil\Mono
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSharp", "ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj", "{53DCA265-3C3C-42F9-B647-F72BA678122B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSharp", "ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj", "{53DCA265-3C3C-42F9-B647-F72BA678122B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.GtkDemo", "ICSharpCode.NRefactory.GtkDemo\ICSharpCode.NRefactory.GtkDemo.csproj", "{A7EEF7F8-238F-459D-95A9-96467539641D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.ConsistencyCheck", "ICSharpCode.NRefactory.ConsistencyCheck\ICSharpCode.NRefactory.ConsistencyCheck.csproj", "{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.ConsistencyCheck", "ICSharpCode.NRefactory.ConsistencyCheck\ICSharpCode.NRefactory.ConsistencyCheck.csproj", "{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Xml", "ICSharpCode.NRefactory.Xml\ICSharpCode.NRefactory.Xml.csproj", "{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Xml", "ICSharpCode.NRefactory.Xml\ICSharpCode.NRefactory.Xml.csproj", "{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}"
@ -104,22 +102,6 @@ Global
{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU {53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU {53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU {53DCA265-3C3C-42F9-B647-F72BA678122B}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|x86.ActiveCfg = Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Debug|x86.Build.0 = Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|Any CPU.Build.0 = Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|x86.ActiveCfg = Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.Release|x86.Build.0 = Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|Any CPU.ActiveCfg = net_4_5_Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|Any CPU.Build.0 = net_4_5_Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|x86.ActiveCfg = net_4_5_Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Debug|x86.Build.0 = net_4_5_Debug|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|Any CPU.ActiveCfg = net_4_5_Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|Any CPU.Build.0 = net_4_5_Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|x86.ActiveCfg = net_4_5_Release|Any CPU
{A7EEF7F8-238F-459D-95A9-96467539641D}.net_4_5_Release|x86.Build.0 = net_4_5_Release|Any CPU
{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU {D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|x86.ActiveCfg = Debug|x86 {D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|x86.ActiveCfg = Debug|x86

Loading…
Cancel
Save