From 8519f8bebd629591a413f72c11a24fce00b8e0ff Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 2 Aug 2013 20:09:09 +0200 Subject: [PATCH] fix some wrong locations and tokens in InsertMissingTokensDecorator --- .../ILSpyAddIn/DebuggerTextOutput.cs | 81 ++++++------------- .../ILSpyAddIn/ILSpyDecompilerService.cs | 40 ++++++++- .../DisplayBindings/ILSpyAddIn/ILSpyParser.cs | 6 +- .../ILSpyAddIn/ILSpySymbolSource.cs | 35 ++++---- .../ILSpyAddIn/ILSpyUnresolvedFile.cs | 24 +++--- .../ViewContent/DecompiledViewContent.cs | 14 ++-- .../ICSharpCode.Decompiler/Ast/AstBuilder.cs | 7 -- .../Ast/TextTokenWriter.cs | 5 +- .../Ast/Expressions/PrimitiveExpression.cs | 1 + .../OutputVisitor/ITokenWriter.cs | 2 +- .../InsertMissingTokensDecorator.cs | 11 ++- .../TextWriterOutputFormatter.cs | 2 + .../Xml/XmlReaderTest.cs | 4 +- .../CSharp/Parser/ConsistencyChecker.cs | 5 +- src/Libraries/NRefactory/NRefactory.sln | 20 +---- 15 files changed, 134 insertions(+), 123 deletions(-) diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs index 5422ce6b05..d27b67279c 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/DebuggerTextOutput.cs @@ -6,80 +6,51 @@ using System.Collections.Generic; using System.Linq; using ICSharpCode.Core; using ICSharpCode.Decompiler; +using ICSharpCode.NRefactory.CSharp; using Mono.Cecil; namespace ICSharpCode.ILSpyAddIn { - public sealed class DebuggerTextOutput : ITextOutput + public sealed class DebugInfoTokenWriterDecorator : DecoratingTokenWriter, ILocatable { - readonly ITextOutput output; + readonly Stack symbolsStack = new Stack(); + readonly ILocatable locationProvider; public readonly Dictionary DebugSymbols = new Dictionary(); public readonly Dictionary MemberLocations = new Dictionary(); - 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 { - 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) + public override void StartNode(AstNode node) { - if (definition is MemberReference) { - MemberLocations[XmlDocKeyProvider.GetKey((MemberReference)definition)] = Location; + base.StartNode(node); + if (node.Annotation() != null) { + symbolsStack.Push(node.Annotation()); } - 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); - methodDebugSymbols.SequencePoints = methodDebugSymbols.SequencePoints.OrderBy(s => s.ILOffset).ToList(); - this.DebugSymbols.Add(id, methodDebugSymbols); - output.AddDebugSymbols(methodDebugSymbols); - } - - public void MarkFoldStart(string collapsedText, bool defaultCollapsed) - { - output.MarkFoldStart(collapsedText, defaultCollapsed); + base.EndNode(node); + if (node is EntityDeclaration && node.Annotation() != null) { + MemberLocations[XmlDocKeyProvider.GetKey(node.Annotation())] = node.StartLocation; + } + if (node.Annotation() != null) { + var symbols = symbolsStack.Pop(); + symbols.SequencePoints = symbols.SequencePoints.OrderBy(s => s.ILOffset).ToList(); + symbols.StartLocation = node.StartLocation; + DebugSymbols[XmlDocKeyProvider.GetKey(symbols.CecilMethod)] = symbols; + } } - public void MarkFoldEnd() - { - output.MarkFoldEnd(); + public ICSharpCode.NRefactory.TextLocation Location { + get { return locationProvider.Location; } } } } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs index 0043033b69..ba2b485a5b 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDecompilerService.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.ILSpyAddIn } } - public class DecompiledTypeReference + public class DecompiledTypeReference : IEquatable { public FileName AssemblyFile { 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)); } + + #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 } } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs index abdc556a82..443d22b3ed 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyParser.cs @@ -9,6 +9,7 @@ using System.Threading; using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.CSharp; +using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; @@ -36,7 +37,10 @@ namespace ICSharpCode.ILSpyAddIn 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) diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs index 830d705cf5..5dbca51b1b 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs @@ -37,11 +37,11 @@ namespace ICSharpCode.ILSpyAddIn public Debugger.SequencePoint GetSequencePoint(IMethod method, int iloffset) { - var symbols = GetSymbols(method); - if (symbols == null) - return null; - + string id = IdStringProvider.GetIdString(method.MemberDefinition); var content = DecompiledViewContent.Get(method); + if (content == null || !content.DebugSymbols.ContainsKey(id)) + return null; + var symbols = content.DebugSymbols[id]; var seqs = symbols.SequencePoints; var seq = seqs.FirstOrDefault(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)); if (seq == null) @@ -50,8 +50,8 @@ namespace ICSharpCode.ILSpyAddIn // Use the widest sequence point containing the IL offset iloffset = seq.ILOffset; seq = seqs.Where(p => p.ILRanges.Any(r => r.From <= iloffset && iloffset < r.To)) - .OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From) - .FirstOrDefault(); + .OrderByDescending(p => p.ILRanges.Last().To - p.ILRanges.First().From) + .FirstOrDefault(); return seq.ToDebugger(symbols, content.PrimaryFileName); } return null; @@ -59,21 +59,22 @@ namespace ICSharpCode.ILSpyAddIn public Debugger.SequencePoint GetSequencePoint(Module module, string filename, int line, int column) { - var decompiledFile = ILSpyDecompilerService.DecompileType(DecompiledTypeReference.FromFileName(filename)); - if (decompiledFile == null) + var name = DecompiledTypeReference.FromFileName(filename); + var content = DecompiledViewContent.Get(name); + if (content == null) return null; - if (!FileUtility.IsEqualFileName(module.FullPath, decompiledFile.AssemblyFile)) + if (!FileUtility.IsEqualFileName(module.FullPath, content.AssemblyFile)) return null; 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; if (column != 0) seq = symbols.SequencePoints.FirstOrDefault(p => p.StartLocation <= loc && loc <= p.EndLocation); if (seq == null) seq = symbols.SequencePoints.FirstOrDefault(p => line <= p.StartLocation.Line); if (seq != null) - return seq.ToDebugger(symbols, decompiledFile.FileName); + return seq.ToDebugger(symbols, content.PrimaryFileName); } return null; } @@ -96,12 +97,12 @@ namespace ICSharpCode.ILSpyAddIn return null; return symbols.LocalVariables.Select(v => new Debugger.ILLocalVariable() { - Index = v.OriginalVariable.Index, - Type = method.Compilation.FindType(KnownTypeCode.Object), // TODO - Name = v.Name, - IsCompilerGenerated = false, - ILRanges = new [] { new Debugger.ILRange(0, int.MaxValue) } - }); + Index = v.OriginalVariable.Index, + Type = method.Compilation.FindType(KnownTypeCode.Object), // TODO + Name = v.Name, + IsCompilerGenerated = false, + ILRanges = new [] { new Debugger.ILRange(0, int.MaxValue) } + }); } } diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs index 0ba2979c2c..61601faf23 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyUnresolvedFile.cs @@ -19,7 +19,6 @@ namespace ICSharpCode.ILSpyAddIn public class ILSpyUnresolvedFile : IUnresolvedFile { DecompiledTypeReference name; - DebuggerTextOutput textOutput; StringWriter writer; IList errors; IList topLevel; @@ -27,13 +26,20 @@ namespace ICSharpCode.ILSpyAddIn public static ILSpyUnresolvedFile Create(DecompiledTypeReference name, AstBuilder builder) { var writer = new StringWriter(); - var output = new DebuggerTextOutput(new PlainTextOutput(writer)); - builder.GenerateCode(output); + var target = new TextWriterTokenWriter(writer) { IndentationString = "\t" }; + 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); builder.SyntaxTree.FileName = name.ToFileName(); var ts = builder.SyntaxTree.ToTypeSystem(); file.topLevel = ts.TopLevelTypeDefinitions; - file.textOutput = output; + file.MemberLocations = output.MemberLocations; + file.DebugSymbols = output.DebugSymbols; file.writer = writer; return file; @@ -45,20 +51,18 @@ namespace ICSharpCode.ILSpyAddIn this.errors = errors; } - public DebuggerTextOutput TextOutput { - get { return textOutput; } - } + public Dictionary MemberLocations { get; private set; } + public Dictionary DebugSymbols { get; private set; } + public StringWriter Writer { get { return writer; } } - + public FileName AssemblyFile { get { return name.AssemblyFile; } } - public Dictionary DebugSymbols { get; private set; } - public IUnresolvedTypeDefinition GetTopLevelTypeDefinition(TextLocation location) { throw new NotImplementedException(); diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs index 7ceb0e1ab7..af769d8bd4 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs @@ -82,6 +82,12 @@ namespace ICSharpCode.ILSpyAddIn } #endregion + public static DecompiledViewContent Get(DecompiledTypeReference name) + { + var viewContents = SD.Workbench.ViewContentCollection.OfType(); + return viewContents.FirstOrDefault(c => c.DecompiledTypeName == name); + } + public static DecompiledViewContent Get(IEntity entity) { if (entity == null) @@ -194,13 +200,9 @@ namespace ICSharpCode.ILSpyAddIn void DecompilationThread() { try { - StringWriter writer = new StringWriter(); var file = ILSpyDecompilerService.DecompileType(DecompiledTypeName); - memberLocations = file.TextOutput.MemberLocations; - this.DebugSymbols = file.TextOutput.DebugSymbols; -// if (!cancellation.IsCancellationRequested) { -// SD.MainThread.InvokeAsyncAndForget(() => OnDecompilationFinished(writer)); -// } + memberLocations = file.MemberLocations; + DebugSymbols = file.DebugSymbols; OnDecompilationFinished(file.Writer); } catch (OperationCanceledException) { // ignore cancellation diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs index 4a41825ca9..64aa843f03 100644 --- a/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/src/Libraries/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -150,13 +150,6 @@ namespace ICSharpCode.Decompiler.Ast get { return syntaxTree; } } - /// - /// Gets the context used by this AstBuilder. - /// - public DecompilerContext Context { - get { return context; } - } - /// /// Generates C# code from the abstract source tree. /// diff --git a/src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs b/src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs index 3fba3a213b..45ed21bd69 100644 --- a/src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs +++ b/src/Libraries/ICSharpCode.Decompiler/Ast/TextTokenWriter.cs @@ -274,7 +274,10 @@ namespace ICSharpCode.Decompiler.Ast public override void WritePrimitiveType(string type) { - + output.Write(type); + if (type == "new") { + output.Write("()"); + } } Stack startLocations = new Stack(); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs index 22d83f4b9a..b774c9e87d 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Ast/Expressions/PrimitiveExpression.cs @@ -46,6 +46,7 @@ namespace ICSharpCode.NRefactory.CSharp { ThrowIfFrozen(); this.startLocation = value; + this.endLocation = null; } string literalValue; diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs index 877f9ca337..31b73f9873 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/ITokenWriter.cs +++ b/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))); } - public static TokenWriter WrapInWriterThatSetsLocationsInAST(TokenWriter writer, string indentation = "\t") + public static TokenWriter WrapInWriterThatSetsLocationsInAST(TokenWriter writer) { if (!(writer is ILocatable)) throw new InvalidOperationException("writer does not provide locations!"); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs index 8ea3797c43..193e798986 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/InsertMissingTokensDecorator.cs +++ b/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) { 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); } @@ -77,6 +82,10 @@ namespace ICSharpCode.NRefactory.CSharp ThisReferenceExpression node = nodes.Peek().LastOrDefault() as ThisReferenceExpression; if (node != null) 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); base.WriteKeyword(role, keyword); diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs index 5f881f2c88..4b9a262c69 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/OutputVisitor/TextWriterOutputFormatter.cs @@ -314,8 +314,10 @@ namespace ICSharpCode.NRefactory.CSharp b.Append("L"); } textWriter.Write(b.ToString()); + column += b.Length; } else { textWriter.Write(value.ToString()); + column += value.ToString().Length; } } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs index feba28b5c8..ea3ed47dec 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory.ConsistencyCheck/Xml/XmlReaderTest.cs @@ -92,9 +92,9 @@ namespace ICSharpCode.NRefactory.ConsistencyCheck.Xml if (val == null) return "null"; else if (val is string) - return "\"" + CSharpOutputVisitor.ConvertString((string)val) + "\""; + return "\"" + TextWriterTokenWriter.ConvertString((string)val) + "\""; else if (val is char) - return "'" + CSharpOutputVisitor.ConvertChar((char)val) + "'"; + return "'" + TextWriterTokenWriter.ConvertChar((char)val) + "'"; else return val.ToString(); } diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs b/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs index a7344b9c76..145b680464 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/ConsistencyChecker.cs +++ b/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) { + if (whitespaceStart == whitespaceEnd || startNode == endNode) + return; Assert.Greater(whitespaceStart.Line, 0); Assert.Greater(whitespaceStart.Column, 0); Assert.Greater(whitespaceEnd.Line, 0); Assert.Greater(whitespaceEnd.Column, 0); - if (whitespaceStart == whitespaceEnd || startNode == endNode) - return; + Assert.IsTrue(whitespaceEnd >= whitespaceStart, endNode.GetType().Name + ".StartLocation < " + startNode.GetType().Name + ".EndLocation: " + whitespaceEnd + " < " + whitespaceStart); int start = currentDocument.GetOffset(whitespaceStart.Line, whitespaceStart.Column); int end = currentDocument.GetOffset(whitespaceEnd.Line, whitespaceEnd.Column); string text = currentDocument.GetText(start, end - start); diff --git a/src/Libraries/NRefactory/NRefactory.sln b/src/Libraries/NRefactory/NRefactory.sln index 7cf9d71272..9203c88edb 100644 --- a/src/Libraries/NRefactory/NRefactory.sln +++ b/src/Libraries/NRefactory/NRefactory.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 -# SharpDevelop 5.0 +# SharpDevelop 4.3 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC98210E-1646-483B-819A-2BB8272461E4}" ProjectSection(SolutionItems) = preProject Packages\ICSharpCode.NRefactory.nuspec = Packages\ICSharpCode.NRefactory.nuspec @@ -18,8 +18,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Cecil", "..\cecil\Mono EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSharp", "ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj", "{53DCA265-3C3C-42F9-B647-F72BA678122B}" 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}" EndProject 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|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 - {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.Build.0 = Debug|Any CPU {D81206EF-3DCA-4A30-897B-E262A2AD9EE3}.Debug|x86.ActiveCfg = Debug|x86