Browse Source

Merge branch 'newNR' of github.com:icsharpcode/SharpDevelop into newNR

newNRvisualizers
Peter Forstmeier 13 years ago
parent
commit
79f974b049
  1. 2
      src/AddIns/Analysis/UnitTesting/Model/TestResult.cs
  2. 4
      src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs
  3. 11
      src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs
  4. 11
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs
  5. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpMyNamespaceBuilder.cs
  6. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditDisplayBinding.cs
  7. 15
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs
  8. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs
  9. 9
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DiffControl.xaml.cs
  10. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DocumentSequence.cs
  11. 5
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/ContextActionsBulbPopup.cs
  12. 4
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/ContextActionsPopup.cs
  13. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs
  14. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SharpDevelopCompletionWindow.cs
  15. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/CustomizingHighlighter.cs
  16. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/FixedHighlighter.cs
  17. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/SyntaxModeDoozer.cs
  18. 5
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/RemoveXPathHighlightingCommand.cs
  19. 42
      src/AddIns/DisplayBindings/XmlEditor/Test/Completion/ElementCompletionWindowTests.cs
  20. 4
      src/AddIns/DisplayBindings/XmlEditor/Test/Editor/DefaultXmlEditorOptionsTestFixture.cs
  21. 3
      src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs
  22. 32
      src/AddIns/DisplayBindings/XmlEditor/XmlEditor.sln
  23. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs

