Browse Source

Adjust to NRefactory API changes.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
8b83d74682
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs
  2. 4
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDScript.cs
  3. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextAreaDefaultInputHandlers.cs
  4. 14
      src/Main/SharpDevelop/app.template.config

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDRefactoringContext.cs

@ -20,6 +20,7 @@ namespace CSharpBinding.Refactoring
{ {
public class SDRefactoringContext : RefactoringContext public class SDRefactoringContext : RefactoringContext
{ {
readonly CSharpAstResolver resolver;
readonly ITextEditor editor; readonly ITextEditor editor;
readonly ITextSource textSource; readonly ITextSource textSource;
readonly TextLocation location; readonly TextLocation location;
@ -29,6 +30,7 @@ namespace CSharpBinding.Refactoring
public SDRefactoringContext(ITextSource textSource, CSharpAstResolver resolver, TextLocation location, int selectionStart, int selectionLength, CancellationToken cancellationToken) public SDRefactoringContext(ITextSource textSource, CSharpAstResolver resolver, TextLocation location, int selectionStart, int selectionLength, CancellationToken cancellationToken)
: base(resolver, cancellationToken) : base(resolver, cancellationToken)
{ {
this.resolver = resolver;
this.textSource = textSource; this.textSource = textSource;
this.document = textSource as IDocument; this.document = textSource as IDocument;
this.selectionStart = selectionStart; this.selectionStart = selectionStart;

4
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/SDScript.cs

@ -26,7 +26,7 @@ namespace CSharpBinding.Refactoring
readonly TextSegmentCollection<TextSegment> textSegmentCollection; readonly TextSegmentCollection<TextSegment> textSegmentCollection;
readonly SDRefactoringContext context; readonly SDRefactoringContext context;
public SDScript(ITextEditor editor, SDRefactoringContext context) : base(editor.Document, new CSharpFormattingOptions(), context.TextEditorOptions) public SDScript(ITextEditor editor, SDRefactoringContext context) : base(editor.Document, FormattingOptionsFactory.CreateSharpDevelop(), context.TextEditorOptions)
{ {
this.editor = editor; this.editor = editor;
this.context = context; this.context = context;
@ -49,7 +49,7 @@ namespace CSharpBinding.Refactoring
//var startLocation = editor.Document.GetLocation(offset); //var startLocation = editor.Document.GetLocation(offset);
//var endLocation = editor.Document.GetLocation(offset + length); //var endLocation = editor.Document.GetLocation(offset + length);
//var node = parseInfo.CompilationUnit.GetNodeContaining(startLocation, endLocation); //var node = parseInfo.CompilationUnit.GetNodeContaining(startLocation, endLocation);
var formatter = new AstFormattingVisitor(new CSharpFormattingOptions(), editor.Document, context.TextEditorOptions); var formatter = new AstFormattingVisitor(FormattingOptionsFactory.CreateSharpDevelop(), editor.Document, context.TextEditorOptions);
parseInfo.CompilationUnit.AcceptVisitor(formatter); parseInfo.CompilationUnit.AcceptVisitor(formatter);
var segment = GetSegment(node); var segment = GetSegment(node);
formatter.ApplyChanges(segment.Offset, segment.Length); formatter.ApplyChanges(segment.Offset, segment.Length);

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextAreaDefaultInputHandlers.cs

@ -59,7 +59,7 @@ namespace ICSharpCode.AvalonEdit.Editing
// Work around WPF memory leak: // Work around WPF memory leak:
// KeyBinding retains a reference to whichever UIElement it is used in first. // KeyBinding retains a reference to whichever UIElement it is used in first.
// Using a dummy element for this purpose ensures that we don't leak // Using a dummy element for this purpose ensures that we don't leak
// a real text editor (which a potentially large document). // a real text editor (with a potentially large document).
UIElement dummyElement = new UIElement(); UIElement dummyElement = new UIElement();
dummyElement.InputBindings.AddRange(inputBindings); dummyElement.InputBindings.AddRange(inputBindings);
} }

14
src/Main/SharpDevelop/app.template.config

@ -38,10 +38,6 @@
<assemblyIdentity name="ICSharpCode.SharpDevelop" publicKeyToken="f829da5c02be14ee" culture="neutral"/> <assemblyIdentity name="ICSharpCode.SharpDevelop" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> <bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpDevelop.Dom" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="ICSharpCode.SharpDevelop.Widgets" publicKeyToken="f829da5c02be14ee" culture="neutral"/> <assemblyIdentity name="ICSharpCode.SharpDevelop.Widgets" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> <bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
@ -50,14 +46,10 @@
<assemblyIdentity name="ICSharpCode.AvalonEdit" publicKeyToken="9cc39be672370310" culture="neutral"/> <assemblyIdentity name="ICSharpCode.AvalonEdit" publicKeyToken="9cc39be672370310" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> <bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <!--<dependentAssembly>
<assemblyIdentity name="ICSharpCode.Editor" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="f829da5c02be14ee" culture="neutral"/> <assemblyIdentity name="ICSharpCode.NRefactory" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> <bindingRedirect oldVersion="5.0.0.0-$NREFACTORYVERSION$" newVersion="$NREFACTORYVERSION$"/>
</dependentAssembly> </dependentAssembly> and NR.CSharp etc. -->
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="FormsDesigner" publicKeyToken="f829da5c02be14ee" culture="neutral"/> <assemblyIdentity name="FormsDesigner" publicKeyToken="f829da5c02be14ee" culture="neutral"/>
<bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/> <bindingRedirect oldVersion="5.0.0.0-$INSERTVERSION$" newVersion="$INSERTVERSION$"/>

Loading…
Cancel
Save