2
src/AddIns/Analysis/UnitTesting/Model/TestResult.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.UnitTesting
this.name = ParseName(name, out values); this.name = ParseName(name, out values);
} }
string ParseName(string name, out string values) static string ParseName(string name, out string values)
{ {
int i = name.IndexOf('('); int i = name.IndexOf('(');
values = ""; values = "";

4
src/AddIns/Analysis/UnitTesting/NUnit/NUnitConsoleApplication.cs

@ -234,7 +234,7 @@ namespace ICSharpCode.UnitTesting
/// <summary> /// <summary>
/// Checks that the project's PlatformTarget is x32 for the active configuration. /// Checks that the project's PlatformTarget is x32 for the active configuration.
/// </summary> /// </summary>
bool IsPlatformTarget32BitOrAnyCPU(IProject project) static bool IsPlatformTarget32BitOrAnyCPU(IProject project)
{ {
MSBuildBasedProject msbuildProject = project as MSBuildBasedProject; MSBuildBasedProject msbuildProject = project as MSBuildBasedProject;
if (msbuildProject != null) { if (msbuildProject != null) {
@ -245,7 +245,7 @@ namespace ICSharpCode.UnitTesting
return false; return false;
} }
bool ProjectUsesDotnet20Runtime(IProject project) static bool ProjectUsesDotnet20Runtime(IProject project)
{ {
var p = project as ICSharpCode.SharpDevelop.Project.Converter.IUpgradableProject; var p = project as ICSharpCode.SharpDevelop.Project.Converter.IUpgradableProject;
if (p != null && p.CurrentTargetFramework != null) { if (p != null && p.CurrentTargetFramework != null) {

11
src/AddIns/Analysis/UnitTesting/Pad/UnitTestNode.cs

@ -5,9 +5,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Windows;
using ICSharpCode.NRefactory.Utils; using ICSharpCode.NRefactory.Utils;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.TreeView; using ICSharpCode.TreeView;
namespace ICSharpCode.UnitTesting namespace ICSharpCode.UnitTesting
@ -48,6 +48,11 @@ namespace ICSharpCode.UnitTesting
return test; return test;
} }
public override void ActivateItem(RoutedEventArgs e)
{
test.GoToDefinition.Execute(e);
}
#region Manage Children #region Manage Children
public override bool ShowExpander { public override bool ShowExpander {
get { return test.CanExpandNestedTests && base.ShowExpander; } get { return test.CanExpandNestedTests && base.ShowExpander; }
@ -62,8 +67,8 @@ namespace ICSharpCode.UnitTesting
void InsertNestedTests(IEnumerable<ITest> nestedTests) void InsertNestedTests(IEnumerable<ITest> nestedTests)
{ {
foreach (var test in nestedTests) { foreach (var nestedTest in nestedTests) {
var treeNode = SD.TreeNodeFactory.CreateTreeNode(test); var treeNode = SD.TreeNodeFactory.CreateTreeNode(nestedTest);
if (treeNode != null) if (treeNode != null)
Children.OrderedInsert(treeNode, NodeTextComparer); Children.OrderedInsert(treeNode, NodeTextComparer);
} }

11
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Parser/CSharpSymbolSearch.cs

@ -100,8 +100,17 @@ namespace CSharpBinding
ReadOnlyDocument document = null; ReadOnlyDocument document = null;
IHighlighter highlighter = null; IHighlighter highlighter = null;
List<Reference> results = new List<Reference>(); List<Reference> results = new List<Reference>();
// Grab the unresolved file matching the compilation version
// (this may differ from the version created by re-parsing the project)
CSharpUnresolvedFile unresolvedFile = null;
IProjectContent pc = compilation.MainAssembly.UnresolvedAssembly as IProjectContent;
if (pc != null) {
unresolvedFile = pc.GetFile(fileName) as CSharpUnresolvedFile;
}
fr.FindReferencesInFile( fr.FindReferencesInFile(
searchScope, parseInfo.UnresolvedFile, parseInfo.SyntaxTree, compilation, searchScope, unresolvedFile, parseInfo.SyntaxTree, compilation,
delegate (AstNode node, ResolveResult result) { delegate (AstNode node, ResolveResult result) {
if (document == null) { if (document == null) {
document = new ReadOnlyDocument(textSource, fileName); document = new ReadOnlyDocument(textSource, fileName);

2
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpMyNamespaceBuilder.cs

@ -78,7 +78,7 @@ namespace CSharpBinding
output.AppendLine(indentation); output.AppendLine(indentation);
} }
} }
} else if (trimmedLine.StartsWith("#if ")) { } else if (trimmedLine.StartsWith("#if ", StringComparison.Ordinal)) {
outputActive = trimmedLine.Substring(4) == projectType; outputActive = trimmedLine.Substring(4) == projectType;
} else { } else {
output.AppendLine(StringParser.Parse(line.Replace("MyNamespace", ns))); output.AppendLine(StringParser.Parse(line.Replace("MyNamespace", ns)));

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

@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
public double AutoDetectFileContent(FileName fileName, Stream fileContent, string detectedMimeType) public double AutoDetectFileContent(FileName fileName, Stream fileContent, string detectedMimeType)
{ {
return detectedMimeType.StartsWith("text/") ? 0.5 : 0; return detectedMimeType.StartsWith("text/", StringComparison.Ordinal) ? 0.5 : 0;
} }
} }

15
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/ChangeMarkerMargin.cs

@ -2,7 +2,6 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using System.Diagnostics;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
@ -13,7 +12,6 @@ using ICSharpCode.AvalonEdit.Document;
using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
@ -36,7 +34,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
changeWatcher.ChangeOccurred += ChangeOccurred; changeWatcher.ChangeOccurred += ChangeOccurred;
} }
bool disposed = false; bool disposed;
public void Dispose() public void Dispose()
{ {
@ -156,7 +154,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
#region Diffs tooltip #region Diffs tooltip
Popup tooltip = new Popup() { StaysOpen = false }; Popup tooltip = new Popup { StaysOpen = false };
ITextMarker marker; ITextMarker marker;
ITextMarkerService markerService; ITextMarkerService markerService;
MouseHoverLogic hoverLogic; MouseHoverLogic hoverLogic;
@ -230,8 +228,8 @@ namespace ICSharpCode.AvalonEdit.AddIn
differ.editor.Visibility = Visibility.Collapsed; differ.editor.Visibility = Visibility.Collapsed;
differ.copyButton.Visibility = Visibility.Collapsed; differ.copyButton.Visibility = Visibility.Collapsed;
} else { } else {
var baseDocument = new ReadOnlyDocument(changeWatcher.BaseDocument, TextView.Document.FileName);
if (differ.editor.SyntaxHighlighting != null) { if (differ.editor.SyntaxHighlighting != null) {
var baseDocument = new ReadOnlyDocument(changeWatcher.BaseDocument, TextView.Document.FileName);
var mainHighlighter = new DocumentHighlighter(baseDocument, differ.editor.SyntaxHighlighting); var mainHighlighter = new DocumentHighlighter(baseDocument, differ.editor.SyntaxHighlighting);
var popupHighlighter = differ.editor.TextArea.GetService(typeof(IHighlighter)) as DocumentHighlighter; var popupHighlighter = differ.editor.TextArea.GetService(typeof(IHighlighter)) as DocumentHighlighter;
@ -246,10 +244,11 @@ namespace ICSharpCode.AvalonEdit.AddIn
} }
}; };
tooltip.Child = new Border() { const double borderThickness = 1;
tooltip.Child = new Border {
Child = differ, Child = differ,
BorderBrush = editor.TextArea.Foreground, BorderBrush = editor.TextArea.Foreground,
BorderThickness = new Thickness(1) BorderThickness = new Thickness(borderThickness)
}; };
if (tooltip.IsOpen) if (tooltip.IsOpen)
@ -258,7 +257,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
tooltip.Closed += delegate { tooltip.Closed += delegate {
if (marker != null) markerService.Remove(marker); if (marker != null) markerService.Remove(marker);
}; };
tooltip.HorizontalOffset = -10; tooltip.HorizontalOffset = -borderThickness - TextView.ScrollOffset.X;
tooltip.VerticalOffset = tooltip.VerticalOffset =
TextView.GetVisualTopByDocumentLine(startLine) - TextView.ScrollOffset.Y; TextView.GetVisualTopByDocumentLine(startLine) - TextView.ScrollOffset.Y;
tooltip.Placement = PlacementMode.Top; tooltip.Placement = PlacementMode.Top;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DefaultChangeWatcher.cs

@ -191,7 +191,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
{ {
} }
bool disposed = false; bool disposed;
public void Dispose() public void Dispose()
{ {

9
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DiffControl.xaml.cs

@ -2,19 +2,10 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using System.Collections.Generic;
using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.AvalonEdit.AddIn.Options;
using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Rendering;
using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
namespace ICSharpCode.AvalonEdit.AddIn namespace ICSharpCode.AvalonEdit.AddIn

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ChangeMarkerMargin/DocumentSequence.cs

@ -4,7 +4,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Editor;
using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Widgets.MyersDiff; using ICSharpCode.SharpDevelop.Widgets.MyersDiff;
namespace ICSharpCode.AvalonEdit.AddIn namespace ICSharpCode.AvalonEdit.AddIn

5
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/ContextActionsBulbPopup.cs

@ -4,6 +4,8 @@
using System; using System;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor;
using ICSharpCode.SharpDevelop.Widgets; using ICSharpCode.SharpDevelop.Widgets;
@ -16,6 +18,9 @@ namespace ICSharpCode.AvalonEdit.AddIn.ContextActions
{ {
public ContextActionsBulbPopup(UIElement parent) : base(parent) public ContextActionsBulbPopup(UIElement parent) : base(parent)
{ {
this.UseLayoutRounding = true;
TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display);
this.StaysOpen = true; this.StaysOpen = true;
this.AllowsTransparency = true; this.AllowsTransparency = true;
this.ChildControl = new ContextActionsBulbControl(); this.ChildControl = new ContextActionsBulbControl();

4
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/ContextActionsPopup.cs

@ -4,6 +4,7 @@
using System; using System;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop;
@ -19,6 +20,9 @@ namespace ICSharpCode.AvalonEdit.AddIn.ContextActions
{ {
public ContextActionsPopup() public ContextActionsPopup()
{ {
this.UseLayoutRounding = true;
TextOptions.SetTextFormattingMode(this, TextFormattingMode.Display);
// Close on lost focus // Close on lost focus
this.StaysOpen = false; this.StaysOpen = false;
this.AllowsTransparency = true; this.AllowsTransparency = true;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/GoToEntityAction.cs

@ -17,7 +17,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.ContextActions
public static ContextActionViewModel MakeViewModel(IEntity entity, ObservableCollection<ContextActionViewModel> childActions) public static ContextActionViewModel MakeViewModel(IEntity entity, ObservableCollection<ContextActionViewModel> childActions)
{ {
var ambience = AmbienceService.GetCurrentAmbience(); var ambience = AmbienceService.GetCurrentAmbience();
ambience.ConversionFlags = ConversionFlags.ShowTypeParameterList; ambience.ConversionFlags = ConversionFlags.ShowDeclaringType | ConversionFlags.ShowTypeParameterList;
return new ContextActionViewModel { return new ContextActionViewModel {
Action = new GoToEntityAction(entity, ambience.ConvertEntity(entity)), Action = new GoToEntityAction(entity, ambience.ConvertEntity(entity)),
Image = CompletionImage.GetImage(entity), Image = CompletionImage.GetImage(entity),

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

@ -39,7 +39,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
set { set {
// Disable virtualization if we use automatic width - this prevents the window from resizing // Disable virtualization if we use automatic width - this prevents the window from resizing
// when the user scrolls. // when the user scrolls.
VirtualizingStackPanel.SetIsVirtualizing(this.CompletionList.ListBox, !double.IsNaN(value)); VirtualizingPanel.SetIsVirtualizing(this.CompletionList.ListBox, !double.IsNaN(value));
this.Width = value; this.Width = value;
if (double.IsNaN(value)) { if (double.IsNaN(value)) {
// enable size-to-width: // enable size-to-width:

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/CustomizingHighlighter.cs

@ -6,7 +6,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit.Editing; using ICSharpCode.AvalonEdit.Editing;
using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Highlighting;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/FixedHighlighter.cs

@ -51,7 +51,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
/// Moves the section start by <paramref name="delta"/> positions; /// Moves the section start by <paramref name="delta"/> positions;
/// and removes the sections outside the (newLineStart,newLineEnd) range. /// and removes the sections outside the (newLineStart,newLineEnd) range.
/// </summary> /// </summary>
static void MoveSections(IEnumerable<HighlightedSection> sections, int delta, int newLineStart, int newLineEnd, IList<HighlightedSection> result) static void MoveSections(IEnumerable<HighlightedSection> sections, int delta, int newLineStart, int newLineEnd, ICollection<HighlightedSection> result)
{ {
foreach (var section in sections) { foreach (var section in sections) {
int newOffset = section.Offset + delta; int newOffset = section.Offset + delta;

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/SyntaxHighlighting/SyntaxModeDoozer.cs

@ -2,10 +2,8 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System; using System;
using System.Collections;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Xml; using System.Xml;
using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.AvalonEdit.Highlighting;

5
src/AddIns/DisplayBindings/XmlEditor/Project/Src/RemoveXPathHighlightingCommand.cs

@ -32,7 +32,10 @@ namespace ICSharpCode.XmlEditor
public void RemoveXPathNodeTextMarkers() public void RemoveXPathNodeTextMarkers()
{ {
foreach (IViewContent view in workbench.ViewContentCollection) { foreach (IViewContent view in workbench.ViewContentCollection) {
XPathNodeTextMarker.RemoveMarkers(view); ITextEditor textEditor = view.GetService<ITextEditor>();
if (textEditor != null) {
XPathNodeTextMarker.RemoveMarkers(textEditor);
}
} }
} }
} }

42
src/AddIns/DisplayBindings/XmlEditor/Test/Completion/ElementCompletionWindowTests.cs

@ -13,7 +13,6 @@ using XmlEditor.Tests.Utils;
namespace XmlEditor.Tests.Completion namespace XmlEditor.Tests.Completion
{ {
[TestFixture] [TestFixture]
[Ignore("Test needs to be adjusted to SD5")]
public class ElementCompletionWindowTests public class ElementCompletionWindowTests
{ {
MockTextEditor textEditor; MockTextEditor textEditor;
@ -39,29 +38,54 @@ namespace XmlEditor.Tests.Completion
completionBinding = new XmlCodeCompletionBinding(associations); completionBinding = new XmlCodeCompletionBinding(associations);
} }
void CharacterTypedIntoTextEditor(char ch)
{
textEditor.Document.Text += ch.ToString();
textEditor.Caret.Offset++;
}
[Test] [Test]
public void HandleKeyPress_LessThanKeyPressed_KeyPressResultIsCompletedAfterPressingLessThanSign() public void HandleKeyPress_AnyKey_ReturnsNone()
{ {
keyPressResult = completionBinding.HandleKeyPress(textEditor, '<'); keyPressResult = completionBinding.HandleKeyPress(textEditor, 'a');
Assert.AreEqual(CodeCompletionKeyPressResult.EatKey, keyPressResult);
Assert.AreEqual(CodeCompletionKeyPressResult.None, keyPressResult);
} }
[Test] [Test]
public void HandleKeyPress_LessThanKeyPressed_CompletionWindowWidthIsNotSetToMatchLongestNamespaceTextWidth() public void HandleKeyPressed_LessThanKeyPressed_ReturnsTrue()
{ {
completionBinding.HandleKeyPress(textEditor, '<'); CharacterTypedIntoTextEditor('<');
bool result = completionBinding.HandleKeyPressed(textEditor, '<');
Assert.IsTrue(result);
}
[Test]
public void HandleKeyPressed_SpaceCharacterPressed_ReturnsFalse()
{
CharacterTypedIntoTextEditor(' ');
bool result = completionBinding.HandleKeyPressed(textEditor, ' ');
Assert.IsFalse(result);
}
[Test]
public void HandleKeyPressed_LessThanKeyPressed_CompletionWindowWidthIsNotSetToMatchLongestNamespaceTextWidth()
{
CharacterTypedIntoTextEditor('<');
completionBinding.HandleKeyPressed(textEditor, '<');
Assert.AreNotEqual(double.NaN, textEditor.CompletionWindowDisplayed.Width); Assert.AreNotEqual(double.NaN, textEditor.CompletionWindowDisplayed.Width);
} }
[Test] [Test]
public void HandleKeyPress_LessThanKeyPressedInsideRootHtmlElement_BodyElementExistsInChildCompletionItems() public void HandleKeyPressed_LessThanKeyPressedInsideRootHtmlElement_BodyElementExistsInChildCompletionItems()
{ {
textEditor.Document.Text = textEditor.Document.Text =
"<html><\r\n" + "<html><\r\n" +
"</html>"; "</html>";
textEditor.Caret.Offset = 6; textEditor.Caret.Offset = 7;
completionBinding.HandleKeyPress(textEditor, '<'); completionBinding.HandleKeyPressed(textEditor, '<');
ICompletionItem[] items = textEditor.CompletionItemsDisplayedToArray(); ICompletionItem[] items = textEditor.CompletionItemsDisplayedToArray();
XmlCompletionItem expectedItem = new XmlCompletionItem("body", XmlCompletionItemType.XmlElement); XmlCompletionItem expectedItem = new XmlCompletionItem("body", XmlCompletionItemType.XmlElement);

4
src/AddIns/DisplayBindings/XmlEditor/Test/Editor/DefaultXmlEditorOptionsTestFixture.cs

@ -15,7 +15,6 @@ using XmlEditor.Tests.Utils;
namespace XmlEditor.Tests.Editor namespace XmlEditor.Tests.Editor
{ {
[TestFixture] [TestFixture]
[Ignore("Test needs to be adjusted to SD5")]
public class DefaultXmlEditorOptionsTestFixture public class DefaultXmlEditorOptionsTestFixture
{ {
XmlSchemaFileAssociations associations; XmlSchemaFileAssociations associations;
@ -37,7 +36,8 @@ namespace XmlEditor.Tests.Editor
DefaultXmlSchemaFileAssociations CreateDefaultXmlSchemaFileExtensions() DefaultXmlSchemaFileAssociations CreateDefaultXmlSchemaFileExtensions()
{ {
string addinXml = "<AddIn name = 'Xml Editor'\r\n" + string addinXml =
"<AddIn name = 'Xml Editor'\r\n" +
" author = ''\r\n" + " author = ''\r\n" +
" copyright = 'prj:///doc/copyright.txt'\r\n" + " copyright = 'prj:///doc/copyright.txt'\r\n" +
" description = ''\r\n" + " description = ''\r\n" +

3
src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditor.cs

@ -179,6 +179,9 @@ namespace XmlEditor.Tests.Utils
public object GetService(Type serviceType) public object GetService(Type serviceType)
{ {
if (serviceType == typeof(ITextEditor)) {
return this;
}
return document.GetService(serviceType); return document.GetService(serviceType);
} }

32
src/AddIns/DisplayBindings/XmlEditor/XmlEditor.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 4.1.0.7289-alpha # SharpDevelop 4.3
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{DCA2703D-250A-463E-A68A-07ED105AE6BD}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor", "Project\XmlEditor.csproj", "{DCA2703D-250A-463E-A68A-07ED105AE6BD}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor.Tests", "Test\XmlEditor.Tests.csproj", "{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlEditor.Tests", "Test\XmlEditor.Tests.csproj", "{FC0FE702-A87D-4D70-A9B6-1ECCD611125F}"
@ -16,14 +16,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Presentati
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.WinForms", "..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj", "{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.WinForms", "..\..\..\Main\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj", "{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Dom", "..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj", "{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "..\..\..\Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "..\..\..\Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonEdit.AddIn", "..\AvalonEdit.AddIn\AvalonEdit.AddIn.csproj", "{0162E499-42D0-409B-AA25-EED21F75336B}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvalonEdit.AddIn", "..\AvalonEdit.AddIn\AvalonEdit.AddIn.csproj", "{0162E499-42D0-409B-AA25-EED21F75336B}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory", "..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj", "{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.Xml", "..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory.Xml\ICSharpCode.NRefactory.Xml.csproj", "{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSharp", "..\..\..\Libraries\NRefactory\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory.CSharp.csproj", "{53DCA265-3C3C-42F9-B647-F72BA678122B}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -58,14 +60,6 @@ Global
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.Build.0 = Release|Any CPU {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.Build.0 = Release|Any CPU
{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.ActiveCfg = Release|Any CPU {857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}.Release|Any CPU.ActiveCfg = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.Build.0 = Release|Any CPU
{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU
{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.Build.0 = Debug|Any CPU {4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4980B743-B32F-4aba-AABD-45E2CAD3568D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Any CPU.Build.0 = Release|Any CPU {4980B743-B32F-4aba-AABD-45E2CAD3568D}.Release|Any CPU.Build.0 = Release|Any CPU
@ -78,5 +72,17 @@ Global
{0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0162E499-42D0-409B-AA25-EED21F75336B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.Build.0 = Release|Any CPU {0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.Build.0 = Release|Any CPU
{0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.ActiveCfg = Release|Any CPU {0162E499-42D0-409B-AA25-EED21F75336B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|Any CPU.Build.0 = Release|Any CPU
{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|Any CPU.Build.0 = Release|Any CPU
{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Any CPU.Build.0 = Release|Any CPU
{53DCA265-3C3C-42F9-B647-F72BA678122B}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Resolver/FindReferences.cs

@ -381,8 +381,6 @@ namespace ICSharpCode.NRefactory.CSharp.Resolver
{ {
if (searchScopes == null) if (searchScopes == null)
throw new ArgumentNullException("searchScopes"); throw new ArgumentNullException("searchScopes");
if (unresolvedFile == null)
throw new ArgumentNullException("unresolvedFile");
if (syntaxTree == null) if (syntaxTree == null)
throw new ArgumentNullException("syntaxTree"); throw new ArgumentNullException("syntaxTree");
if (compilation == null) if (compilation == null)

Loading…
Cancel
Save