From e85d13d875658c45533ad7713a88147c8ce00816 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 18 Jul 2013 19:30:42 +0200 Subject: [PATCH 01/27] remove SplitView functionality from CodeEditor --- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 88 +------------------ .../Project/ICSharpCode.SharpDevelop.addin | 4 - .../Commands/SharpDevelopRoutedCommands.cs | 2 - 3 files changed, 4 insertions(+), 90 deletions(-) diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index 2521a09d71..7bfb0efae6 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -45,9 +45,6 @@ namespace ICSharpCode.AvalonEdit.AddIn QuickClassBrowser quickClassBrowser; readonly CodeEditorView primaryTextEditor; readonly CodeEditorAdapter primaryTextEditorAdapter; - CodeEditorView secondaryTextEditor; - CodeEditorView activeTextEditor; - CodeEditorAdapter secondaryTextEditorAdapter; GridSplitter gridSplitter; readonly IconBarManager iconBarManager; readonly TextMarkerService textMarkerService; @@ -58,14 +55,9 @@ namespace ICSharpCode.AvalonEdit.AddIn get { return primaryTextEditor; } } + [Obsolete()] public CodeEditorView ActiveTextEditor { - get { return activeTextEditor; } - private set { - if (activeTextEditor != value) { - activeTextEditor = value; - HandleCaretPositionChange(); - } - } + get { return primaryTextEditor; } } TextDocument document; @@ -114,8 +106,6 @@ namespace ICSharpCode.AvalonEdit.AddIn this.document.FileName = fileName; primaryTextEditorAdapter.FileNameChanged(); - if (secondaryTextEditorAdapter != null) - secondaryTextEditorAdapter.FileNameChanged(); if (this.errorPainter == null) { this.errorPainter = new ErrorPainter(primaryTextEditorAdapter); @@ -143,12 +133,6 @@ namespace ICSharpCode.AvalonEdit.AddIn primaryTextEditor.TextArea.TextView.LineTransformers.Insert(0, new HighlightingColorizer(highlighter)); primaryTextEditor.UpdateCustomizedHighlighting(); - if (secondaryTextEditor != null) { - secondaryTextEditor.SyntaxHighlighting = highlighting; - secondaryTextEditor.TextArea.TextView.LineTransformers.RemoveAll(t => t is HighlightingColorizer); - secondaryTextEditor.TextArea.TextView.LineTransformers.Insert(0, new HighlightingColorizer(highlighter)); - secondaryTextEditor.UpdateCustomizedHighlighting(); - } // Dispose the old highlighter; necessary to avoid memory leaks as // semantic highlighters might attach to global parser events. if (oldHighlighter != null) { @@ -159,9 +143,6 @@ namespace ICSharpCode.AvalonEdit.AddIn public void Redraw(ISegment segment, DispatcherPriority priority) { primaryTextEditor.TextArea.TextView.Redraw(segment, priority); - if (secondaryTextEditor != null) { - secondaryTextEditor.TextArea.TextView.Redraw(segment, priority); - } } const double minRowHeight = 40; @@ -175,7 +156,6 @@ namespace ICSharpCode.AvalonEdit.AddIn this.FlowDirection = FlowDirection.LeftToRight; // code editing is always left-to-right this.document = new TextDocument(); var documentServiceContainer = document.GetRequiredService(); - this.CommandBindings.Add(new CommandBinding(SharpDevelopRoutedCommands.SplitView, OnSplitView)); textMarkerService = new TextMarkerService(document); documentServiceContainer.AddService(typeof(ITextMarkerService), textMarkerService); @@ -189,7 +169,6 @@ namespace ICSharpCode.AvalonEdit.AddIn primaryTextEditor = CreateTextEditor(); primaryTextEditorAdapter = (CodeEditorAdapter)primaryTextEditor.TextArea.GetService(typeof(ITextEditor)); Debug.Assert(primaryTextEditorAdapter != null); - activeTextEditor = primaryTextEditor; this.ColumnDefinitions.Add(new ColumnDefinition()); this.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); @@ -210,8 +189,6 @@ namespace ICSharpCode.AvalonEdit.AddIn // CustomizableHighlightingColorizer loads the new values automatically, we just need // to force a refresh in AvalonEdit. primaryTextEditor.UpdateCustomizedHighlighting(); - if (secondaryTextEditor != null) - secondaryTextEditor.UpdateCustomizedHighlighting(); foreach (var bookmark in SD.BookmarkManager.GetBookmarks(fileName).OfType()) bookmark.SetMarker(); } @@ -251,7 +228,6 @@ namespace ICSharpCode.AvalonEdit.AddIn codeEditorView.TextArea.MouseRightButtonDown += TextAreaMouseRightButtonDown; codeEditorView.TextArea.ContextMenuOpening += TextAreaContextMenuOpening; codeEditorView.TextArea.TextCopied += textEditor_TextArea_TextCopied; - codeEditorView.GotFocus += textEditor_GotFocus; return codeEditorView; } @@ -275,12 +251,6 @@ namespace ICSharpCode.AvalonEdit.AddIn textEditor.Dispose(); } - void textEditor_GotFocus(object sender, RoutedEventArgs e) - { - Debug.Assert(sender is CodeEditorView); - this.ActiveTextEditor = (CodeEditorView)sender; - } - void TextAreaContextMenuOpening(object sender, ContextMenuEventArgs e) { ITextEditor adapter = GetAdapterFromSender(sender); @@ -376,48 +346,6 @@ namespace ICSharpCode.AvalonEdit.AddIn } } - void OnSplitView(object sender, ExecutedRoutedEventArgs e) - { - if (secondaryTextEditor == null) { - // create secondary editor - this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star), MinHeight = minRowHeight }); - secondaryTextEditor = CreateTextEditor(); - secondaryTextEditorAdapter = (CodeEditorAdapter)secondaryTextEditor.TextArea.GetService(typeof(ITextEditor)); - Debug.Assert(primaryTextEditorAdapter != null); - - secondaryTextEditor.SetBinding(TextEditor.IsReadOnlyProperty, - new Binding(TextEditor.IsReadOnlyProperty.Name) { Source = primaryTextEditor }); - secondaryTextEditor.SyntaxHighlighting = primaryTextEditor.SyntaxHighlighting; - secondaryTextEditor.UpdateCustomizedHighlighting(); - - gridSplitter = new GridSplitter { - Height = 4, - HorizontalAlignment = HorizontalAlignment.Stretch, - VerticalAlignment = VerticalAlignment.Top - }; - SetRow(gridSplitter, 2); - this.Children.Add(gridSplitter); - - secondaryTextEditor.Margin = new Thickness(0, 4, 0, 0); - SetRow(secondaryTextEditor, 2); - this.Children.Add(secondaryTextEditor); - - secondaryTextEditorAdapter.FileNameChanged(); - FetchParseInformation(); - } else { - // remove secondary editor - this.Children.Remove(secondaryTextEditor); - this.Children.Remove(gridSplitter); - secondaryTextEditorAdapter.DetachExtensions(); - DisposeTextEditor(secondaryTextEditor); - secondaryTextEditor = null; - secondaryTextEditorAdapter = null; - gridSplitter = null; - this.RowDefinitions.RemoveAt(this.RowDefinitions.Count - 1); - this.ActiveTextEditor = primaryTextEditor; - } - } - public event EventHandler CaretPositionChanged; void TextAreaCaretPositionChanged(object sender, EventArgs e) @@ -454,15 +382,13 @@ namespace ICSharpCode.AvalonEdit.AddIn SharpDevelopCompletionWindow CompletionWindow { get { - return primaryTextEditor.ActiveCompletionWindow - ?? (secondaryTextEditor == null ? null : secondaryTextEditor.ActiveCompletionWindow); + return primaryTextEditor.ActiveCompletionWindow; } } SharpDevelopInsightWindow InsightWindow { get { - return primaryTextEditor.ActiveInsightWindow - ?? (secondaryTextEditor == null ? null : secondaryTextEditor.ActiveInsightWindow); + return primaryTextEditor.ActiveInsightWindow; } } @@ -635,8 +561,6 @@ namespace ICSharpCode.AvalonEdit.AddIn } iconBarManager.UpdateClassMemberBookmarks(parseInfo != null ? parseInfo.UnresolvedFile : null, document); primaryTextEditor.UpdateParseInformationForFolding(parseInfo); - if (secondaryTextEditor != null) - secondaryTextEditor.UpdateParseInformationForFolding(parseInfo); } public void Dispose() @@ -647,8 +571,6 @@ namespace ICSharpCode.AvalonEdit.AddIn if (primaryTextEditorAdapter.Language != null) primaryTextEditorAdapter.DetachExtensions(); - if (secondaryTextEditorAdapter != null && secondaryTextEditorAdapter.Language != null) - secondaryTextEditorAdapter.DetachExtensions(); if (errorPainter != null) errorPainter.Dispose(); @@ -656,8 +578,6 @@ namespace ICSharpCode.AvalonEdit.AddIn changeWatcher.Dispose(); this.Document = null; DisposeTextEditor(primaryTextEditor); - if (secondaryTextEditor != null) - DisposeTextEditor(secondaryTextEditor); } } } diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin index 984f5175ad..a661ed0eb6 100755 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin @@ -1905,10 +1905,6 @@ shortcut = "Shift|Control|Tab" class = "ICSharpCode.SharpDevelop.Commands.SelectPrevWindow" /> - public static class SharpDevelopRoutedCommands { - public static readonly RoutedCommand SplitView = new RoutedCommand( - "SplitView", typeof(SharpDevelopRoutedCommands)); } } From c5e1591de072a1b572dd62b5569b0fc41f964389 Mon Sep 17 00:00:00 2001 From: Tobias Ibounig Date: Fri, 28 Jun 2013 19:32:05 +0200 Subject: [PATCH 02/27] Changed the 'view mode' selector in HexEditContainer.cs to a DropDownList, to make the Text unchangeable. --- .../Project/Src/View/HexEditContainer.Designer.cs | 7 ++++--- .../HexEditor/Project/Src/View/HexEditContainer.cs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.Designer.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.Designer.cs index 01873c638d..9f6d60d5ef 100644 --- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.Designer.cs +++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.Designer.cs @@ -36,7 +36,7 @@ namespace HexEditor.View System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HexEditContainer)); this.tbSizeToFit = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.tCBViewMode = new System.Windows.Forms.DomainUpDown(); + this.tCBViewMode = new System.Windows.Forms.ToolStripComboBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.tSTBCharsPerLine = new System.Windows.Forms.NumericUpDown(); this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar(); @@ -69,7 +69,8 @@ namespace HexEditor.View "Decimal"}); this.tCBViewMode.Name = "tCBViewMode"; this.tCBViewMode.Size = new System.Drawing.Size(121, 25); - this.tCBViewMode.SelectedItemChanged += new System.EventHandler(this.TCBViewModeSelectedIndexChanged); + this.tCBViewMode.SelectedIndexChanged += new System.EventHandler(this.TCBViewModeSelectedIndexChanged); + this.tCBViewMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; // // toolStrip1 // @@ -129,7 +130,7 @@ namespace HexEditor.View } private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar1; internal HexEditor.Editor hexEditControl; - private System.Windows.Forms.DomainUpDown tCBViewMode; + private System.Windows.Forms.ToolStripComboBox tCBViewMode; private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripButton tbSizeToFit; private System.Windows.Forms.ToolStrip toolStrip1; diff --git a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.cs b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.cs index a7ab920c49..146ab87868 100644 --- a/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.cs +++ b/src/AddIns/DisplayBindings/HexEditor/Project/Src/View/HexEditContainer.cs @@ -51,8 +51,7 @@ namespace HexEditor.View ToolStripControlHost bytesPerLine = new ToolStripControlHost(tSTBCharsPerLine); this.toolStrip1.Items.Insert(1, bytesPerLine); - ToolStripControlHost viewMode = new ToolStripControlHost(tCBViewMode); - this.toolStrip1.Items.Insert(3, viewMode); + this.toolStrip1.Items.Insert(3, tCBViewMode); hexEditControl.BytesPerLine = Settings.BytesPerLine; tSTBCharsPerLine.Text = hexEditControl.BytesPerLine.ToString(); From 60b89bb14e58a6173b0ac0b690cd7195abf05ffe Mon Sep 17 00:00:00 2001 From: Tobias Ibounig Date: Fri, 28 Jun 2013 23:27:57 +0200 Subject: [PATCH 03/27] Changed behavior for 'Key.Space' in SharpTreeView.cs instead of 'double click', now it sets 'IsChecked'. Change can be observed in 'Search for issues' --- .../ICSharpCode.TreeView/SharpTreeView.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs b/src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs index 9b3f1a76f9..5e1f073eea 100644 --- a/src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs +++ b/src/Libraries/SharpTreeView/ICSharpCode.TreeView/SharpTreeView.cs @@ -239,11 +239,20 @@ namespace ICSharpCode.TreeView } break; case Key.Return: - case Key.Space: if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node) { container.Node.ActivateItem(e); } break; + case Key.Space: + if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node) { + if(container.Node.IsCheckable) { + if(container.Node.IsChecked == null) // If partially selected, we want to select everything + container.Node.IsChecked = true; + else + container.Node.IsChecked = !container.Node.IsChecked; + } + } + break; case Key.Add: if (container != null && ItemsControl.ItemsControlFromItemContainer(container) == this) { container.Node.IsExpanded = true; From 4fcb17dd971ec06eb5bfb70439d82b9d10116278 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 18 Jul 2013 21:43:43 +0200 Subject: [PATCH 04/27] move IEditable implementation to CodeEditor --- .../Src/ScriptingTextEditorViewContent.cs | 4 ++-- .../Src/AvalonEditViewContent.cs | 18 +---------------- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 20 +++++++++++++++++-- .../WpfDesign.AddIn/Src/WpfDisplayBinding.cs | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs index 64007d5cde..8774549594 100644 --- a/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs +++ b/src/AddIns/BackendBindings/Scripting/Project/Src/ScriptingTextEditorViewContent.cs @@ -29,8 +29,8 @@ namespace ICSharpCode.Scripting void Init(IViewContent view) { this.view = view; - editable = view as IEditable; - textEditor = view.GetService(typeof(ITextEditor)) as ITextEditor; + editable = view.GetService(); + textEditor = view.GetService(); textEditorOptions = textEditor.Options; } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs index 52e1a449ae..1f6f81afa6 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs @@ -32,7 +32,7 @@ namespace ICSharpCode.AvalonEdit.AddIn } public class AvalonEditViewContent - : AbstractViewContent, IEditable, IMementoCapable, ICodeEditorProvider, IPositionable, IToolsHost + : AbstractViewContent, IMementoCapable, ICodeEditorProvider, IPositionable, IToolsHost { readonly CodeEditor codeEditor = new CodeEditor(); IAnalyticsMonitorTrackedFeature trackedFeature; @@ -294,22 +294,6 @@ namespace ICSharpCode.AvalonEdit.AddIn return "[" + GetType().Name + " " + this.PrimaryFileName + "]"; } - #region IEditable - public ITextSource CreateSnapshot() - { - return codeEditor.Document.CreateSnapshot(); - } - - /// - /// Gets the document text. - /// - public string Text { - get { - return codeEditor.Document.Text; - } - } - #endregion - #region IMementoCapable public Properties CreateMemento() { diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index 7bfb0efae6..230f4a18b0 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -38,14 +38,13 @@ namespace ICSharpCode.AvalonEdit.AddIn /// Also provides support for Split-View (showing two AvalonEdit instances using the same TextDocument) /// [TextEditorService, ViewContentService] - public class CodeEditor : Grid, IDisposable + public class CodeEditor : Grid, IDisposable, ICSharpCode.SharpDevelop.Gui.IEditable { const string contextMenuPath = "/SharpDevelop/ViewContent/AvalonEdit/ContextMenu"; QuickClassBrowser quickClassBrowser; readonly CodeEditorView primaryTextEditor; readonly CodeEditorAdapter primaryTextEditorAdapter; - GridSplitter gridSplitter; readonly IconBarManager iconBarManager; readonly TextMarkerService textMarkerService; readonly IChangeWatcher changeWatcher; @@ -205,6 +204,7 @@ namespace ICSharpCode.AvalonEdit.AddIn TextView textView = codeEditorView.TextArea.TextView; textView.Services.AddService(typeof(ITextEditor), adapter); textView.Services.AddService(typeof(CodeEditor), this); + textView.Services.AddService(typeof(ICSharpCode.SharpDevelop.Gui.IEditable), this); codeEditorView.TextArea.TextEntering += TextAreaTextEntering; codeEditorView.TextArea.TextEntered += TextAreaTextEntered; @@ -392,6 +392,22 @@ namespace ICSharpCode.AvalonEdit.AddIn } } + #region IEditable + public ITextSource CreateSnapshot() + { + return this.Document.CreateSnapshot(); + } + + /// + /// Gets the document text. + /// + public string Text { + get { + return this.Document.Text; + } + } + #endregion + void TextAreaTextEntering(object sender, TextCompositionEventArgs e) { // don't start new code completion if there is still a completion window open diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfDisplayBinding.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfDisplayBinding.cs index 93ac02c450..b86bf70870 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfDisplayBinding.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfDisplayBinding.cs @@ -45,7 +45,7 @@ namespace ICSharpCode.WpfDesign.AddIn public bool CanAttachTo(IViewContent content) { if (Path.GetExtension(content.PrimaryFileName).Equals(".xaml", StringComparison.OrdinalIgnoreCase)) { - IEditable editable = content as IEditable; + IEditable editable = content.GetService(); if (editable != null) { try { XmlTextReader r = new XmlTextReader(editable.CreateSnapshot().CreateReader()); From 39c21820733e70c6d702b3c01249ddae4ffbf407 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 18 Jul 2013 21:56:56 +0200 Subject: [PATCH 05/27] move IFileDocumentProvider implementation to CodeEditor --- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index 230f4a18b0..aff804a564 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -38,7 +38,8 @@ namespace ICSharpCode.AvalonEdit.AddIn /// Also provides support for Split-View (showing two AvalonEdit instances using the same TextDocument) /// [TextEditorService, ViewContentService] - public class CodeEditor : Grid, IDisposable, ICSharpCode.SharpDevelop.Gui.IEditable + public class CodeEditor + : Grid, IDisposable, ICSharpCode.SharpDevelop.Gui.IEditable, IFileDocumentProvider { const string contextMenuPath = "/SharpDevelop/ViewContent/AvalonEdit/ContextMenu"; @@ -205,6 +206,7 @@ namespace ICSharpCode.AvalonEdit.AddIn textView.Services.AddService(typeof(ITextEditor), adapter); textView.Services.AddService(typeof(CodeEditor), this); textView.Services.AddService(typeof(ICSharpCode.SharpDevelop.Gui.IEditable), this); + textView.Services.AddService(typeof(IFileDocumentProvider), this); codeEditorView.TextArea.TextEntering += TextAreaTextEntering; codeEditorView.TextArea.TextEntered += TextAreaTextEntered; @@ -408,6 +410,16 @@ namespace ICSharpCode.AvalonEdit.AddIn } #endregion + #region IFileDocumentProvider + public IDocument GetDocumentForFile(ICSharpCode.SharpDevelop.Workbench.OpenedFile file) + { + if (file.FileName == this.FileName) + return this.Document; + else + return null; + } + #endregion + void TextAreaTextEntering(object sender, TextCompositionEventArgs e) { // don't start new code completion if there is still a completion window open From 8e6cc20f760815fbdba8119820da810223be1ad3 Mon Sep 17 00:00:00 2001 From: Tobias Ibounig Date: Thu, 18 Jul 2013 20:39:46 +0200 Subject: [PATCH 06/27] Added back snippet completion. Not yet context-aware. --- .../Completion/CSharpCompletionDataFactory.cs | 6 +- .../CodeCompletion/SnippetCompletionData.cs | 110 ++++++++++++++++++ .../Project/ICSharpCode.SharpDevelop.csproj | 1 + 3 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 src/Main/Base/Project/Editor/CodeCompletion/SnippetCompletionData.cs diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs index e810b5b456..8d25706d93 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Completion/CSharpCompletionDataFactory.cs @@ -11,10 +11,9 @@ using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Completion; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.Completion; -using ICSharpCode.NRefactory.CSharp.TypeSystem; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Editor; +using ICSharpCode.SharpDevelop.Editor.CodeCompletion; namespace CSharpBinding.Completion { @@ -127,7 +126,8 @@ namespace CSharpBinding.Completion IEnumerable ICompletionDataFactory.CreateCodeTemplateCompletionData() { - yield break; + return completionContext.Editor.GetSnippets().OfType() + .Select(snippet => new SnippetCompletionData(snippet)); } IEnumerable ICompletionDataFactory.CreatePreProcessorDefinesCompletionData() diff --git a/src/Main/Base/Project/Editor/CodeCompletion/SnippetCompletionData.cs b/src/Main/Base/Project/Editor/CodeCompletion/SnippetCompletionData.cs new file mode 100644 index 0000000000..97758c305e --- /dev/null +++ b/src/Main/Base/Project/Editor/CodeCompletion/SnippetCompletionData.cs @@ -0,0 +1,110 @@ +// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) +// This code is distributed under the GNU LGPL (for details please see \doc\license.txt) + +using System; +using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.Completion; +using ICSharpCode.SharpDevelop.Editor.CodeCompletion; + +namespace ICSharpCode.SharpDevelop.Editor.CodeCompletion +{ + /// + /// Code completion data for snippets. + /// + public class SnippetCompletionData : IFancyCompletionItem, ISnippetCompletionItem, ICompletionData, ICompletionItem + { + #region ICompletionData implementation + + void ICompletionData.AddOverload(ICompletionData data) { } + + CompletionCategory category; + CompletionCategory ICompletionData.CompletionCategory { + get { return category; } + set { category = value; } + } + + string ICompletionData.DisplayText { + get { return snippet.Text; } + set { } + } + + string ICompletionData.Description { + get { return snippet.Description; } + set { } + } + + string ICompletionData.CompletionText { + get { return snippet.Text; } + set { } + } + + DisplayFlags displayFlags; + DisplayFlags ICompletionData.DisplayFlags { + get { return displayFlags; } + set { displayFlags = value; } + } + + bool ICompletionData.HasOverloads { + get { return false; } + } + + System.Collections.Generic.IEnumerable ICompletionData.OverloadedData { + get { return EmptyList.Instance; } + } + + #endregion + + ISnippetCompletionItem snippet; + + public SnippetCompletionData(ISnippetCompletionItem completionItem) + { + snippet = completionItem; + } + + #region ISnippetCompletionItem implementation + + public string Keyword { + get { return snippet.Keyword; } + } + + #endregion + + #region ICompletionItem implementation + + public void Complete(CompletionContext context) + { + snippet.Complete(context); + } + + public string Text { + get { return snippet.Text; } + } + + string ICompletionItem.Description { + get { return snippet.Description; } + } + + public ICSharpCode.SharpDevelop.IImage Image { + get { return snippet.Image; } + } + + public double Priority { + get { return snippet.Priority; } + } + + #endregion + + #region IFancyCompletionItem implementation + + public object Content { + get { return snippet.Text; } + } + + public object Description { + get { return snippet.Description; } + } + + #endregion + + } +} diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj index e859ed1fc5..c787f8550f 100644 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj @@ -126,6 +126,7 @@ + From d64e3f2657d98ff27f1469d51faee8e736b7287b Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 18 Jul 2013 22:25:59 +0200 Subject: [PATCH 07/27] remove interfaces: - ITextEditorProvider - ICodeEditorProvider move implementation of IPositionable to CodeEditor --- .../Test/Utils/MockEditableViewContent.cs | 11 +--- .../Test/Utils/MockTextEditorViewContent.cs | 11 +--- .../Project/Src/Gui/WixDialogDesigner.cs | 10 +--- .../Gui/WixDialogDesignerDisplayBinding.cs | 3 +- .../Test/Utils/MockTextEditorViewContent.cs | 9 +++- .../Src/AvalonEditViewContent.cs | 52 +++---------------- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 25 ++++++++- .../ViewContent/DecompiledViewContent.cs | 22 ++------ .../MockTextEditorProviderViewContent.cs | 11 +--- ...moveXPathHighlightingCommandTestFixture.cs | 6 --- src/Main/Base/Project/Editor/ITextEditor.cs | 9 ---- .../Src/Gui/Pads/AbstractConsolePad.cs | 2 +- .../SharpDevelop/Workbench/FileService.cs | 6 +-- 13 files changed, 50 insertions(+), 127 deletions(-) diff --git a/src/AddIns/BackendBindings/Scripting/Test/Utils/MockEditableViewContent.cs b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockEditableViewContent.cs index ecbf9e86d5..18727f639f 100644 --- a/src/AddIns/BackendBindings/Scripting/Test/Utils/MockEditableViewContent.cs +++ b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockEditableViewContent.cs @@ -12,7 +12,7 @@ namespace ICSharpCode.Scripting.Tests.Utils /// /// Mock implementation of the IEditable and IViewContent. /// - public class MockEditableViewContent : MockViewContent, IEditable, ITextEditorProvider + public class MockEditableViewContent : MockViewContent, IEditable { public MockTextEditor MockTextEditor = new MockTextEditor(); @@ -37,15 +37,6 @@ namespace ICSharpCode.Scripting.Tests.Utils set { MockTextEditor.MockTextEditorOptions = value; } } - public ITextEditor TextEditor { - get { return MockTextEditor; } - } - - public IDocument GetDocumentForFile(OpenedFile file) - { - throw new NotImplementedException(); - } - public override object GetService(Type serviceType) { if (serviceType == typeof(ITextEditor)) { diff --git a/src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditorViewContent.cs b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditorViewContent.cs index 27f16959c0..018bc4da78 100644 --- a/src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditorViewContent.cs +++ b/src/AddIns/BackendBindings/Scripting/Test/Utils/MockTextEditorViewContent.cs @@ -13,7 +13,7 @@ namespace ICSharpCode.Scripting.Tests.Utils /// A mock IViewContent implementation that also implements the /// ITextEditorControlProvider interface. /// - public class MockTextEditorViewContent : MockViewContent, ITextEditorProvider + public class MockTextEditorViewContent : MockViewContent { ITextEditor textEditor; @@ -21,14 +21,5 @@ namespace ICSharpCode.Scripting.Tests.Utils { textEditor = new AvalonEditTextEditorAdapter(new TextEditor()); } - - public ITextEditor TextEditor { - get { return textEditor; } - } - - public IDocument GetDocumentForFile(OpenedFile file) - { - throw new NotImplementedException(); - } } } diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs index c1509e44be..efd6148cc7 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesigner.cs @@ -83,7 +83,7 @@ namespace ICSharpCode.WixBinding // and text selection operations done by the WiX designer actually // become visible in the text editor. if (!this.SourceCodeStorage.ContainsFile(file)) { - ITextEditor editor = ((ITextEditorProvider)this.PrimaryViewContent).TextEditor; + ITextEditor editor = this.PrimaryViewContent.GetService(); this.SourceCodeStorage.AddFile(file, editor.Document, SD.FileService.DefaultFileEncoding, true); } @@ -224,13 +224,7 @@ namespace ICSharpCode.WixBinding /// Gets the active text area control. /// ITextEditor ActiveTextEditor { - get { - ITextEditorProvider provider = this.PrimaryViewContent as ITextEditorProvider; - if (provider != null) { - return provider.TextEditor; - } - return null; - } + get { return PrimaryViewContent.GetService(); } } void AddToErrorList(XmlException ex) diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerDisplayBinding.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerDisplayBinding.cs index 7b26d28b22..413f4ebfb8 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerDisplayBinding.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/Gui/WixDialogDesignerDisplayBinding.cs @@ -37,8 +37,7 @@ namespace ICSharpCode.WixBinding bool IsViewTextEditorProvider(IViewContent view) { - ITextEditorProvider textEditorProvider = view as ITextEditorProvider; - return textEditorProvider != null; + return view.GetService() != null; } } } diff --git a/src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditorViewContent.cs b/src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditorViewContent.cs index 5d7b5545ba..ecbeccbcab 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditorViewContent.cs +++ b/src/AddIns/BackendBindings/WixBinding/Test/Utils/MockTextEditorViewContent.cs @@ -11,13 +11,18 @@ namespace WixBinding.Tests.Utils /// /// Mock IViewContent class that implements the ITextEditorProvider interface. /// - public class MockTextEditorViewContent : MockViewContent, ITextEditorProvider + public class MockTextEditorViewContent : MockViewContent { public MockTextEditorViewContent() { } - public ITextEditor TextEditor { get; set; } + ITextEditor textEditor; + + public ITextEditor TextEditor { + get { return textEditor ?? new MockTextEditor(); } + set { textEditor = value; } + } public IDocument GetDocumentForFile(OpenedFile file) { diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs index 1f6f81afa6..f38a5168a3 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs @@ -24,15 +24,8 @@ using ICSharpCode.SharpDevelop.Workbench; namespace ICSharpCode.AvalonEdit.AddIn { - [ViewContentService] - public interface ICodeEditorProvider : ITextEditorProvider - { - [Obsolete("Use viewContent.GetService() instead.")] - CodeEditor CodeEditor { get; } - } - public class AvalonEditViewContent - : AbstractViewContent, IMementoCapable, ICodeEditorProvider, IPositionable, IToolsHost + : AbstractViewContent, IMementoCapable, IToolsHost { readonly CodeEditor codeEditor = new CodeEditor(); IAnalyticsMonitorTrackedFeature trackedFeature; @@ -97,10 +90,6 @@ namespace ICSharpCode.AvalonEdit.AddIn TextEditorSideBar.Instance.PutInClipboardRing(e.Text); } - public CodeEditor CodeEditor { - get { return codeEditor; } - } - public override object Control { get { return codeEditor; } } @@ -194,17 +183,17 @@ namespace ICSharpCode.AvalonEdit.AddIn public override INavigationPoint BuildNavPoint() { - int lineNumber = this.Line; + int lineNumber = codeEditor.Line; string txt = codeEditor.Document.GetText(codeEditor.Document.GetLineByNumber(lineNumber)); - return new TextNavigationPoint(this.PrimaryFileName, lineNumber, this.Column, txt); + return new TextNavigationPoint(this.PrimaryFileName, lineNumber, codeEditor.Column, txt); } void CaretChanged(object sender, EventArgs e) { NavigationService.Log(this.BuildNavPoint()); var document = codeEditor.Document; - int lineOffset = document.GetLineByNumber(this.Line).Offset; - int chOffset = this.Column; + int lineOffset = document.GetLineByNumber(codeEditor.Line).Offset; + int chOffset = codeEditor.Column; int col = 1; for (int i = 1; i < chOffset; i++) { if (document.GetCharAt(lineOffset + i - 1) == '\t') @@ -212,7 +201,7 @@ namespace ICSharpCode.AvalonEdit.AddIn else col += 1; } - SD.StatusBar.SetCaretPosition(col, this.Line, chOffset); + SD.StatusBar.SetCaretPosition(col, codeEditor.Line, chOffset); } public override bool IsReadOnly { @@ -314,35 +303,6 @@ namespace ICSharpCode.AvalonEdit.AddIn } #endregion - #region ITextEditorProvider - public ITextEditor TextEditor { - get { return codeEditor.ActiveTextEditorAdapter; } - } - - public IDocument GetDocumentForFile(OpenedFile file) - { - if (file == this.PrimaryFile) - return codeEditor.Document; - else - return null; - } - #endregion - - #region IPositionable - public int Line { - get { return this.TextEditor.Caret.Line; } - } - - public int Column { - get { return this.TextEditor.Caret.Column; } - } - - public void JumpTo(int line, int column) - { - codeEditor.ActiveTextEditor.JumpTo(line, column); - } - #endregion - object IToolsHost.ToolsContent { get { return TextEditorSideBar.Instance; } } diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index aff804a564..e19dfd589d 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -39,7 +39,7 @@ namespace ICSharpCode.AvalonEdit.AddIn /// [TextEditorService, ViewContentService] public class CodeEditor - : Grid, IDisposable, ICSharpCode.SharpDevelop.Gui.IEditable, IFileDocumentProvider + : Grid, IDisposable, ICSharpCode.SharpDevelop.Gui.IEditable, IFileDocumentProvider, ICSharpCode.SharpDevelop.Gui.IPositionable, IServiceProvider { const string contextMenuPath = "/SharpDevelop/ViewContent/AvalonEdit/ContextMenu"; @@ -206,6 +206,7 @@ namespace ICSharpCode.AvalonEdit.AddIn textView.Services.AddService(typeof(ITextEditor), adapter); textView.Services.AddService(typeof(CodeEditor), this); textView.Services.AddService(typeof(ICSharpCode.SharpDevelop.Gui.IEditable), this); + textView.Services.AddService(typeof(ICSharpCode.SharpDevelop.Gui.IPositionable), this); textView.Services.AddService(typeof(IFileDocumentProvider), this); codeEditorView.TextArea.TextEntering += TextAreaTextEntering; @@ -420,6 +421,28 @@ namespace ICSharpCode.AvalonEdit.AddIn } #endregion + #region IPositionable + public int Line { + get { return this.PrimaryTextEditor.Adapter.Caret.Line; } + } + + public int Column { + get { return this.PrimaryTextEditor.Adapter.Caret.Column; } + } + + public void JumpTo(int line, int column) + { + this.PrimaryTextEditor.JumpTo(line, column); + } + #endregion + + #region IServiceProvider implementation + public object GetService(Type serviceType) + { + return this.primaryTextEditor.Adapter.GetService(serviceType); + } + #endregion + void TextAreaTextEntering(object sender, TextCompositionEventArgs e) { // don't start new code completion if there is still a completion window open diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs index 287d0e57e6..2bf470d387 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs @@ -30,7 +30,7 @@ namespace ICSharpCode.ILSpyAddIn /// /// Hosts a decompiled type. /// - class DecompiledViewContent : AbstractViewContentWithoutFile, IPositionable + class DecompiledViewContent : AbstractViewContentWithoutFile { readonly FileName assemblyFile; readonly string fullTypeName; @@ -58,8 +58,7 @@ namespace ICSharpCode.ILSpyAddIn { this.VirtualFileName = FileName.Create("ilspy://" + assemblyFile + "/" + fullTypeName + ".cs"); - this.Services = codeEditor.PrimaryTextEditor.GetRequiredService(); - this.Services.AddService(typeof(IPositionable), this); + this.Services = codeEditor.GetRequiredService(); this.assemblyFile = assemblyFile; this.fullTypeName = fullTypeName; @@ -188,7 +187,7 @@ namespace ICSharpCode.ILSpyAddIn } TextLocation location; if (entityIdString != null && memberLocations != null && memberLocations.TryGetValue(entityIdString, out location)) - this.JumpTo(location.Line, location.Column); + codeEditor.JumpTo(location.Line, location.Column); } #endregion @@ -299,21 +298,6 @@ namespace ICSharpCode.ILSpyAddIn } #endregion - #region IPositionable - public int Line { - get { return codeEditor.ActiveTextEditorAdapter.Caret.Line; } - } - - public int Column { - get { return codeEditor.ActiveTextEditorAdapter.Caret.Column; } - } - - public void JumpTo(int line, int column) - { - codeEditor.ActiveTextEditor.JumpTo(line, column); - } - #endregion - #region Events public event EventHandler DecompilationFinished; diff --git a/src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditorProviderViewContent.cs b/src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditorProviderViewContent.cs index f4a134fdc6..ecb291106f 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditorProviderViewContent.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Test/Utils/MockTextEditorProviderViewContent.cs @@ -9,23 +9,14 @@ using ICSharpCode.SharpDevelop.Workbench; namespace XmlEditor.Tests.Utils { - public class MockTextEditorProviderViewContent : MockViewContent, ITextEditorProvider + public class MockTextEditorProviderViewContent : MockViewContent { MockTextEditor textEditor = new MockTextEditor(); - public ITextEditor TextEditor { - get { return textEditor; } - } - public MockTextEditor MockTextEditor { get { return textEditor; } } - public IDocument GetDocumentForFile(OpenedFile file) - { - throw new NotImplementedException(); - } - public override object GetService(Type serviceType) { return textEditor.GetService(serviceType); diff --git a/src/AddIns/DisplayBindings/XmlEditor/Test/XPath/RemoveXPathHighlightingCommandTestFixture.cs b/src/AddIns/DisplayBindings/XmlEditor/Test/XPath/RemoveXPathHighlightingCommandTestFixture.cs index 210f894d70..326a48b80f 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Test/XPath/RemoveXPathHighlightingCommandTestFixture.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Test/XPath/RemoveXPathHighlightingCommandTestFixture.cs @@ -69,11 +69,5 @@ namespace XmlEditor.Tests.XPath { Assert.IsTrue(markerService.TextMarkers.Count() > 0); } - - [Test] - public void MockViewContentDoesNotImplementITextEditorProviderInterface() - { - Assert.IsNull(nonTextEditorProviderView as ITextEditorProvider); - } } } diff --git a/src/Main/Base/Project/Editor/ITextEditor.cs b/src/Main/Base/Project/Editor/ITextEditor.cs index 583a956265..4e696e31ef 100644 --- a/src/Main/Base/Project/Editor/ITextEditor.cs +++ b/src/Main/Base/Project/Editor/ITextEditor.cs @@ -13,15 +13,6 @@ using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.SharpDevelop.Editor { - [ViewContentService] - public interface ITextEditorProvider : IFileDocumentProvider - { - [Obsolete("Use viewContent.GetService() instead.")] - ITextEditor TextEditor { - get; - } - } - /// /// Interface for text editors. /// diff --git a/src/Main/Base/Project/Src/Gui/Pads/AbstractConsolePad.cs b/src/Main/Base/Project/Src/Gui/Pads/AbstractConsolePad.cs index 80adaf7a2b..af9b408298 100755 --- a/src/Main/Base/Project/Src/Gui/Pads/AbstractConsolePad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/AbstractConsolePad.cs @@ -24,7 +24,7 @@ using ICSharpCode.SharpDevelop.Workbench; namespace ICSharpCode.SharpDevelop.Gui { - public abstract class AbstractConsolePad : AbstractPadContent, IEditable, IPositionable, ITextEditorProvider, IToolsHost + public abstract class AbstractConsolePad : AbstractPadContent, IEditable, IPositionable, IToolsHost { const string toolBarTreePath = "/SharpDevelop/Pads/CommonConsole/ToolBar"; diff --git a/src/Main/SharpDevelop/Workbench/FileService.cs b/src/Main/SharpDevelop/Workbench/FileService.cs index a91e45dfe9..c52a3b65c5 100644 --- a/src/Main/SharpDevelop/Workbench/FileService.cs +++ b/src/Main/SharpDevelop/Workbench/FileService.cs @@ -454,12 +454,12 @@ namespace ICSharpCode.SharpDevelop.Workbench try { IViewContent content = OpenFile(fileName); - if (content is IPositionable) { - // TODO: enable jumping to a particular view + IPositionable positionable = content.GetService(); + if (positionable != null) { content.WorkbenchWindow.ActiveViewContent = content; NavigationService.ResumeLogging(); loggingResumed = true; - ((IPositionable)content).JumpTo(Math.Max(1, line), Math.Max(1, column)); + positionable.JumpTo(Math.Max(1, line), Math.Max(1, column)); } else { NavigationService.ResumeLogging(); loggingResumed = true; From c8d60b14494c48660e5173d4626adb2059b50f29 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 19 Jul 2013 15:53:06 +0200 Subject: [PATCH 08/27] move CaretPositionChanged and TextCopied handling to CodeEditor; implement BuildNavPoint in CodeEditor --- .../Src/AvalonEditViewContent.cs | 29 ++----------------- .../AvalonEdit.AddIn/Src/CodeEditor.cs | 29 +++++++++++++++---- .../ViewContent/DecompiledViewContent.cs | 7 ++++- 3 files changed, 31 insertions(+), 34 deletions(-) diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs index f38a5168a3..a79dc21863 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs @@ -55,8 +55,6 @@ namespace ICSharpCode.AvalonEdit.AddIn file.IsDirtyChanged += PrimaryFile_IsDirtyChanged; codeEditor.Document.UndoStack.PropertyChanged += codeEditor_Document_UndoStack_PropertyChanged; - codeEditor.CaretPositionChanged += CaretChanged; - codeEditor.TextCopied += codeEditor_TextCopied; } bool IsKnownFileExtension(string filetype) @@ -84,12 +82,7 @@ namespace ICSharpCode.AvalonEdit.AddIn } } } - - void codeEditor_TextCopied(object sender, ICSharpCode.AvalonEdit.Editing.TextEventArgs e) - { - TextEditorSideBar.Instance.PutInClipboardRing(e.Text); - } - + public override object Control { get { return codeEditor; } } @@ -183,25 +176,7 @@ namespace ICSharpCode.AvalonEdit.AddIn public override INavigationPoint BuildNavPoint() { - int lineNumber = codeEditor.Line; - string txt = codeEditor.Document.GetText(codeEditor.Document.GetLineByNumber(lineNumber)); - return new TextNavigationPoint(this.PrimaryFileName, lineNumber, codeEditor.Column, txt); - } - - void CaretChanged(object sender, EventArgs e) - { - NavigationService.Log(this.BuildNavPoint()); - var document = codeEditor.Document; - int lineOffset = document.GetLineByNumber(codeEditor.Line).Offset; - int chOffset = codeEditor.Column; - int col = 1; - for (int i = 1; i < chOffset; i++) { - if (document.GetCharAt(lineOffset + i - 1) == '\t') - col += CodeEditorOptions.Instance.IndentationSize; - else - col += 1; - } - SD.StatusBar.SetCaretPosition(col, codeEditor.Line, chOffset); + return codeEditor.BuildNavPoint(); } public override bool IsReadOnly { diff --git a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs index e19dfd589d..fac26f62c6 100644 --- a/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs +++ b/src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs @@ -235,12 +235,9 @@ namespace ICSharpCode.AvalonEdit.AddIn return codeEditorView; } - public event EventHandler TextCopied; - void textEditor_TextArea_TextCopied(object sender, TextEventArgs e) { - if (TextCopied != null) - TextCopied(this, e); + ICSharpCode.SharpDevelop.Gui.TextEditorSideBar.Instance.PutInClipboardRing(e.Text); } protected virtual void DisposeTextEditor(CodeEditorView textEditor) @@ -364,12 +361,32 @@ namespace ICSharpCode.AvalonEdit.AddIn void HandleCaretPositionChange() { + if (CaretPositionChanged != null) + CaretPositionChanged(this, EventArgs.Empty); + if (quickClassBrowser != null) { quickClassBrowser.SelectItemAtCaretPosition(this.ActiveTextEditor.TextArea.Caret.Location); } - if (CaretPositionChanged != null) - CaretPositionChanged(this, EventArgs.Empty); + NavigationService.Log(this.BuildNavPoint()); + var document = this.Document; + int lineOffset = document.GetLineByNumber(this.Line).Offset; + int chOffset = this.Column; + int col = 1; + for (int i = 1; i < chOffset; i++) { + if (document.GetCharAt(lineOffset + i - 1) == '\t') + col += CodeEditorOptions.Instance.IndentationSize; + else + col += 1; + } + SD.StatusBar.SetCaretPosition(col, this.Line, chOffset); + } + + public INavigationPoint BuildNavPoint() + { + int lineNumber = this.Line; + string txt = this.Document.GetText(this.Document.GetLineByNumber(lineNumber)); + return new TextNavigationPoint(this.FileName, lineNumber, this.Column, txt); } volatile static ReadOnlyCollection codeCompletionBindings; diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs index 2bf470d387..21d2f1da9a 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs @@ -177,7 +177,12 @@ namespace ICSharpCode.ILSpyAddIn // TODO: show Save As dialog to allow the user to save the decompiled file } #endregion - + + public override INavigationPoint BuildNavPoint() + { + return codeEditor.BuildNavPoint(); + } + #region JumpToEntity public void JumpToEntity(string entityIdString) { From 13623553e0568d83e566a6c4d29d08ca93045d37 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 19 Jul 2013 21:10:07 +0200 Subject: [PATCH 09/27] add icons for new ClassBrowser nodes --- .../image/BitmapResources/BitmapList.txt | 10 +++++--- ...ssembly.png => Icons.16x16.Collection.png} | Bin ...bly.png => Icons.16x16.OpenCollection.png} | Bin .../image/BitmapResources/BitmapResources.res | 10 ++++++-- .../ClassBrowserIcons/AssemblyFromFile.png | Bin 0 -> 663 bytes .../Icons.16x16.Assembly.png | Bin 0 -> 609 bytes .../Icons.16x16.AssemblyFromFile.png | Bin 0 -> 653 bytes .../Icons.16x16.AssemblyFromGAC.png | Bin 0 -> 625 bytes .../ClassBrowserIcons/Icons.16x16.Module.png | Bin 0 -> 727 bytes .../Icons.16x16.Workspace.png | Bin 0 -> 706 bytes .../Analysis/UnitTesting/UnitTesting.addin | 2 +- .../Pads/ClassBrowserSupport.cs | 2 +- .../Project/Src/Gui/AddinTreeView.cs | 4 +-- .../Project/Src/Gui/TreeTreeView.cs | 4 +-- .../Project/Gui/DefaultSearchResult.cs | 4 +-- .../Dom/ClassBrowser/AssemblyTreeNode.cs | 2 +- .../Dom/ClassBrowser/WorkspaceTreeNode.cs | 2 +- .../Project/ICSharpCode.SharpDevelop.addin | 23 ++++++++++++------ .../Dom/ClassBrowser/OpenAssemblyCommand.cs | 17 ++++++++++--- .../Resources/BitmapResources.resources | Bin 713234 -> 717672 bytes 20 files changed, 55 insertions(+), 25 deletions(-) rename data/resources/image/BitmapResources/BitmapResources-data/{Icons.16x16.Assembly.png => Icons.16x16.Collection.png} (100%) rename data/resources/image/BitmapResources/BitmapResources-data/{Icons.16x16.OpenAssembly.png => Icons.16x16.OpenCollection.png} (100%) create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/AssemblyFromFile.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Assembly.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromFile.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromGAC.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Module.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Workspace.png diff --git a/data/resources/image/BitmapResources/BitmapList.txt b/data/resources/image/BitmapResources/BitmapList.txt index ddb63557b2..7c72c13632 100644 --- a/data/resources/image/BitmapResources/BitmapList.txt +++ b/data/resources/image/BitmapResources/BitmapList.txt @@ -23,7 +23,7 @@ BitmapResources-data\Icons.16x16.AdjustColor.png BitmapResources-data\Icons.16x16.ArrowDown.png BitmapResources-data\Icons.16x16.ArrowLeftRight.png BitmapResources-data\Icons.16x16.ArrowUp.png -BitmapResources-data\Icons.16x16.Assembly.png +BitmapResources-data\Icons.16x16.Collection.png BitmapResources-data\Icons.16x16.BoldText.png BitmapResources-data\Icons.16x16.BrowserAfter.png BitmapResources-data\Icons.16x16.BrowserBefore.png @@ -85,7 +85,7 @@ BitmapResources-data\Icons.16x16.LowerToUpperCase.png BitmapResources-data\Icons.16x16.MyComputer.png BitmapResources-data\Icons.16x16.NETWORK.png BitmapResources-data\Icons.16x16.OK.png -BitmapResources-data\Icons.16x16.OpenAssembly.png +BitmapResources-data\Icons.16x16.OpenCollection.png BitmapResources-data\Icons.16x16.OutDent.png BitmapResources-data\Icons.16x16.PasteIcon.png BitmapResources-data\Icons.16x16.PersonalFiles.png @@ -555,7 +555,11 @@ ClassBrowserIcons\Icons.16x16.NameSpace.png ClassBrowserIcons\Icons.16x16.Operator.png ClassBrowserIcons\Icons.16x16.Parameter.png ClassBrowserIcons\Icons.16x16.Struct.png - +ClassBrowserIcons\Icons.16x16.Workspace.png +ClassBrowserIcons\Icons.16x16.Assembly.png +ClassBrowserIcons\Icons.16x16.Module.png +ClassBrowserIcons\Icons.16x16.AssemblyFromFile.png +ClassBrowserIcons\Icons.16x16.AssemblyFromGAC.png ------------------------------------------------------------------------------- Left original (other source than Fugue Iconlibrary) diff --git a/data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.Assembly.png b/data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.Collection.png similarity index 100% rename from data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.Assembly.png rename to data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.Collection.png diff --git a/data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.OpenAssembly.png b/data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.OpenCollection.png similarity index 100% rename from data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.OpenAssembly.png rename to data/resources/image/BitmapResources/BitmapResources-data/Icons.16x16.OpenCollection.png diff --git a/data/resources/image/BitmapResources/BitmapResources.res b/data/resources/image/BitmapResources/BitmapResources.res index fbe8c05bb9..51f99e517d 100644 --- a/data/resources/image/BitmapResources/BitmapResources.res +++ b/data/resources/image/BitmapResources/BitmapResources.res @@ -107,7 +107,7 @@ Icons.16x16.AdjustBackgroundColor = BitmapResources-data\Icons.16x16.AdjustB Icons.16x16.HelpOpenFolder = BitmapResources-data\Icons.16x16.HelpOpenFolder.png Icons.16x16.SmallIconsIcon = BitmapResources-data\Icons.16x16.SmallIconsIcon.png Icons.16x16.HtmlElements.AnchorElement = BitmapResources-data\Icons.16x16.HtmlElements.AnchorElement.png -Icons.16x16.Assembly = BitmapResources-data\Icons.16x16.Assembly.png +Icons.16x16.Collection = BitmapResources-data\Icons.16x16.Collection.png Icons.16x16.TipOfTheDay = BitmapResources-data\Icons.16x16.TipOfTheDay.png Icons.16x16.Right = BitmapResources-data\Icons.16x16.Right.png Icons.16x16.CDROM = BitmapResources-data\Icons.16x16.CDROM.png @@ -169,7 +169,7 @@ Icons.16x16.BuildCurrentSelectedProject = BitmapResources-data\Icons.16x16.Bu Icons.16x16.HelpTopic = BitmapResources-data\Icons.16x16.HelpTopic.png Icons.16x16.PrevWindowIcon = BitmapResources-data\Icons.16x16.PrevWindowIcon.png Icons.16x16.HtmlElements.SelectElement = BitmapResources-data\Icons.16x16.HtmlElements.SelectElement.png -Icons.16x16.OpenAssembly = BitmapResources-data\Icons.16x16.OpenAssembly.png +Icons.16x16.OpenCollection = BitmapResources-data\Icons.16x16.OpenCollection.png Icons.16x16.HtmlElements.InputSubmitElement = BitmapResources-data\Icons.16x16.HtmlElements.InputSubmitElement.png Icons.16x16.CancelIcon = BitmapResources-data\Icons.16x16.CancelIcon.png Icons.16x16.ItalicText = BitmapResources-data\Icons.16x16.ItalicText.png @@ -292,6 +292,12 @@ Icons.16x16.SharpQuery.AddConnection = SharpQueryIcons\Icons.16x16.SharpQuery Icons.16x16.SharpQuery.Remove = SharpQueryIcons\Icons.16x16.SharpQuery.Remove.png #ClassBrowser icons +Icons.16x16.AssemblyFromFile = ClassBrowserIcons\Icons.16x16.AssemblyFromFile.png +Icons.16x16.AssemblyFromGAC = ClassBrowserIcons\Icons.16x16.AssemblyFromGAC.png + +Icons.16x16.Workspace = ClassBrowserIcons\Icons.16x16.Workspace.png +Icons.16x16.Assembly = ClassBrowserIcons\Icons.16x16.Assembly.png +Icons.16x16.Module = ClassBrowserIcons\Icons.16x16.Module.png Icons.16x16.NameSpace = ClassBrowserIcons\Icons.16x16.NameSpace.png Icons.16x16.Literal = ClassBrowserIcons\Icons.16x16.Literal.png Icons.16x16.Reference = ClassBrowserIcons\Icons.16x16.Reference.png diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/AssemblyFromFile.png b/data/resources/image/BitmapResources/ClassBrowserIcons/AssemblyFromFile.png new file mode 100644 index 0000000000000000000000000000000000000000..1e33efe252fdba5427c7aac438409a4ea69366d0 GIT binary patch literal 663 zcmV;I0%-k-P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv00068NklG|i7)Bpa%Fo+KlhbqAj80&W4aoq9xzwxTOa17#u#Gy*?1IDtAw{5pP|8KDT z794~4AaSS?{D3iUcP^De?Mhz}BnDnSMN z7#KW&_zVn383a57Y0zDA9ge{UL`}a6)q)CkF)*xq=I!(LUuoHY5MG>A`9CzE8jKw@ z3%)sOmH#lz&iHCm5%oS~s^tS1j#nyKlf*nBgJBEM)=#Ex|6ejFVBlQEuopL%eft0J z|NsAg|NVnw5FaF-$lTY*unuUz8(q8qj~QezaHf3N%Zu|~{r~*y*Z+54zrrzy4-$`O z?w-i73~0a;RkQ!M86+`qicI*cGc%w5e{}!T|Ciss!7+#r5|3f-n8q*bkHp5h)0e9r||KAW+#lX>GVQ*HH9{hjo z*zx~|4jl$#5W6>O+5fdw$Nq;iH7sDLV_=wB1vCU34i*l3yR3Ns|LxoN{x5f#_>x$r&YKn$)o@P002ovPDHLkV1kasE$aXP literal 0 HcmV?d00001 diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Assembly.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Assembly.png new file mode 100644 index 0000000000000000000000000000000000000000..d38c058f2ff9cb262a9d0874e57d579f6f8f8b53 GIT binary patch literal 609 zcmV-n0-pVeP)x@9_^*I2o*#S3W5j4){BRvhgwP%)Rdr+ z+E@&<-RVrS>;IeVX4CA+4{v7v`!jFn|39l~k3OKwH0?T#kI`#);kqkf!nuDDIvUNB z8)q&|oXKQ|PbYk$@@w~?`04WuEmux%)~DVsVCmAWFgMz7=!tT<91zK5G65+^BW{J* z)ao-7p56n5@ZmNZ4K$n00PHg#+5>A~sU^U}*~%sg%d>vaQBrz`e6Y{Fe>guj3u}0} zBjAbr*h1mu9AFDaDg_k+`^*!NAD=@exz$O*1ttk4#zb|ybhG#>#R0=G0(f?K3vM2M|63nwZL~(J=3x3u$#sLX4+w8`$}XGu zEz^6iUwG`5HrVEG?0hrsTt1)6<;WW|2_ww!RKMkE~Qs8@=8D$pR+K+`nDkuhDzx+ms_8v8%?Pk;dc7BCA>1>bSD00000NkvXXu0mjfOl=j+ literal 0 HcmV?d00001 diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromFile.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromFile.png new file mode 100644 index 0000000000000000000000000000000000000000..738b354a4d0680c91a68f12c7ea3141a1b16411c GIT binary patch literal 653 zcmV;80&@L{P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv0005}Nkl)gO=rl8HA` zL?bDbpcnEYiHae;T^ave=2GmD@tx6+w6*uW4tvhE zin)}AJEPkpaoW`LR);<3T4kl40S5$Xp8AT~1V69@M|I>ty>CQ&vQjZ1nmBZLcFEx+ zrq_0!j@Mq4Y~Eitcfwvd?>xI@q1m-Dvqb nT6J}KZE$-|Vz3Zi8}=;&7e}H)!vGy300000NkvXXu0mjf=yN0E literal 0 HcmV?d00001 diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromGAC.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromGAC.png new file mode 100644 index 0000000000000000000000000000000000000000..52e916f98d371d3f70cbf88cf7a4835e999521f2 GIT binary patch literal 625 zcmV-%0*?KOP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv0005tNkl-vD$(8{~_WhHx+#5d-+5=LXCGL#kYgFu~h}1`CdNJ zj^G?!OY{a2<5^MgneXM3`Zx;O)E9%f=>f zW92Rs+nXgXvP;f%W!GXG()NqI#O}zE3jE@){xex|M9)+@3W$AXS@51Z6&15nsG4g( zw~v!gDiA-}iP4N*(yO%Ch<#ejfO{h!{K>uX%p-U7H!=ntA*oeqp2*8(HA zSP+bQh4m)}6{m$*`j<|;Z1o_vd03J12hdmdU+Ai)9n?lN^g%3nOkpZ9*Dn*gmom}u z*DQHn+Y3WoAEMq{um1zBM3&G{L@}|u!U~+n;f3iT{+)dGKOwpTLeOqe3;mfc00000 LNkvXXu0mjf++Pgc literal 0 HcmV?d00001 diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Module.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Module.png new file mode 100644 index 0000000000000000000000000000000000000000..ce892a1562161fe5db15ee963b3f307bef2feaba GIT binary patch literal 727 zcmV;|0x127P)d=R*%{PP9O(eEPFQK~hn%OKcbN95rz zNLZm4^hDnU0dNT*3!zW&^zrRS^PcBHlBDdL&9@AFBMz7FKM5#+M{R`rqh2#o32ngg zErXvi@k1lxEMb8?syUz(cKGz~!z;NAB7J_d}AO+lovaGg#E z?RNW^k|>IBx@L3dQ=!8A%U7o-cp4{C;5qZQfmNJoEUK#F`?q4XYnd+@_1!ORL!DNtj04p+{>G<^m0f81%^Eo!Ptd^+w(Jy0?2iGjvX` z9#(PGKH~Xvax`aIRg<1==c3}}kdT;NV*sP9U?RkUTQ_F2mSbVRu@5mNLQcpb0A2dn z$aw4E=M&}+jEzhf4Ra<2s0o6Qbsfhj?rfLkw4&>inMu^VW@G!H>NOol8dQ?$o5SNn z*Dqe-onh;@Q3(ghC(9oTg%5kB(iYu6^IA?v(G@heY885UmBvijmg(JrIG!!xCCHCh5L$V{Jb%$_~9ycY#(9zUm`&Z+L80{~@EG1^ozeD(kU002ov JPDHLkV1jbFMlJvV literal 0 HcmV?d00001 diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Workspace.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Workspace.png new file mode 100644 index 0000000000000000000000000000000000000000..6a27b7c650a55c4b46596a8e7ea5e480f7396e29 GIT binary patch literal 706 zcmV;z0zLhSP){skLJ2AR%05DKk1;gbornYU89+RE_7D? zx1ILDm1UjH`&z@{FfJb}#lfAg&o14$SSrqiH9CRlt$z5|xM?2XMQV4De4mt>)>z7TJwzw4}H`&4o3xeE>4PGWL) z9*620;oq_q>$88sUKl`A{YLaYoI>5H)0mew3|)tzxhTochI|!zqzfsT;2e(Qz_Kjr zDiHtu1@lwAsN7Y7foFpVROO?fs0g)(oA80Ej76icOcRRLITs|3R4N6N0x(U(%=l9T z_VnTTiy>?-Yr%%X>NI2$#3_*`1cZ}-YQ7GqQ*gx-hcVkbFxrvfx$n8Y>EuPtUt36r)%TyW9Ke(Nr!cI1sy=aTW%1 oLjPt#)5f&bPNR-h+Ft<%04Mk@(94*OcK`qY07*qoM6N<$f~hb;wg3PC literal 0 HcmV?d00001 diff --git a/src/AddIns/Analysis/UnitTesting/UnitTesting.addin b/src/AddIns/Analysis/UnitTesting/UnitTesting.addin index 428a3f0785..3b01c2fb29 100644 --- a/src/AddIns/Analysis/UnitTesting/UnitTesting.addin +++ b/src/AddIns/Analysis/UnitTesting/UnitTesting.addin @@ -101,7 +101,7 @@ class="ICSharpCode.UnitTesting.AddNUnitReferenceCommand"/> diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/ClassBrowserSupport.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/ClassBrowserSupport.cs index d4b76afdaf..112d899770 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/ClassBrowserSupport.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/ClassBrowserSupport.cs @@ -125,7 +125,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads public override object Icon { get { - return IconService.GetImageSource("PadIcons.LoadedModules"); + return SD.ResourceService.GetImageSource("Icons.16x16.Module"); } } diff --git a/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddinTreeView.cs b/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddinTreeView.cs index 32ed8003ae..175741f970 100644 --- a/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddinTreeView.cs +++ b/src/AddIns/Misc/AddinScout/Project/Src/Gui/AddinTreeView.cs @@ -26,8 +26,8 @@ namespace AddInScout treeView.ImageList = new ImageList(); treeView.ImageList.ColorDepth = ColorDepth.Depth32Bit; treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Class")); - treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Assembly")); - treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenAssembly")); + treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Collection")); + treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenCollection")); treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap")); treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap")); diff --git a/src/AddIns/Misc/AddinScout/Project/Src/Gui/TreeTreeView.cs b/src/AddIns/Misc/AddinScout/Project/Src/Gui/TreeTreeView.cs index 0434e2de95..f38b842a15 100644 --- a/src/AddIns/Misc/AddinScout/Project/Src/Gui/TreeTreeView.cs +++ b/src/AddIns/Misc/AddinScout/Project/Src/Gui/TreeTreeView.cs @@ -23,8 +23,8 @@ namespace AddInScout treeView.ImageList = new ImageList(); treeView.ImageList.ColorDepth = ColorDepth.Depth32Bit; treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Class")); - treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Assembly")); - treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenAssembly")); + treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.Collection")); + treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenCollection")); treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.ClosedFolderBitmap")); treeView.ImageList.Images.Add(IconService.GetBitmap("Icons.16x16.OpenFolderBitmap")); diff --git a/src/AddIns/Misc/SearchAndReplace/Project/Gui/DefaultSearchResult.cs b/src/AddIns/Misc/SearchAndReplace/Project/Gui/DefaultSearchResult.cs index 8e1cdc7838..c03923549a 100644 --- a/src/AddIns/Misc/SearchAndReplace/Project/Gui/DefaultSearchResult.cs +++ b/src/AddIns/Misc/SearchAndReplace/Project/Gui/DefaultSearchResult.cs @@ -87,13 +87,13 @@ namespace SearchAndReplace Button expandAll = new Button(); expandAll.SetValueToExtension(Button.ToolTipProperty, new LocalizeExtension("MainWindow.Windows.SearchResultPanel.ExpandAll.ToolTip")); - expandAll.Content = new Image { Height = 16, Source = PresentationResourceService.GetBitmapSource("Icons.16x16.OpenAssembly") }; + expandAll.Content = new Image { Height = 16, Source = PresentationResourceService.GetBitmapSource("Icons.16x16.OpenCollection") }; expandAll.Click += delegate { ExpandCollapseAll(true); }; toolbarItems.Add(expandAll); Button collapseAll = new Button(); collapseAll.SetValueToExtension(Button.ToolTipProperty, new LocalizeExtension("MainWindow.Windows.SearchResultPanel.CollapseAll.ToolTip")); - collapseAll.Content = new Image { Height = 16, Source = PresentationResourceService.GetBitmapSource("Icons.16x16.Assembly") }; + collapseAll.Content = new Image { Height = 16, Source = PresentationResourceService.GetBitmapSource("Icons.16x16.Collection") }; collapseAll.Click += delegate { ExpandCollapseAll(false); }; toolbarItems.Add(collapseAll); } diff --git a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs index 28e67cd2db..ea114cacd0 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs @@ -43,7 +43,7 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public override object Icon { get { - return base.Icon; + return SD.ResourceService.GetImageSource("Icons.16x16.Assembly"); } } } diff --git a/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs index 9eb0abb97a..d9e14d24b6 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs @@ -51,7 +51,7 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public override object Icon { get { - return SD.ResourceService.GetImageSource("PadIcons.ClassBrowser"); + return SD.ResourceService.GetImageSource("Icons.16x16.Workspace"); } } diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin index a661ed0eb6..cc5ad44323 100755 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin @@ -238,7 +238,7 @@ class = "ICSharpCode.SharpDevelop.Project.Commands.RefreshProjectBrowser"/> @@ -921,9 +921,18 @@ + type = "DropDownButton" + icon = "Icons.16x16.AssemblyFromFile" + tooltip = "Open assembly"> + + + @@ -2178,12 +2187,12 @@ diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs index d76b0dbd8d..59851280c6 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs @@ -2,17 +2,28 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; -using Microsoft.Win32; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { /// - /// Description of OpenAssemblyCommand. + /// Description of OpenAssemblyFromFileCommand. /// - class OpenAssemblyCommand : SimpleCommand + class OpenAssemblyFromFileCommand : SimpleCommand { public override void Execute(object parameter) { + throw new NotImplementedException(); + } + } + + /// + /// Description of OpenAssemblyFromGACCommand. + /// + class OpenAssemblyFromGACCommand : SimpleCommand + { + public override void Execute(object parameter) + { + throw new NotImplementedException(); } } } diff --git a/src/Main/SharpDevelop/Resources/BitmapResources.resources b/src/Main/SharpDevelop/Resources/BitmapResources.resources index 57204edbcc67e0977bf87f48fbd39d71656831fa..83d8924bc4c90f6aafc4dabb1bf8759744e6579f 100644 GIT binary patch delta 10533 zcmZ8_1zeNc|Nr4Ud&V~A7(KR8(%p@8Nk~g5B_c|<0?I4|^Qy<<3YeIvcr8@yPOv+% zu~4razt1-Dd;fp&c|AMl)9?4^#5Vt^<+CT2b62pnFhcMjjV3XT8e0!6RG=K|Beuoi zRE2HZsbU4jiD}O7w;9px6csLbMJ}G5So|SW?UuFz&BNuO5bEgaHT@#v>E} zPg5{Ly2B8%%|K|ZCqjo(5xSg!&^uRzZu=l~q!^(oB81cn5ZbAV&>Clirl%tbY8Z&n za&WqVjZj1+Le8cL9S0>P6@+G6A~b&pLOl@d4I~f+4nO806dZ?;R~aM$fgcqiw2T7V zG=$uZ5#oTZlMo?>GD6w#&a^}52aV869fZ7{AeJsdC*TI@Gu{>DcS@7p8?J@ z83=`1!YTmAJbi?c@&ExALc5^SP(Yy>oT)*8Gr;?3;MLX&_=d*%21x}$b^3syQ365_ z5kev0JRS775ZuZF5F8DDBcNI+jtT-KO96U7E&_axl$1cm09h3@;U_RKgkWmW4;PK# z4UL!yFvY_BCR>E&c_3sAtHcs8Efye@0ZujnLW2S7SwKsZF+yc=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-N zE}7Ot)*R7MKUMC()2#f_G^1=js-wh596#Z83|g`B(Bm!U>ZW_kzv6F(393llbQ8Zj z9ZmkWvhH6O&bk>UIr5Z_27(IUq!|IS$7vn)e?(bT-@a#f?~E+DL$eNN$AKA%3RC{a zr%I8Ph&RqO%X2?hOt`2}dHV$&{wm_4{8&HBELUDqj4GUjSwZp#S6Tu(HOuUwOvdqO z2W7xcq;}uvC{vX@H7inXxURIBqStA*RZP9f&e?hL{o5@fugs2=Uin4G=V!-AFWl2{ zhq?sm^ZWQJs|%NA|Ec5pxLjx-Wa8!91M~nK3yK5Ln8gM2;^Z}XdK9y8UI4!~&mp=M@P&E4;`b5! zV4mGRd$gWB^YGa*8QVkoRIS2KIbQpd$8fj#{#k9uJ+YpOZ=o7BD|{A=e_|mWN-YZ^ zlb%=@3U;abp;SiiRPpBdfpUDU9^au`=iB(zIYFY`Og7X9ih??J*4xF+dd{xzA_|xA zR4|u4!|UtAC_L7$Zs;N(-K0Rbs=>nbUN#}N@%{!ce$~q=HtgVM z8~jDlL2#V%v7-tcidY|8fSli?r*M^;YqQ7^C-supdFR>d^D#StI}CAZ2r+~q52 zk0}k0Uu=@Ia}1d9{tG>oLsoNZgn{_PmQBy!Xx1-V)U;%2(~>s0L}Swusdh)>@oAb{ zqOmGYGdRBSVx>M@T6(Td(|E2<&g#4Lg*W8J7v9j`Pi<`bj`WiByun@j^wLP98!jC# MePg82(EI!U2QNaASpWb4 From 63e99c0a33eb2e9de543496195b70447c23db106 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 19 Jul 2013 22:29:48 +0200 Subject: [PATCH 10/27] implement Delete-Key in BookmarkPad to allow deletion of bookmarks and breakpoints --- src/Main/Base/Project/Editor/Bookmarks/BookmarkPad.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Main/Base/Project/Editor/Bookmarks/BookmarkPad.cs b/src/Main/Base/Project/Editor/Bookmarks/BookmarkPad.cs index 67995138de..b18fc2fdcb 100644 --- a/src/Main/Base/Project/Editor/Bookmarks/BookmarkPad.cs +++ b/src/Main/Base/Project/Editor/Bookmarks/BookmarkPad.cs @@ -69,6 +69,16 @@ namespace ICSharpCode.SharpDevelop.Editor.Bookmarks if (bm != null) OnItemActivated(bm); }; + + this.control.listView.KeyDown += delegate(object sender, System.Windows.Input.KeyEventArgs e) { + SDBookmark bm = this.control.listView.SelectedItem as SDBookmark; + if (bm == null) return; + switch (e.Key) { + case System.Windows.Input.Key.Delete: + SD.BookmarkManager.RemoveMark(bm); + break; + } + }; } public override void Dispose() From cc094dcba54329b63aa742d97a36ff7a64848c9c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 19 Jul 2013 23:26:13 +0200 Subject: [PATCH 11/27] fix bug in XamlUnresolvedFile: XamlDocumentVisitor did not create a reference to the base type of the XAML element. This led to an incomplete type definition if there's no code-behind partial class. --- .../XamlBinding/XamlBinding/XamlParser.cs | 8 -------- .../XamlBinding/XamlBinding/XamlUnresolvedFile.cs | 10 +--------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs index 7adf0287c8..02e2b290e5 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlParser.cs @@ -7,13 +7,11 @@ using System.IO; using System.Linq; using System.Threading; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.NRefactory.TypeSystem.Implementation; using ICSharpCode.NRefactory.Utils; using ICSharpCode.NRefactory.Xml; using ICSharpCode.SharpDevelop; @@ -21,7 +19,6 @@ using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.Search; using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; -using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.XamlBinding { @@ -31,11 +28,6 @@ namespace ICSharpCode.XamlBinding public class XamlParser : IParser { public IReadOnlyList TaskListTokens { get; set; } - -// public LanguageProperties Language -// { -// get { return LanguageProperties.CSharp; } -// } public XamlParser() { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs index 2f4ddbcf4f..aebb71c2d7 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs @@ -3,22 +3,13 @@ using System; using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; using System.Linq; -using System.Threading; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.Core; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; -using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem.Implementation; using ICSharpCode.NRefactory.Xml; -using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Parser; -using ICSharpCode.SharpDevelop.Project; -using ICSharpCode.SharpDevelop.Refactoring; namespace ICSharpCode.XamlBinding { @@ -162,6 +153,7 @@ namespace ICSharpCode.XamlBinding Accessibility = Accessibility.Public, ReturnType = KnownTypeReference.Void }); + TypeDefinition.BaseTypes.Add(CreateTypeReference(rootElement.Namespace, rootElement.LocalName)); } } base.VisitDocument(document); From 1465ec95acbbc1a8dcc3ac3ef6212e1405bb50f0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jul 2013 09:39:39 +0200 Subject: [PATCH 12/27] add invisible members to XamlUnresolvedFile as generated by the XAML markup compiler --- .../XamlBinding/XamlUnresolvedFile.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs index aebb71c2d7..e1e4297054 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlUnresolvedFile.cs @@ -142,10 +142,12 @@ namespace ICSharpCode.XamlBinding AXmlElement rootElement = currentDocument.Children.OfType().FirstOrDefault(); if (rootElement != null) { string className = rootElement.GetAttributeValue(XamlConst.XamlNamespace, "Class"); + string modifier = rootElement.GetAttributeValue(XamlConst.XamlNamespace, "ClassModifier"); if (className != null) { TypeDefinition = new DefaultUnresolvedTypeDefinition(className) { Kind = TypeKind.Class, UnresolvedFile = file, + Accessibility = Accessibility.Public, Region = new DomRegion(file.FileName, textDocument.GetLocation(rootElement.StartOffset), textDocument.GetLocation(rootElement.EndOffset)) }; TypeDefinition.Members.Add( @@ -153,7 +155,35 @@ namespace ICSharpCode.XamlBinding Accessibility = Accessibility.Public, ReturnType = KnownTypeReference.Void }); + TypeDefinition.Members.Add( + new DefaultUnresolvedField(TypeDefinition, "_contentLoaded") { + Accessibility = Accessibility.Private, + ReturnType = KnownTypeReference.Boolean + }); + + var connectMember = + new DefaultUnresolvedMethod(TypeDefinition, "Connect") { + Accessibility = Accessibility.Private, + ReturnType = KnownTypeReference.Void + }; + connectMember.Parameters.Add(new DefaultUnresolvedParameter(KnownTypeReference.Int32, "connectionId")); + connectMember.Parameters.Add(new DefaultUnresolvedParameter(KnownTypeReference.Object, "target")); + TypeDefinition.Members.Add(connectMember); + connectMember.ExplicitInterfaceImplementations.Add( + new DefaultMemberReference(SymbolKind.Method, new GetClassTypeReference(new FullTypeName(typeof(System.Windows.Markup.IComponentConnector).FullName)), "Connect")); + + var browsableAttribute = new DefaultUnresolvedAttribute(new GetClassTypeReference(new FullTypeName(typeof(System.ComponentModel.EditorBrowsableAttribute).FullName))); + + browsableAttribute.PositionalArguments.Add( + new SimpleConstantValue( + new GetClassTypeReference(new FullTypeName(typeof(System.ComponentModel.EditorBrowsableAttribute).FullName)), System.ComponentModel.EditorBrowsableState.Never + )); + + connectMember.Attributes.Add(browsableAttribute); TypeDefinition.BaseTypes.Add(CreateTypeReference(rootElement.Namespace, rootElement.LocalName)); + TypeDefinition.BaseTypes.Add(new GetClassTypeReference(new FullTypeName(typeof(System.Windows.Markup.IComponentConnector).FullName))); + if (modifier != null) + TypeDefinition.Accessibility = ParseAccessibility(modifier); } } base.VisitDocument(document); From a87ee09ee58604a52922088388afb00ae431f82a Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jul 2013 09:53:02 +0200 Subject: [PATCH 13/27] remove redundant usings from XamlBinding --- .../XamlBinding/XamlBinding/CompletionDataGenerator.cs | 5 ----- .../XamlBinding/XamlBinding/Extensions.cs | 4 ---- .../XamlBinding/XamlBinding/MarkupExtensionInfo.cs | 3 --- .../XamlBinding/Options/CodeCompletion.xaml.cs | 8 -------- .../XamlBinding/Options/XamlBindingOptions.cs | 1 - .../XamlBinding/XamlBinding/PropertyPathSegment.cs | 1 - .../BackendBindings/XamlBinding/XamlBinding/Utils.cs | 10 +--------- .../XamlBinding/XamlBinding/XamlAstResolver.cs | 2 -- .../XamlBinding/XamlBinding/XamlBehavior.cs | 3 --- .../XamlBinding/XamlBinding/XamlCompletionItemList.cs | 5 +---- .../XamlBinding/XamlBinding/XamlConst.cs | 9 --------- .../XamlBinding/XamlBinding/XamlContext.cs | 6 ------ .../XamlBinding/XamlBinding/XamlContextResolver.cs | 1 - .../XamlBinding/XamlBinding/XamlLanguageBinding.cs | 1 - .../XamlBinding/XamlOutlineContentHost.xaml.cs | 1 - .../XamlBinding/XamlBinding/XamlOutlineNode.cs | 2 -- .../XamlBinding/XamlBinding/XamlSymbolSearch.cs | 4 ---- 17 files changed, 2 insertions(+), 64 deletions(-) diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataGenerator.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataGenerator.cs index 7bd1c90b1e..2835db1b27 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataGenerator.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/CompletionDataGenerator.cs @@ -3,14 +3,10 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; -using System.Runtime.InteropServices.ComTypes; -using System.Threading; using System.Windows.Media; using ICSharpCode.NRefactory; -using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; @@ -20,7 +16,6 @@ using ICSharpCode.NRefactory.Xml; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; -using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs index 8c50318b6f..c5214a4641 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Extensions.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Windows; using System.Windows.Controls; @@ -11,16 +10,13 @@ using System.Windows.Media; using System.Xml; using System.Xml.Linq; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.NRefactory.Xml; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; -using ICSharpCode.XmlEditor; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/MarkupExtensionInfo.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/MarkupExtensionInfo.cs index 1f0ee134e5..1a813e4992 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/MarkupExtensionInfo.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/MarkupExtensionInfo.cs @@ -5,9 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; -using ICSharpCode.SharpDevelop; -using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.XmlEditor; using System.Text; namespace ICSharpCode.XamlBinding diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/CodeCompletion.xaml.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/CodeCompletion.xaml.cs index 9ed1a2cac6..0b0b7e3bad 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/CodeCompletion.xaml.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/CodeCompletion.xaml.cs @@ -2,14 +2,6 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; -using System.Collections.Generic; -using System.Text; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; using ICSharpCode.SharpDevelop.Gui; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/XamlBindingOptions.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/XamlBindingOptions.cs index c7b1972566..2abe902879 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/XamlBindingOptions.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Options/XamlBindingOptions.cs @@ -2,7 +2,6 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; -using System.Collections.Generic; using System.Diagnostics; using System.Windows.Media; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/PropertyPathSegment.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/PropertyPathSegment.cs index ada534d1d7..ffbb7425be 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/PropertyPathSegment.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/PropertyPathSegment.cs @@ -3,7 +3,6 @@ using System; using System.Linq; -using System.Collections.Generic; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Utils.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Utils.cs index 8ab1ff403a..d3f1503425 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Utils.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/Utils.cs @@ -1,18 +1,10 @@ // Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) -using ICSharpCode.NRefactory; using System; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; -using System.Text.RegularExpressions; -using System.Xml; -using ICSharpCode.Core; -using ICSharpCode.NRefactory.Xml; -using ICSharpCode.SharpDevelop.Editor; -using ICSharpCode.XmlEditor; +using ICSharpCode.NRefactory; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs index 9805d23a3a..ea00cddea5 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlAstResolver.cs @@ -10,8 +10,6 @@ using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.TypeSystem.Implementation; using ICSharpCode.NRefactory.Xml; -using ICSharpCode.SharpDevelop.Parser; -using ICSharpCode.XmlEditor; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBehavior.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBehavior.cs index 8504e2bc40..e2dba98a47 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBehavior.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlBehavior.cs @@ -6,10 +6,7 @@ using System.Diagnostics; using System.IO; using System.Linq; -using ICSharpCode.AvalonEdit.Document; -using ICSharpCode.Core; using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Refactoring; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs index 4c0983afb7..42e1ebabf8 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs @@ -2,16 +2,13 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; -using System.Collections.Generic; using System.Linq; -using ICSharpCode.SharpDevelop; using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.CodeCompletion; -using ICSharpCode.SharpDevelop.Gui; using ICSharpCode.SharpDevelop.Project; -using ICSharpCode.XmlEditor; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlConst.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlConst.cs index ab691ea2cf..051973df82 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlConst.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlConst.cs @@ -6,15 +6,6 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; -using System.Threading; -using ICSharpCode.NRefactory; -using ICSharpCode.NRefactory.Semantics; -using ICSharpCode.NRefactory.TypeSystem; -using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Editor; -using ICSharpCode.SharpDevelop.Editor.CodeCompletion; -using ICSharpCode.SharpDevelop.Parser; - namespace ICSharpCode.XamlBinding { ///

diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContext.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContext.cs index ffb8d9f1e6..9ea3a3a926 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContext.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContext.cs @@ -4,17 +4,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.IO; using System.Linq; -using System.Windows.Media; -using System.Xml; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.NRefactory.Xml; -using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; -using ICSharpCode.SharpDevelop.Parser; -using ICSharpCode.XmlEditor; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContextResolver.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContextResolver.cs index 5ab19f17cb..7565e4d734 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContextResolver.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlContextResolver.cs @@ -9,7 +9,6 @@ using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Xml; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; -using ICSharpCode.SharpDevelop.Parser; namespace ICSharpCode.XamlBinding { diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlLanguageBinding.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlLanguageBinding.cs index 6a6d26f335..25a695fd09 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlLanguageBinding.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlLanguageBinding.cs @@ -2,7 +2,6 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; -using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Rendering; using ICSharpCode.SharpDevelop; using ICSharpCode.SharpDevelop.Editor; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs index 39fcb6c32f..e20bab95b9 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineContentHost.xaml.cs @@ -4,7 +4,6 @@ using System; using System.Windows.Controls; using System.Windows.Input; -using System.Windows.Threading; using ICSharpCode.Core; using ICSharpCode.SharpDevelop; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineNode.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineNode.cs index ff86aecd6b..5c209e9422 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineNode.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlOutlineNode.cs @@ -4,8 +4,6 @@ using System; using System.Linq; using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; using ICSharpCode.NRefactory.Editor; using ICSharpCode.SharpDevelop.Editor; diff --git a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs index 23476b90e4..aa604a7b28 100644 --- a/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs +++ b/src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs @@ -3,20 +3,16 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.Core; -using ICSharpCode.NRefactory.CSharp.Resolver; using ICSharpCode.NRefactory.Editor; using ICSharpCode.NRefactory.Semantics; using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Editor; using ICSharpCode.SharpDevelop.Editor.Search; -using ICSharpCode.SharpDevelop.Parser; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Refactoring; From 0d191ba5b886e69885447c549a5ef6411a48d70c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jul 2013 10:10:50 +0200 Subject: [PATCH 14/27] sort members of TypeDefinition first by symbol kind, then by name in class browser --- .../ClassBrowser/TypeDefinitionTreeNode.cs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/Main/Base/Project/Dom/ClassBrowser/TypeDefinitionTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/TypeDefinitionTreeNode.cs index d1a36f5d9b..7141734783 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/TypeDefinitionTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/TypeDefinitionTreeNode.cs @@ -5,12 +5,14 @@ using System; using System.Collections.Generic; using ICSharpCode.Core.Presentation; using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.NRefactory.Utils; using ICSharpCode.TreeView; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { public class TypeDefinitionTreeNode : ModelCollectionTreeNode { + static readonly IComparer TypeMemberNodeComparer = new TypeDefinitionMemberNodeComparer(); ITypeDefinitionModel definition; public TypeDefinitionTreeNode(ITypeDefinitionModel definition) @@ -40,7 +42,7 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser protected override IComparer NodeComparer { get { - return NodeTextComparer; + return TypeMemberNodeComparer; } } @@ -64,6 +66,29 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser var ctx = MenuService.ShowContextMenu(null, entityModel, "/SharpDevelop/EntityContextMenu"); } } + + class TypeDefinitionMemberNodeComparer : IComparer + { + public int Compare(SharpTreeNode x, SharpTreeNode y) + { + var a = x.Model as IMemberModel; + var b = y.Model as IMemberModel; + + if (a == null && b == null) + return NodeTextComparer.Compare(x, y); + if (a == null) + return -1; + if (b == null) + return 1; + + if (a.SymbolKind < b.SymbolKind) + return -1; + if (a.SymbolKind > b.SymbolKind) + return 1; + + return NodeTextComparer.Compare(x, y); + } + } } } From 54eacfa3b2f1144ad3f7ff958640d88b7846e934 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jul 2013 12:58:07 +0200 Subject: [PATCH 15/27] update "open assembly" icons in Class Browser to the new icons suggested by Michael --- .../Icons.16x16.AssemblyFromFile.png | Bin 653 -> 777 bytes .../Icons.16x16.AssemblyFromGAC.png | Bin 625 -> 729 bytes .../Project/ICSharpCode.SharpDevelop.addin | 2 +- .../Resources/BitmapResources.resources | Bin 717672 -> 717900 bytes 4 files changed, 1 insertion(+), 1 deletion(-) diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromFile.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromFile.png index 738b354a4d0680c91a68f12c7ea3141a1b16411c..1c4e382bef47f1d5e71bf3fdecbedf8d8b626b81 100644 GIT binary patch delta 666 zcmV;L0%iS;1&Icbdw&9WNklF7aq>Tc;>Ae=NPV`Jpd27~t zSe>b0xz_{bp?^p#sl}1ZMuEHuA!fik<*`L_p+(q1cLu3fXREL>RnBs+&H7;c8r6%0 z%Brz7Ry(^Px>kG#Pp^|^W!ebGrxKQX-J{uqa#^4sdsq22|@JB`T7crlzV7h128o~wEyQ8h1}dVlExZ>PQ!ExCcP58V`59xKAU z-Hzs~RLoU9*?8Hw5Lh(=-Zpt19w`FwV^A&Pc(20;s})T$Dr1YCL`hxDL)?^9xUkza z4&Dx#5%=YOSRBX~u@4vGV806uX=G#vv@qqLp%Ku;XE@KE&c@+O>DZ@`F|X|;67P87 zLDvZ^ynoJHXJd{L^u&gmRH|kNG%^Dmaf#q*&r4wXny~JoX^ZFxcIF}tN%XKRnZnos zmCS%izYt7#`?HkMn_Y5q7qp0C>S! zBs|yuNyt%(@J*x<{{)&2NT9jxQZjI#{t}|!FcbY3hgpW#&Hw-a07*qoM6N<$g18Vq AZvX%Q delta 541 zcmV+&0^)gO=rl8HA`L?bDbpcnEYiHae; zTuD&|t`k@20;kF>S-y$*ZMwTiivhC8F%BXQc) z^HzsF=UQc@o&g60YM%Ov+5|ta1V?q`K)r87d$Lk7AeuOIcy`I*B&OGPo{raElx*H# zH+RBbIqy8XWq+aBwK3znfkd9ZYv_~%1LCWh${I?c%)q51P$S_oqF?<)ndm=+_j@oV z2clx&yJauUpu|9v6>2zGO1X4|{-%OD>^)bIlmj6#@VUH-CQ)p_aS&?o)&}~Myi317 z-PB><*^VzyU08!2F)&?Xp%JVzaHa<8?LaXtd;(xkie#%Fwp*C{2AQfwZ16^Vu zUb>CO)|MM+sD|3@T~FC@56!)EOZbk*oV1wB(W6HA-~#*?#7H5I?t&V)T0}pFJLs$0 zBH??u|1`~{({%qFy5)aZO+|I^H=e@m&o}LqetlWO_p6YNcE4PtkR5$mb#-}daC=T- fun=Aw_7*Jz7e}H)!vGy300000NkvXXu0mjf+Fl8c diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromGAC.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyFromGAC.png index 52e916f98d371d3f70cbf88cf7a4835e999521f2..d39ab189ee282842107ca7bd74a0c0e00eb2c81c 100644 GIT binary patch delta 617 zcmV-v0+#*p1la|Udw&8*Nkl&Y(oGt+HQBt(&r~R7PD$EfQplnqj#)3(s)QqgZZXx;bs>7`4G}>aM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h+LVW{%6W z(_L~NvVW!P`QA$oGt;ga2dA2~-F;>z9E%r9SX)Q5);gAX4cLwp4I80|UgBW&LHKLLp2ZU6uP From 7dbf90413e956a8b0b7690963bfc8de3212a2c10 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 20 Jul 2013 19:02:22 +0200 Subject: [PATCH 16/27] updated DebugAssembly and DebugModule icons --- .../image/BitmapResources/BitmapList.txt | 1 + .../image/BitmapResources/BitmapResources.res | 1 + .../ClassBrowserIcons/Icons.16x16.Module.png | Bin 727 -> 749 bytes .../Icons.16x16.Debug.Assembly.png | Bin 0 -> 525 bytes .../Pads/ClassBrowserSupport.cs | 2 +- .../Resources/BitmapResources.resources | Bin 717900 -> 718677 bytes 6 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/resources/image/BitmapResources/DebuggerIcons/Icons.16x16.Debug.Assembly.png diff --git a/data/resources/image/BitmapResources/BitmapList.txt b/data/resources/image/BitmapResources/BitmapList.txt index 7c72c13632..bd908cea2a 100644 --- a/data/resources/image/BitmapResources/BitmapList.txt +++ b/data/resources/image/BitmapResources/BitmapList.txt @@ -239,6 +239,7 @@ CodeCoverageIcons\CodeCoverage.Icons.16x16.Pad.png CodeCoverageIcons\CodeCoverage.Icons.16x16.Run.png DebuggerIcons\Icons.16x16.Debug.Start.png DebuggerIcons\Icons.16x16.Debug.StartWithoutDebugging.png +DebuggerIcons\Icons.16x16.Debug.Assembly.png NavigationIcons\Icons.16x16.NavigateBack.disabled.png NavigationIcons\Icons.16x16.NavigateBack.png NavigationIcons\Icons.16x16.NavigateForward.png diff --git a/data/resources/image/BitmapResources/BitmapResources.res b/data/resources/image/BitmapResources/BitmapResources.res index 51f99e517d..e3335e24ed 100644 --- a/data/resources/image/BitmapResources/BitmapResources.res +++ b/data/resources/image/BitmapResources/BitmapResources.res @@ -86,6 +86,7 @@ Icons.16x16.Debug.Continue = DebuggerIcons\Icons.16x16.Debug.Continue.png Icons.16x16.Debug.StepOver = DebuggerIcons\Icons.16x16.Debug.StepOver.png Icons.16x16.Debug.StepInto = DebuggerIcons\Icons.16x16.Debug.StepInto.png Icons.16x16.Debug.StepOut = DebuggerIcons\Icons.16x16.Debug.StepOut.png +Icons.16x16.Debug.Assembly = DebuggerIcons\Icons.16x16.Debug.Assembly.png # TestRunner Icons.16x16.TestRunner.Yellow = BitmapResources-data\Icons.16x16.TestRunner.Yellow.png diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Module.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.Module.png index ce892a1562161fe5db15ee963b3f307bef2feaba..086da4b4551ce99c21808acc1007166f972c7602 100644 GIT binary patch delta 725 zcmV;`0xJF21?>fpB!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000id z000id0mpBsWB>pF8gxZibW?9;ba!ELWdKlNX>N2bPDNB8b~7$DE-^4L^m3s900LY| zL_t(IPh%hmR*5Z0!|iIs z=YSiD|J|;Je+KcPGDL#K!p=Z^CiHIFe-I7k;{^+ZX9DpVWGuc>^QPCO=>LMNm2V=6 z&xGng19OGWgxpE}?{g*gzxU;s{~(PnXF~tm9rOS1b}szC|Mi6bzE|V^gVaHFpn;i! zXWY+6{I@*l1%JoZhkgE=>~eh1*~NVkgiUrjya%a+>Oce21kN~}3jS}h#}$s1R@VP# z>RA7ip?$||hW5Qr8JcsCGPJR#K{QO_cLw4ePz++9u|FR0UvInpf0ebS|D~2_|L5=B z_&?uj z@4w-S+i=XB+xLgLU*ICdfHs~@pb*yGV*44$KEpau=%&zi<^RHS<=@W`Wc>Es#`k}3 zQvJWc;D7pmh6P3cRhtX`8}xhpcU#Q#EqFNt&=t+x&J0c5JHQyiJ|l5N^FMPE>&1EO z3=h5~rv8WF^fb2rE8e8QvCljPEHP2Rc}C={>VKwWmW#8P8LmClu=syRLJN%JlG*+@ z9kqjF$BEbs$Yebucva~?&j!i&*%A!brZO;`X-?#3cwME)^2a-u>wn7$2RJru#AZM& z(@dspwu>Ol5XS@wX&?>ai^MbEmrP^)2EtOQ46jx57-j+hTgyq7Kf^y;00000NkvXX Hu0mjf$**ef delta 703 zcmV;w0zm!k1=j_TB!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0007c zNkl0@R(kIr20y)%P_$bY#xbMBdY?w9X8u7K0> zd=R*%{PP9O(eEPFQK~hn%OKcbN95rzNLZm4^hDnU0dNT*3!zW&^zrRS^PcBHlBDdL z&9@AFBMz7FKM5#+M{R`rqh2#o32nggErXvi@k1lxEMb8?sy%uS$ zOkbLs)HDr25a8YR`#uJYj!i+NuyCDD2kmzIn35=paJpu5=To7={L5FTCwLksQs6oB zwt-cgX)LO$;`_H^wQHF#8TH*Sn>i?QF$S1pt%{f|aew3ca6K26Wx?uNNGeH~M%$rB zYZ2xG4Tu=@$l{&ZyYux%-T1nL>)_`T<`0aGOc)JwCI+Ypf{=9`$0+V> zm*upg>wlA(Nz}Y%WBZ`$H62G9RFdhN!{bBOFJ9rDVe7Y12?xn1%O4Ac4|}E37TrJd zT24pN6*RYM6?%D<#!U5E?rP`rVI@cfAZeObIx0G^0ecwHArDeZ9g%}4!ux!fmRQ`>LYb;c!C!zlpOapx;Tr~@K4P_)sA0ZvGuANR!80{~@EG1^ozeD(kU002ovPDHLkV1m|FMdkni diff --git a/data/resources/image/BitmapResources/DebuggerIcons/Icons.16x16.Debug.Assembly.png b/data/resources/image/BitmapResources/DebuggerIcons/Icons.16x16.Debug.Assembly.png new file mode 100644 index 0000000000000000000000000000000000000000..860aaf96ceedc0b013f91a5cb4ff8a8944aafd2e GIT binary patch literal 525 zcmV+o0`mQdP)N2bPDNB8 zb~7$DE-^4L^m3s900D_fL_t(IPh+4i*v~!_h-08UGQb{|Gf+&XAv+k(=>2f`52AsX z3_~_EoKbvj{9osr-G309VH2r_tYtVO{Z#iq_f^^d>K`rtgZMy9f*~sy&WJzM{LgYu z>_5XXzW*S@7?ubz1h6TmD)l zv{b2|*i{=#H)`KnwY0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NYA_*-q<^a1lD#;zzV2)I@M)n;eEC2M}}K!0=$2%R)DEBK#6-gx7!g$w>8 UVQ4VyFtixyI0Y?BUq5uE@ From c9dae5383230d865a9c59028505aa78fc9b4ae77 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Wed, 17 Jul 2013 22:31:59 +0200 Subject: [PATCH 17/27] Fixed PackageRepositoriesView.xaml being wrongly dependent on PagedResultsView.xaml in AddInManager2 project. --- src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj b/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj index 126a60a00e..c9a4c03a72 100644 --- a/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj +++ b/src/AddIns/Misc/AddInManager2/Project/AddInManager2.csproj @@ -191,9 +191,7 @@ - - PagedResultsView.xaml - + \ No newline at end of file From 8b55c77771990cf08d6a9046416f15094916fb45 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Thu, 18 Jul 2013 00:41:25 +0200 Subject: [PATCH 18/27] Adding AddIns to ClassBrowser, persistence and restoring of ClassBrowser workspace in config. --- src/Main/Base/Project/Dom/IAssemblyModel.cs | 11 ++ .../Base/Project/Dom/IEntityModelContext.cs | 18 +++ src/Main/SharpDevelop/Dom/AssemblyModel.cs | 6 + .../Dom/ClassBrowser/ClassBrowserPad.cs | 148 +++++++++++++++++- .../ClassBrowserTreeNodesFactory.cs | 4 + .../Dom/ClassBrowser/OpenAssemblyCommand.cs | 16 +- 6 files changed, 201 insertions(+), 2 deletions(-) diff --git a/src/Main/Base/Project/Dom/IAssemblyModel.cs b/src/Main/Base/Project/Dom/IAssemblyModel.cs index 11a081dd01..f3df5c2589 100644 --- a/src/Main/Base/Project/Dom/IAssemblyModel.cs +++ b/src/Main/Base/Project/Dom/IAssemblyModel.cs @@ -42,6 +42,11 @@ namespace ICSharpCode.SharpDevelop.Dom /// This always is the namespace without a name - it's unrelated to the 'root namespace' project setting. /// INamespaceModel RootNamespace { get; } + + /// + /// Gets the of this assembly model. + /// + IEntityModelContext Context { get; } } /// @@ -92,6 +97,12 @@ namespace ICSharpCode.SharpDevelop.Dom public INamespaceModel RootNamespace { get { return EmptyNamespaceModel.Instance; } } + + public IEntityModelContext Context { + get { + return null; + } + } } } diff --git a/src/Main/Base/Project/Dom/IEntityModelContext.cs b/src/Main/Base/Project/Dom/IEntityModelContext.cs index 5fe67f32e4..69295ef7b3 100644 --- a/src/Main/Base/Project/Dom/IEntityModelContext.cs +++ b/src/Main/Base/Project/Dom/IEntityModelContext.cs @@ -34,6 +34,16 @@ namespace ICSharpCode.SharpDevelop.Dom /// Returns true if part1 is considered a better candidate for the primary part than part2. /// bool IsBetterPart(IUnresolvedTypeDefinition part1, IUnresolvedTypeDefinition part2); + + /// + /// Short name of current assembly. + /// + string AssemblyName { get; } + + /// + /// Full path and file name of the assembly. Output assembly for projects. + /// + string Location { get; } } public class ProjectEntityModelContext : IEntityModelContext @@ -53,6 +63,10 @@ namespace ICSharpCode.SharpDevelop.Dom get { return project.AssemblyName; } } + public string Location { + get { return project.OutputAssemblyFullPath; } + } + public IProject Project { get { return project; } } @@ -88,6 +102,10 @@ namespace ICSharpCode.SharpDevelop.Dom get { return mainAssembly.AssemblyName; } } + public string Location { + get { return mainAssembly.Location; } + } + public ICompilation GetCompilation() { return compilation; diff --git a/src/Main/SharpDevelop/Dom/AssemblyModel.cs b/src/Main/SharpDevelop/Dom/AssemblyModel.cs index 1cecb2ee50..b10684186e 100644 --- a/src/Main/SharpDevelop/Dom/AssemblyModel.cs +++ b/src/Main/SharpDevelop/Dom/AssemblyModel.cs @@ -50,6 +50,12 @@ namespace ICSharpCode.SharpDevelop.Dom } } + public IEntityModelContext Context { + get { + return context; + } + } + public void Update(IUnresolvedFile oldFile, IUnresolvedFile newFile) { IList old = EmptyList.Instance; diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs index 871bc7a139..168e9f1a59 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs @@ -7,12 +7,26 @@ using System.Collections.Generic; using System.Diagnostics; using System.Windows.Controls; using ICSharpCode.Core.Presentation; +using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.TypeSystem; using ICSharpCode.TreeView; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Workbench; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { + public class PersistedWorkspace + { + public PersistedWorkspace() + { + AssemblyFiles = new List(); + } + + public string Name { get; set; } + public List AssemblyFiles { get; set; } + public bool IsActive { get; set; } + } + class ClassBrowserPad : AbstractPadContent, IClassBrowser { #region IClassBrowser implementation @@ -25,13 +39,19 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser get { return treeView.AssemblyList; } set { treeView.AssemblyList = value; } } - + #endregion + + const string PersistedWorkspaceSetting = "ClassBrowser.Workspaces"; + const string DefaultWorkspaceName = ""; IProjectService projectService; ClassBrowserTreeView treeView; DockPanel panel; ToolBar toolBar; + + List persistedWorkspaces; + PersistedWorkspace activeWorkspace; public ClassBrowserPad() : this(SD.GetRequiredService()) @@ -53,6 +73,9 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser //treeView.ContextMenu = CreateContextMenu("/SharpDevelop/Pads/UnitTestsPad/ContextMenu"); projectService.CurrentSolutionChanged += ProjectServiceCurrentSolutionChanged; ProjectServiceCurrentSolutionChanged(null, null); + + // Load workspaces from configuration + LoadWorkspaces(); } public override void Dispose() @@ -77,6 +100,26 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser treeView.SpecialNodes.Add(new SolutionTreeNode(projectService.CurrentSolution)); } + void AssemblyListCollectionChanged(IReadOnlyCollection removedItems, IReadOnlyCollection addedItems) + { + foreach (var assembly in addedItems) { + // Add this assembly to current workspace + if (activeWorkspace != null) { + activeWorkspace.AssemblyFiles.Add(assembly.Context.Location); + } + } + + foreach (var assembly in removedItems) { + // Add this assembly to current workspace + if (activeWorkspace != null) { + activeWorkspace.AssemblyFiles.Remove(assembly.Context.Location); + } + } + + // Update workspace list in configuration + SaveWorkspaces(); + } + /// /// Virtual method so we can override this method and return /// a dummy ToolBar when testing. @@ -96,5 +139,108 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser Debug.Assert(treeView != null); return MenuService.CreateContextMenu(treeView, name); } + + /// + /// Loads persisted workspaces from configuration. + /// + void LoadWorkspaces() + { + persistedWorkspaces = SD.PropertyService.GetList(PersistedWorkspaceSetting).ToList(); + if (!persistedWorkspaces.Any()) + { + // Add at least default workspace + persistedWorkspaces = new List(); + persistedWorkspaces.Add(new PersistedWorkspace() + { + Name = DefaultWorkspaceName + }); + } + + // Load all assemblies (for now always from default workspace) + PersistedWorkspace defaultWorkspace = persistedWorkspaces.FirstOrDefault(w => w.Name == DefaultWorkspaceName); + ActivateWorkspace(defaultWorkspace); + } + + /// + /// Stores currently saved workspaces in configuration. + /// + void SaveWorkspaces() + { + SD.PropertyService.SetList(PersistedWorkspaceSetting, persistedWorkspaces); + } + + public static IAssemblyModel CreateAssemblyModelFromFile(string fileName) + { + // TODO References? + + var loader = new CecilLoader(); + loader.IncludeInternalMembers = true; + loader.LazyLoad = true; + var assembly = loader.LoadAssemblyFile(fileName); + + IEntityModelContext context = new AssemblyEntityModelContext(assembly); + IAssemblyModel model = SD.GetRequiredService().CreateAssemblyModel(context); + + if (model is IUpdateableAssemblyModel) { + ((IUpdateableAssemblyModel)model).Update(EmptyList.Instance, assembly.TopLevelTypeDefinitions.ToList()); + ((IUpdateableAssemblyModel) model).AssemblyName = assembly.AssemblyName; + } + return model; + } + + void AppendAssemblyFileToList(string assemblyFile) + { + IAssemblyModel assemblyModel = CreateAssemblyModelFromFile(assemblyFile); + if (assemblyModel != null) { + AssemblyList.Assemblies.Add(assemblyModel); + } else { + // TODO Throw exception? + + } + } + + /// + /// Activates the specified workspace. + /// + void ActivateWorkspace(PersistedWorkspace workspace) + { + // Update the activation flags in workspace list + foreach (var workspaceElement in persistedWorkspaces) { + workspaceElement.IsActive = (workspaceElement == workspace); + } + + UpdateActiveWorkspace(); + } + + /// + /// Updates active workspace and AssemblyList according to flags. + /// + void UpdateActiveWorkspace() + { + if ((AssemblyList != null) && (activeWorkspace != null)) { + // Temporarily detach from event handler + AssemblyList.Assemblies.CollectionChanged -= AssemblyListCollectionChanged; + } + + activeWorkspace = persistedWorkspaces.FirstOrDefault(w => w.IsActive); + if (activeWorkspace == null) { + // If no workspace is active, activate default + var defaultWorkspace = persistedWorkspaces.FirstOrDefault(w => w.Name == DefaultWorkspaceName); + activeWorkspace = defaultWorkspace; + defaultWorkspace.IsActive = true; + } + + AssemblyList.Assemblies.Clear(); + if (activeWorkspace != null) { + foreach (string assemblyFile in activeWorkspace.AssemblyFiles) { + AppendAssemblyFileToList(assemblyFile); + } + } + + // Attach to event handler, again. + if (AssemblyList != null) { + AssemblyList.Assemblies.CollectionChanged += AssemblyListCollectionChanged; + } + } } } diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserTreeNodesFactory.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserTreeNodesFactory.cs index c85f22786a..23fe3fcb2f 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserTreeNodesFactory.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserTreeNodesFactory.cs @@ -21,6 +21,8 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser return typeof(ITypeDefinitionModel); if (model is IMemberModel) return typeof(IMemberModel); + if (model is IAssemblyModel) + return typeof(IAssemblyModel); return null; } @@ -36,6 +38,8 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser return new TypeDefinitionTreeNode((ITypeDefinitionModel)model); if (model is IMemberModel) return new MemberTreeNode((IMemberModel)model); + if (model is IAssemblyModel) + return new AssemblyTreeNode((IAssemblyModel) model); return null; } } diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs index 59851280c6..ae67f21e5e 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs @@ -2,6 +2,10 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; +using System.Linq; +using ICSharpCode.NRefactory; +using ICSharpCode.NRefactory.TypeSystem; +using Microsoft.Win32; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { @@ -12,7 +16,17 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { public override void Execute(object parameter) { - throw new NotImplementedException(); + var classBrowser = SD.GetService(); + if (classBrowser != null) { + OpenFileDialog openFileDialog = new OpenFileDialog(); + openFileDialog.Filter = "Assembly files (*.exe, *.dll)|*.exe;*.dll"; + openFileDialog.CheckFileExists = true; + openFileDialog.CheckPathExists = true; + if (openFileDialog.ShowDialog() ?? false) + { + classBrowser.AssemblyList.Assemblies.Add(ClassBrowserPad.CreateAssemblyModelFromFile(openFileDialog.FileName)); + } + } } } From 0a9c01d948c69f32df6a3ac1976d941c7f2e2d75 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Sun, 21 Jul 2013 11:17:18 +0200 Subject: [PATCH 19/27] Context menu for removing assemblies from ClassBrowser workspace. --- .../Dom/ClassBrowser/AssemblyTreeNode.cs | 9 ++++ .../Project/ICSharpCode.SharpDevelop.addin | 19 +++++--- .../Dom/ClassBrowser/ClassBrowserPad.cs | 2 - .../{OpenAssemblyCommand.cs => Commands.cs} | 43 +++++++++++++++++-- src/Main/SharpDevelop/SharpDevelop.csproj | 2 +- 5 files changed, 63 insertions(+), 12 deletions(-) rename src/Main/SharpDevelop/Dom/ClassBrowser/{OpenAssemblyCommand.cs => Commands.cs} (52%) diff --git a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs index ea114cacd0..b6f382bba4 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using ICSharpCode.Core.Presentation; using ICSharpCode.TreeView; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser @@ -46,6 +47,14 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser return SD.ResourceService.GetImageSource("Icons.16x16.Assembly"); } } + + public override void ShowContextMenu() + { + var assemblyModel = this.Model as IAssemblyModel; + if (assemblyModel != null) { + var ctx = MenuService.ShowContextMenu(null, assemblyModel, "/SharpDevelop/Pads/ClassBrowser/AssemblyContextMenu"); + } + } } } diff --git a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin index 11f96b3077..ba134100d2 100755 --- a/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin +++ b/src/Main/Base/Project/ICSharpCode.SharpDevelop.addin @@ -908,7 +908,7 @@ - - + --> + class = "ICSharpCode.SharpDevelop.Dom.ClassBrowser.OpenAssemblyFromFileCommand"/> + class = "ICSharpCode.SharpDevelop.Dom.ClassBrowser.OpenAssemblyFromGACCommand"/> - + class = "ICSharpCode.SharpDevelop.Dom.ClassBrowser.ClassBrowserCollapseAll"/>--> @@ -988,6 +988,13 @@ class = "ICSharpCode.SharpDevelop.Gui.ClassBrowser.ClassBrowserCancelSearch"/> + + + + diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs index 168e9f1a59..da5865ec00 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs @@ -171,8 +171,6 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public static IAssemblyModel CreateAssemblyModelFromFile(string fileName) { - // TODO References? - var loader = new CecilLoader(); loader.IncludeInternalMembers = true; loader.LazyLoad = true; diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs similarity index 52% rename from src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs rename to src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs index ae67f21e5e..17ce0e73f1 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenAssemblyCommand.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs @@ -2,9 +2,8 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; +using System.IO; using System.Linq; -using ICSharpCode.NRefactory; -using ICSharpCode.NRefactory.TypeSystem; using Microsoft.Win32; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser @@ -24,7 +23,11 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser openFileDialog.CheckPathExists = true; if (openFileDialog.ShowDialog() ?? false) { + try { classBrowser.AssemblyList.Assemblies.Add(ClassBrowserPad.CreateAssemblyModelFromFile(openFileDialog.FileName)); + } catch (BadImageFormatException ex) { + SD.MessageService.ShowWarningFormatted("{0} is not a valid .NET assembly.", Path.GetFileName(openFileDialog.FileName)); + } } } } @@ -37,7 +40,41 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { public override void Execute(object parameter) { - throw new NotImplementedException(); +// throw new NotImplementedException(); + } + } + + /// + /// Description of RemoveAssemblyCommand. + /// + class RemoveAssemblyCommand : SimpleCommand + { + public override bool CanExecute(object parameter) + { + return parameter is AssemblyModel; + } + + public override void Execute(object parameter) + { + var classBrowser = SD.GetService(); + if (classBrowser != null) { + IAssemblyModel assemblyModel = (IAssemblyModel) parameter; + classBrowser.AssemblyList.Assemblies.Remove(assemblyModel); + } + } + } + + /// + /// Description of RemoveAssemblyCommand. + /// + class ClassBrowserCollapseAllCommand : SimpleCommand + { + public override void Execute(object parameter) + { +// var classBrowser = SD.GetService() as ClassBrowserPad; +// if (classBrowser != null) { +// classBrowser.TreeView +// } } } } diff --git a/src/Main/SharpDevelop/SharpDevelop.csproj b/src/Main/SharpDevelop/SharpDevelop.csproj index d62dcd7030..20ff169f9d 100644 --- a/src/Main/SharpDevelop/SharpDevelop.csproj +++ b/src/Main/SharpDevelop/SharpDevelop.csproj @@ -108,7 +108,7 @@ - + From 26ee58a5d8a01d492885d076cae2b10a87f9a4f0 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 21 Jul 2013 12:19:55 +0200 Subject: [PATCH 20/27] add Icons.16x16.AssemblyError and Icons.16x16.ModuleError --- .../image/BitmapResources/BitmapList.txt | 13 +++++++------ .../image/BitmapResources/BitmapResources.res | 2 ++ .../Icons.16x16.AssemblyError.png | Bin 0 -> 713 bytes .../Icons.16x16.ModuleError.png | Bin 0 -> 822 bytes .../Resources/BitmapResources.resources | Bin 718677 -> 720684 bytes 5 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyError.png create mode 100644 data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.ModuleError.png diff --git a/data/resources/image/BitmapResources/BitmapList.txt b/data/resources/image/BitmapResources/BitmapList.txt index bd908cea2a..bf111d6f0d 100644 --- a/data/resources/image/BitmapResources/BitmapList.txt +++ b/data/resources/image/BitmapResources/BitmapList.txt @@ -140,7 +140,9 @@ SharpQueryIcons\Icons.16x16.SharpQuery.Column.png SharpQueryIcons\Icons.16x16.SharpQuery.NodeError.png SharpQueryIcons\Icons.16x16.SharpQuery.Remove.png SharpQueryIcons\Icons.16x16.SharpQuery.Table.png - +ClassBrowserIcons\Icons.16x16.Workspace.png +ClassBrowserIcons\Icons.16x16.Assembly.png +ClassBrowserIcons\Icons.16x16.AssemblyError.png ------------------------------------------------------------------------------- Copied from the Fugue Icon Library and modified or mashed up with other Fugue @@ -240,6 +242,10 @@ CodeCoverageIcons\CodeCoverage.Icons.16x16.Run.png DebuggerIcons\Icons.16x16.Debug.Start.png DebuggerIcons\Icons.16x16.Debug.StartWithoutDebugging.png DebuggerIcons\Icons.16x16.Debug.Assembly.png +ClassBrowserIcons\Icons.16x16.Module.png +ClassBrowserIcons\Icons.16x16.ModuleError.png +ClassBrowserIcons\Icons.16x16.AssemblyFromFile.png +ClassBrowserIcons\Icons.16x16.AssemblyFromGAC.png NavigationIcons\Icons.16x16.NavigateBack.disabled.png NavigationIcons\Icons.16x16.NavigateBack.png NavigationIcons\Icons.16x16.NavigateForward.png @@ -556,11 +562,6 @@ ClassBrowserIcons\Icons.16x16.NameSpace.png ClassBrowserIcons\Icons.16x16.Operator.png ClassBrowserIcons\Icons.16x16.Parameter.png ClassBrowserIcons\Icons.16x16.Struct.png -ClassBrowserIcons\Icons.16x16.Workspace.png -ClassBrowserIcons\Icons.16x16.Assembly.png -ClassBrowserIcons\Icons.16x16.Module.png -ClassBrowserIcons\Icons.16x16.AssemblyFromFile.png -ClassBrowserIcons\Icons.16x16.AssemblyFromGAC.png ------------------------------------------------------------------------------- Left original (other source than Fugue Iconlibrary) diff --git a/data/resources/image/BitmapResources/BitmapResources.res b/data/resources/image/BitmapResources/BitmapResources.res index e3335e24ed..7946ddfdb6 100644 --- a/data/resources/image/BitmapResources/BitmapResources.res +++ b/data/resources/image/BitmapResources/BitmapResources.res @@ -298,7 +298,9 @@ Icons.16x16.AssemblyFromGAC = ClassBrowserIcons\Icons.16x16.AssemblyFromGA Icons.16x16.Workspace = ClassBrowserIcons\Icons.16x16.Workspace.png Icons.16x16.Assembly = ClassBrowserIcons\Icons.16x16.Assembly.png +Icons.16x16.AssemblyError = ClassBrowserIcons\Icons.16x16.AssemblyError.png Icons.16x16.Module = ClassBrowserIcons\Icons.16x16.Module.png +Icons.16x16.ModuleError = ClassBrowserIcons\Icons.16x16.ModuleError.png Icons.16x16.NameSpace = ClassBrowserIcons\Icons.16x16.NameSpace.png Icons.16x16.Literal = ClassBrowserIcons\Icons.16x16.Literal.png Icons.16x16.Reference = ClassBrowserIcons\Icons.16x16.Reference.png diff --git a/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyError.png b/data/resources/image/BitmapResources/ClassBrowserIcons/Icons.16x16.AssemblyError.png new file mode 100644 index 0000000000000000000000000000000000000000..01566b5f5e884f9d717758170be7b108c10fdccc GIT binary patch literal 713 zcmV;)0yh1LP)%j!!{k<3j30b51Zdh)b@(Jf z&gF7&6~~yoVQtj!^{x*3gL}G73;Wo)O#I-pyGYzQPdwF?Z5Rej({yB;8oJHL*b<3~ z1ILnRZQr%gGP%R10f7XbrO}&zi^RQ4F2K?$69!?5m>G1maFF>qK9x$LQvRVxzRt~b z`fl9?IFN7ekhp&tsHm2v>(EICDQ-Q&`d|yD=U!su!37l5DTskk7qO2}nB#5W0BM4$ zXZrobz<63=KuMC&C1w%v70@Dmgv1xo*MAj0@egEQwN>=Wy#(1IP!=cSef^!GSS-Lc zelIpbA6~qrP0^$tJ17dPc$+(>S*0!e*<14rIiprpjmmsUP)w){0F8=AWvlN8e40hRdF!?|MNv>HmHzo@Ej)aY z&czmRMqu5b5N2bPDNB8 zb~7$DE-^4L^m3s900Oc}L_t(IPmPd$NK;`Hhu^!+scn{<8Z-aMTth9COam>a=29bF zAK1bujr=N+i3CDfWKI!G+%hU#xuF~A%7nE{mlhFhYI-ea&RQy3lwulM>g*5kbob#9 z5%htF^ShjT4u=V&zAM-xe= zYs4t_U)E6TAtl6DJfv_lHMIvX{`qkOh%QWgxeN_2eCHDs^k&<@T4YT8^l%m=4WvS1 z|2e2^;ec`AJbeBX4=#ls)cC@f zDHcYIq1Fp5b;KA3GL_qWiyS*>8(Pf+cRaQ`8Ny!2!L529=;`FZYbkDVhj&XD_>*y=D~D%ilN^Rr61{uqLkgAP%Fd=`~ZvTY~dcEh>);}F_@ z1R`~O*#CwHj7C53c(xnP=CGiK?E;j1F@&gw9Fm3NC9=fbU|Uc|*F<%kfS_jX9FcLS zDyE6q$_5YF&Y6b{%)A)MhsyM#7yJTu3B$FjuXx>`Tga7~l07*qoM6N<$f<$s? Aa{vGU literal 0 HcmV?d00001 diff --git a/src/Main/SharpDevelop/Resources/BitmapResources.resources b/src/Main/SharpDevelop/Resources/BitmapResources.resources index 3e0c7009f52f17f35321638fbf72697d43904c1c..a449ace4db25361fca5d7853781dcaaa84b5ec5e 100644 GIT binary patch delta 9187 zcmZ8m30zdw_dnb>Zy3g57!hzBZ~z5mkxfuUKz0yi2R9JeMG+8CL{VAX$Tj3@T9!(= zw9h|!pZD&)XZfD*IrrQPp1kG0`GtF9vzdVr z;eQ&#%U4@}vhOQ}uzujl9aF`6LDAiN<5>Pob*XmNXd-1SQLvimD85ay@hFIvgb|&` z+`++^A4^o&h3K>|(V=i62N(@XC;BRasN)c#ztf09Vu^bef9TTFB{mFV0AfWWw+jA)erT{zs}OtfVL(KyH|EQsF6`-C^_h(sfeL|grc zboNC4csRi1Wz-TKz~H1m(GWc%N0f#E5R4{T0EFqDM8*K3sU}3%Oo>JfBZ{mb%Ir+k zH-Ts&j9TXs&F=sf0ipsd98ZRgJ^&g=^kE>;QzcPNCe{G#4@9pvC;HlvXgpY6TMOZ8 zJYS3XFbx(fNL=}5E~ zQH25ZUI;saox>RKK%P}#pdLD(fTa&Q5#7W3XD$Gqg*CiYNM$R&ox#leV8NBZ7=SM- zC9*?JZ5s$+cqfO$XDRaU0AvwR$SNf2K9cAZl(G=flq67!+?FF}A7DKb0DVBA0a0|o z+)fl#93rkOBKifaT(^Rw!9*;6u5&XCz&D8Q&=8`F zi1r#7cn9^d4MqFD8<7ik&w1$l3oz@Vz+?r+VD2^oHm${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#@m{9A4rR=i@FS*$+B8<(ZZp&#mT`YJ|y{j5TqV$)s0y4rKFRRUeB zcliDGrJk%4lpviE_wox~0TcBsk>c zQrUpKs+ZgNdVp3W8F=_f*b`Nr}@;TZyz{)|Ie-Wp-R zWUocUrM?03Yq74ClMnbh<$H!0@M*KQ+sVKC4wiSO8!)-bYIyem5tYMJyCX$jA+PGr z6u*td%E9LYE#mo!>Z9*H77;&ON+}BmkyVH@8lzf_Y(deMUst? From a99aa0e46858990e66a09414cb60973750ddfc1f Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Sun, 21 Jul 2013 13:47:01 +0200 Subject: [PATCH 21/27] ClassBrowser: Handling saved but inaccessible assemblies, showing warning icon at assembly item. --- .../Dom/ClassBrowser/AssemblyTreeNode.cs | 6 +- .../Base/Project/Dom/IEntityModelContext.cs | 13 +++ .../Dom/ClassBrowser/ClassBrowserPad.cs | 83 ++++++++++++++++--- .../SharpDevelop/Dom/ClassBrowser/Commands.cs | 4 - 4 files changed, 90 insertions(+), 16 deletions(-) diff --git a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs index b6f382bba4..ff499c969f 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/AssemblyTreeNode.cs @@ -44,7 +44,11 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public override object Icon { get { - return SD.ResourceService.GetImageSource("Icons.16x16.Assembly"); + if (model.Context.IsValid) { + return SD.ResourceService.GetImageSource("Icons.16x16.Assembly"); + } else { + return SD.ResourceService.GetImageSource("Icons.16x16.AssemblyError"); + } } } diff --git a/src/Main/Base/Project/Dom/IEntityModelContext.cs b/src/Main/Base/Project/Dom/IEntityModelContext.cs index 69295ef7b3..542c87d107 100644 --- a/src/Main/Base/Project/Dom/IEntityModelContext.cs +++ b/src/Main/Base/Project/Dom/IEntityModelContext.cs @@ -44,6 +44,11 @@ namespace ICSharpCode.SharpDevelop.Dom /// Full path and file name of the assembly. Output assembly for projects. /// string Location { get; } + + /// + /// Returns whether this is a valid context (based on a existing and readable definition). + /// + bool IsValid { get; } } public class ProjectEntityModelContext : IEntityModelContext @@ -80,6 +85,10 @@ namespace ICSharpCode.SharpDevelop.Dom { return EntityModelContextUtils.IsBetterPart(part1, part2, primaryCodeFileExtension); } + + public bool IsValid { + get { return true; } + } } public class AssemblyEntityModelContext : IEntityModelContext @@ -119,6 +128,10 @@ namespace ICSharpCode.SharpDevelop.Dom public IProject Project { get { return null; } } + + public bool IsValid { + get { return true; } + } } public static class EntityModelContextUtils diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs index da5865ec00..891508f62b 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/ClassBrowserPad.cs @@ -2,13 +2,16 @@ // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) using System; +using System.IO; using System.Linq; using System.Collections.Generic; using System.Diagnostics; using System.Windows.Controls; +using ICSharpCode.Core; using ICSharpCode.Core.Presentation; using ICSharpCode.NRefactory; using ICSharpCode.NRefactory.TypeSystem; +using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.TreeView; using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Workbench; @@ -27,6 +30,50 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public bool IsActive { get; set; } } + class UnresolvedAssemblyEntityModelContext : IEntityModelContext + { + string assemblyName; + string location; + + public UnresolvedAssemblyEntityModelContext(string assemblyName, string location) + { + this.assemblyName = assemblyName; + this.location = location; + } + + public ICompilation GetCompilation() + { + return null; + } + + public bool IsBetterPart(IUnresolvedTypeDefinition part1, IUnresolvedTypeDefinition part2) + { + return false; + } + + public IProject Project { + get { + return null; + } + } + + public string AssemblyName { + get { + return assemblyName; + } + } + + public string Location { + get { + return location; + } + } + + public bool IsValid { + get { return false; } + } + } + class ClassBrowserPad : AbstractPadContent, IClassBrowser { #region IClassBrowser implementation @@ -171,19 +218,33 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser public static IAssemblyModel CreateAssemblyModelFromFile(string fileName) { - var loader = new CecilLoader(); - loader.IncludeInternalMembers = true; - loader.LazyLoad = true; - var assembly = loader.LoadAssemblyFile(fileName); - - IEntityModelContext context = new AssemblyEntityModelContext(assembly); - IAssemblyModel model = SD.GetRequiredService().CreateAssemblyModel(context); + try { + var loader = new CecilLoader(); + loader.IncludeInternalMembers = true; + loader.LazyLoad = true; + var assembly = loader.LoadAssemblyFile(fileName); + + IEntityModelContext context = new AssemblyEntityModelContext(assembly); + IAssemblyModel model = SD.GetRequiredService().CreateAssemblyModel(context); + if (model is IUpdateableAssemblyModel) { + ((IUpdateableAssemblyModel)model).Update(EmptyList.Instance, assembly.TopLevelTypeDefinitions.ToList()); + ((IUpdateableAssemblyModel) model).AssemblyName = assembly.AssemblyName; + } + return model; + } catch (BadImageFormatException ex) { + SD.MessageService.ShowWarningFormatted("{0} is not a valid .NET assembly.", Path.GetFileName(fileName)); + } catch (FileNotFoundException ex) { + SD.MessageService.ShowWarningFormatted("{0} is not accessible or doesn't exist anymore.", fileName); + } - if (model is IUpdateableAssemblyModel) { - ((IUpdateableAssemblyModel)model).Update(EmptyList.Instance, assembly.TopLevelTypeDefinitions.ToList()); - ((IUpdateableAssemblyModel) model).AssemblyName = assembly.AssemblyName; + // AssemblyModel for unresolved file references + IEntityModelContext unresolvedContext = new UnresolvedAssemblyEntityModelContext(Path.GetFileName(fileName), fileName); + IAssemblyModel unresolvedModel = SD.GetRequiredService().CreateAssemblyModel(unresolvedContext); + if (unresolvedModel is IUpdateableAssemblyModel) { + ((IUpdateableAssemblyModel) unresolvedModel).AssemblyName = unresolvedContext.AssemblyName; } - return model; + + return unresolvedModel; } void AppendAssemblyFileToList(string assemblyFile) diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs index 17ce0e73f1..3287d4e4f9 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs @@ -23,11 +23,7 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser openFileDialog.CheckPathExists = true; if (openFileDialog.ShowDialog() ?? false) { - try { classBrowser.AssemblyList.Assemblies.Add(ClassBrowserPad.CreateAssemblyModelFromFile(openFileDialog.FileName)); - } catch (BadImageFormatException ex) { - SD.MessageService.ShowWarningFormatted("{0} is not a valid .NET assembly.", Path.GetFileName(openFileDialog.FileName)); - } } } } From a20d94f6a750181b780e720a56d542e0f93eaa79 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 21 Jul 2013 18:13:57 +0200 Subject: [PATCH 22/27] reactivate DefinitionViewPad --- .../Project/Src/Gui/Pads/DefinitionViewPad.cs | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs b/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs index dfcdd1b60a..fe5ded64f1 100755 --- a/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/DefinitionViewPad.cs @@ -6,7 +6,7 @@ using System.IO; using System.Threading.Tasks; using System.Windows; -using ICSharpCode.AvalonEdit; +using System.Windows.Threading; using ICSharpCode.AvalonEdit.Document; using ICSharpCode.AvalonEdit.Highlighting; using ICSharpCode.Core; @@ -24,14 +24,13 @@ namespace ICSharpCode.SharpDevelop.Gui public class DefinitionViewPad : AbstractPadContent { AvalonEdit.TextEditor ctl; + DispatcherTimer timer; /// /// The control representing the pad /// public override object Control { - get { - return ctl; - } + get { return ctl; } } /// @@ -42,8 +41,11 @@ namespace ICSharpCode.SharpDevelop.Gui ctl = Editor.AvalonEditTextEditorAdapter.CreateAvalonEditInstance(); ctl.IsReadOnly = true; ctl.MouseDoubleClick += OnDoubleClick; - throw new NotImplementedException(); - //ParserService.ParserUpdateStepFinished += OnParserUpdateStep; + SD.ParserService.ParseInformationUpdated += OnParserUpdateStep; + SD.ParserService.LoadSolutionProjectsThread.Finished += LoadThreadFinished; + timer = new DispatcherTimer(DispatcherPriority.Background) { Interval = TimeSpan.FromSeconds(2) }; + timer.Tick += delegate { UpdateTick(null); }; + timer.IsEnabled = !SD.ParserService.LoadSolutionProjectsThread.IsRunning; ctl.IsVisibleChanged += delegate { UpdateTick(null); }; } @@ -52,47 +54,55 @@ namespace ICSharpCode.SharpDevelop.Gui /// public override void Dispose() { - //ParserService.ParserUpdateStepFinished -= OnParserUpdateStep; + SD.ParserService.ParseInformationUpdated -= OnParserUpdateStep; + SD.ParserService.LoadSolutionProjectsThread.Finished -= LoadThreadFinished; ctl.Document = null; base.Dispose(); } void OnDoubleClick(object sender, EventArgs e) { - string fileName = currentFileName; + FileName fileName = currentFileName; if (fileName != null) { var caret = ctl.TextArea.Caret; - FileService.JumpToFilePosition(fileName, caret.Line, caret.Column); + SD.FileService.JumpToFilePosition(fileName, caret.Line, caret.Column); // refresh DefinitionView to show the definition of the expression that was double-clicked UpdateTick(null); } } - void OnParserUpdateStep(object sender, ParserUpdateStepEventArgs e) + void LoadThreadFinished(object sender, EventArgs e) + { + timer.IsEnabled = true; + UpdateTick(null); + } + + void OnParserUpdateStep(object sender, ParseInformationEventArgs e) { UpdateTick(e); } - async void UpdateTick(ParserUpdateStepEventArgs e) + async void UpdateTick(ParseInformationEventArgs e) { + timer.IsEnabled = ctl.IsVisible; if (!ctl.IsVisible) return; LoggingService.Debug("DefinitionViewPad.Update"); ResolveResult res = await ResolveAtCaretAsync(e); if (res == null) return; var pos = res.GetDefinitionRegion(); - if (pos.IsEmpty) return; + if (pos.IsEmpty) return; // TODO : try to decompile? OpenFile(pos); } - Task ResolveAtCaretAsync(ParserUpdateStepEventArgs e) + Task ResolveAtCaretAsync(ParseInformationEventArgs e) { IWorkbenchWindow window = SD.Workbench.ActiveWorkbenchWindow; - if (window == null) + if (window == null) return Task.FromResult(null); IViewContent viewContent = window.ActiveViewContent; - if (viewContent == null) + if (viewContent == null) return Task.FromResult(null); ITextEditor editor = viewContent.GetService(); if (editor == null) @@ -107,14 +117,14 @@ namespace ICSharpCode.SharpDevelop.Gui } DomRegion oldPosition; - string currentFileName; + FileName currentFileName; void OpenFile(DomRegion pos) { if (pos.Equals(oldPosition)) return; oldPosition = pos; if (pos.FileName != currentFileName) - LoadFile(pos.FileName); + LoadFile(new FileName(pos.FileName)); ctl.TextArea.Caret.Location = pos.Begin; Rect r = ctl.TextArea.Caret.CalculateCaretRectangle(); if (!r.IsEmpty) { @@ -126,7 +136,7 @@ namespace ICSharpCode.SharpDevelop.Gui /// Loads the file from the corresponding text editor window if it is /// open otherwise the file is loaded from the file system. /// - void LoadFile(string fileName) + void LoadFile(FileName fileName) { // Load the text into the definition view's text editor. ctl.Document = new TextDocument(SD.FileService.GetFileContent(fileName)); From 7b11528926304612176ca20fad2c7f97eafdb9e0 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Mon, 22 Jul 2013 23:37:21 +0200 Subject: [PATCH 23/27] ClassBrowser: Changed sorting of nodes in workspace, now sorting solution before custom assemblies. --- .../Dom/ClassBrowser/WorkspaceTreeNode.cs | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs b/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs index d9e14d24b6..0a7117eb12 100644 --- a/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs +++ b/src/Main/Base/Project/Dom/ClassBrowser/WorkspaceTreeNode.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using ICSharpCode.NRefactory.Utils; using ICSharpCode.TreeView; namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser @@ -13,7 +14,25 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser /// public class WorkspaceTreeNode : ModelCollectionTreeNode { + class WorkspaceChildComparer : IComparer + { + IComparer stringComparer = StringComparer.OrdinalIgnoreCase; + + public int Compare(SharpTreeNode x, SharpTreeNode y) + { + // Solution node has precedence over other nodes + if ((x is SolutionTreeNode) && !(y is SolutionTreeNode)) + return -1; + if (!(x is SolutionTreeNode) && (y is SolutionTreeNode)) + return 1; + + // Both nodes are solutions or not solutions, compare their Text property + return stringComparer.Compare(x.Text.ToString(), y.Text.ToString()); + } + } + WorkspaceModel workspace; + protected static readonly IComparer ChildNodeComparer = new WorkspaceChildComparer(); public IMutableModelCollection SpecialNodes { get { return workspace.SpecialNodes; } @@ -40,7 +59,7 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser } protected override IComparer NodeComparer { - get { return NodeTextComparer; } + get { return ChildNodeComparer; } } public override object Text { @@ -62,7 +81,9 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser protected override void InsertSpecialNodes() { - Children.AddRange(workspace.SpecialNodes); + foreach (var node in workspace.SpecialNodes) { + Children.OrderedInsert(node, ChildNodeComparer); + } } void SpecialNodesModelCollectionChanged(IReadOnlyCollection removedItems, IReadOnlyCollection addedItems) From 33addc93531eabe55e7900569f806185b3f703dc Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Tue, 23 Jul 2013 00:59:31 +0200 Subject: [PATCH 24/27] Adding of custom assemblies to ClassBrowser from GAC through OpenFromGacDialog. --- .../SharpDevelop/Dom/ClassBrowser/Commands.cs | 11 +- .../Dom/ClassBrowser/OpenFromGacDialog.xaml | 46 +++++ .../ClassBrowser/OpenFromGacDialog.xaml.cs | 188 ++++++++++++++++++ src/Main/SharpDevelop/SharpDevelop.csproj | 5 + 4 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml create mode 100644 src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml.cs diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs index 3287d4e4f9..7496f03f0b 100644 --- a/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/Commands.cs @@ -36,7 +36,16 @@ namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser { public override void Execute(object parameter) { -// throw new NotImplementedException(); + var classBrowser = SD.GetService(); + if (classBrowser != null) { + OpenFromGacDialog gacDialog = new OpenFromGacDialog(); + if (gacDialog.ShowDialog() ?? false) + { + foreach (string assemblyFile in gacDialog.SelectedFileNames) { + classBrowser.AssemblyList.Assemblies.Add(ClassBrowserPad.CreateAssemblyModelFromFile(assemblyFile)); + } + } + } } } diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml new file mode 100644 index 0000000000..ae78f0982f --- /dev/null +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml.cs b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml.cs new file mode 100644 index 0000000000..a13572bcf2 --- /dev/null +++ b/src/Main/SharpDevelop/Dom/ClassBrowser/OpenFromGacDialog.xaml.cs @@ -0,0 +1,188 @@ +// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Threading; +using ICSharpCode.Core.Presentation; +using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Parser; + +namespace ICSharpCode.SharpDevelop.Dom.ClassBrowser +{ + /// + /// Interaction logic for OpenFromGacDialog.xaml + /// + public partial class OpenFromGacDialog : Window + { + ObservableCollection gacEntries = new ObservableCollection(); + ObservableCollection filteredEntries = new ObservableCollection(); + Predicate filterMethod = _ => true; + volatile bool cancelFetchThread; + + public OpenFromGacDialog() + { + InitializeComponent(); + FormLocationHelper.ApplyWindow(this, "ICSharpCode.SharpDevelop.Dom.OpenFromGacDialog.Bounds", true); + listView.ItemsSource = filteredEntries; + SortableGridViewColumn.SetCurrentSortColumn(listView, nameColumn); + SortableGridViewColumn.SetSortDirection(listView, ColumnSortDirection.Ascending); + + new Thread(new ThreadStart(FetchGacContents)).Start(); + } + + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + cancelFetchThread = true; + } + + #region Fetch Gac Contents + sealed class GacEntry + { + readonly DomAssemblyName r; + readonly string fileName; + string formattedVersion; + + public GacEntry(DomAssemblyName r, string fileName) + { + this.r = r; + this.fileName = fileName; + } + + public string FullName { + get { return r.FullName; } + } + + public string ShortName { + get { return r.ShortName; } + } + + public string FileName { + get { return fileName; } + } + + public Version Version { + get { return r.Version; } + } + + public string FormattedVersion { + get { + if (formattedVersion == null) + formattedVersion = Version.ToString(); + return formattedVersion; + } + } + + public string Culture { + get { return r.Culture; } + } + + public string PublicKeyToken { + get { + StringBuilder s = new StringBuilder(); + foreach (byte b in r.PublicKeyToken) + s.Append(b.ToString("x2")); + return s.ToString(); + } + } + + public override string ToString() + { + return r.FullName; + } + } + + void FetchGacContents() + { + IGlobalAssemblyCacheService gacService = SD.GetService(); + HashSet fullNames = new HashSet(); + UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Visible; pg.IsIndeterminate = true; }); + var list = gacService.Assemblies.TakeWhile(_ => !cancelFetchThread).ToList(); + UpdateProgressBar(pg => { pg.IsIndeterminate = false; pg.Maximum = list.Count; }); + foreach (var r in list) { + if (cancelFetchThread) + break; + if (fullNames.Add(r.FullName)) { // filter duplicates + var file = gacService.FindAssemblyInNetGac(r); + if (file != null) { + var entry = new GacEntry(r, file); + UpdateProgressBar(pg => { pg.Value = pg.Value + 1; AddNewEntry(entry); }); + } + } + } + UpdateProgressBar(pg => { pg.Visibility = System.Windows.Visibility.Hidden; }); + } + + void UpdateProgressBar(Action updateAction) + { + Dispatcher.BeginInvoke(DispatcherPriority.Normal, (Action)(() => updateAction(gacReadingProgressBar))); + } + + void AddNewEntry(GacEntry entry) + { + gacEntries.Add(entry); + if (filterMethod(entry)) + filteredEntries.Add(entry); + } + #endregion + + void FilterTextBox_TextChanged(object sender, TextChangedEventArgs e) + { + string filterString = filterTextBox.Text.Trim(); + if (filterString.Length == 0) + filterMethod = _ => true; + else { + var elements = filterString.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + filterMethod = entry => elements.All(el => Contains(entry.FullName, el) || Contains(entry.FormattedVersion, el)); + } + + filteredEntries.Clear(); + filteredEntries.AddRange(gacEntries.Where(entry => filterMethod(entry))); + } + + static bool Contains(string s, string subString) + { + return s.IndexOf(subString, StringComparison.OrdinalIgnoreCase) >= 0; + } + + void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + okButton.IsEnabled = listView.SelectedItems.Count > 0; + } + + void OKButton_Click(object sender, RoutedEventArgs e) + { + this.DialogResult = true; + Close(); + } + + public string[] SelectedFileNames { + get { + return listView.SelectedItems.OfType().Select(e => e.FileName).ToArray(); + } + } + } +} \ No newline at end of file diff --git a/src/Main/SharpDevelop/SharpDevelop.csproj b/src/Main/SharpDevelop/SharpDevelop.csproj index 20ff169f9d..8eed81e197 100644 --- a/src/Main/SharpDevelop/SharpDevelop.csproj +++ b/src/Main/SharpDevelop/SharpDevelop.csproj @@ -109,6 +109,10 @@ + + OpenFromGacDialog.xaml + Code + @@ -331,6 +335,7 @@ + From 724d5c4de548f32b3424815278a301948fb0b370 Mon Sep 17 00:00:00 2001 From: Andreas Weizel Date: Tue, 23 Jul 2013 01:11:27 +0200 Subject: [PATCH 25/27] When "rename symbol" dialog is opened, contents of name TextBox are selected to quickly overwrite them by typing. --- .../Base/Project/Src/Editor/Dialogs/RenameSymbolDialog.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Main/Base/Project/Src/Editor/Dialogs/RenameSymbolDialog.xaml.cs b/src/Main/Base/Project/Src/Editor/Dialogs/RenameSymbolDialog.xaml.cs index 16a71c429e..580ea9ff5f 100644 --- a/src/Main/Base/Project/Src/Editor/Dialogs/RenameSymbolDialog.xaml.cs +++ b/src/Main/Base/Project/Src/Editor/Dialogs/RenameSymbolDialog.xaml.cs @@ -42,6 +42,7 @@ namespace ICSharpCode.SharpDevelop.Editor.Dialogs // Set focus into TextBox this.symbolNameTextBox.Focus(); + this.IsVisibleChanged += (sender, e) => this.symbolNameTextBox.SelectAll(); } public string OldSymbolName From 35a81d3eb4546bf01c99c3b36f6d6d61823ee8d8 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 30 May 2013 16:03:56 +0200 Subject: [PATCH 26/27] Caret movement: don't stop between a base character and its combining mark (within a single grapheme) --- .../Document/TextUtilities.cs | 97 ++++++++++++------- .../SingleCharacterElementGenerator.cs | 4 +- .../Rendering/VisualLine.cs | 13 ++- 3 files changed, 76 insertions(+), 38 deletions(-) diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs index 9780436238..2da8a9badc 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Document/TextUtilities.cs @@ -14,7 +14,7 @@ namespace ICSharpCode.AvalonEdit.Document public enum CaretPositioningMode { /// - /// Normal positioning (stop at every caret position) + /// Normal positioning (stop after every grapheme) /// Normal, /// @@ -32,7 +32,12 @@ namespace ICSharpCode.AvalonEdit.Document /// /// Stop only on word borders, and anywhere in the middle of symbols. /// - WordBorderOrSymbol + WordBorderOrSymbol, + /// + /// Stop between every Unicode codepoint, even within the same grapheme. + /// This is used to implement deleting the previous grapheme when Backspace is pressed. + /// + EveryCodepoint } /// @@ -199,37 +204,43 @@ namespace ICSharpCode.AvalonEdit.Document { if (c == '\r' || c == '\n') return CharacterClass.LineTerminator; - else if (char.IsWhiteSpace(c)) - return CharacterClass.Whitespace; - else if (char.IsLetterOrDigit(c) || c == '_') + if (c == '_') return CharacterClass.IdentifierPart; - else - return CharacterClass.Other; + return GetCharacterClass(char.GetUnicodeCategory(c)); } static CharacterClass GetCharacterClass(char highSurrogate, char lowSurrogate) { if (char.IsSurrogatePair(highSurrogate, lowSurrogate)) { - switch (char.GetUnicodeCategory(highSurrogate.ToString() + lowSurrogate.ToString(), 0)) { - case UnicodeCategory.SpaceSeparator: - case UnicodeCategory.LineSeparator: - case UnicodeCategory.ParagraphSeparator: - return CharacterClass.Whitespace; - case UnicodeCategory.UppercaseLetter: - case UnicodeCategory.LowercaseLetter: - case UnicodeCategory.TitlecaseLetter: - case UnicodeCategory.ModifierLetter: - case UnicodeCategory.OtherLetter: - case UnicodeCategory.DecimalDigitNumber: - return CharacterClass.IdentifierPart; - default: - return CharacterClass.Other; - } + return GetCharacterClass(char.GetUnicodeCategory(highSurrogate.ToString() + lowSurrogate.ToString(), 0)); } else { // malformed surrogate pair return CharacterClass.Other; } } + + static CharacterClass GetCharacterClass(UnicodeCategory c) + { + switch (c) { + case UnicodeCategory.SpaceSeparator: + case UnicodeCategory.LineSeparator: + case UnicodeCategory.ParagraphSeparator: + return CharacterClass.Whitespace; + case UnicodeCategory.UppercaseLetter: + case UnicodeCategory.LowercaseLetter: + case UnicodeCategory.TitlecaseLetter: + case UnicodeCategory.ModifierLetter: + case UnicodeCategory.OtherLetter: + case UnicodeCategory.DecimalDigitNumber: + return CharacterClass.IdentifierPart; + case UnicodeCategory.NonSpacingMark: + case UnicodeCategory.SpacingCombiningMark: + case UnicodeCategory.EnclosingMark: + return CharacterClass.CombiningMark; + default: + return CharacterClass.Other; + } + } #endregion #region GetNextCaretPosition @@ -251,13 +262,16 @@ namespace ICSharpCode.AvalonEdit.Document { if (textSource == null) throw new ArgumentNullException("textSource"); - if (mode != CaretPositioningMode.Normal - && mode != CaretPositioningMode.WordBorder - && mode != CaretPositioningMode.WordStart - && mode != CaretPositioningMode.WordBorderOrSymbol - && mode != CaretPositioningMode.WordStartOrSymbol) - { - throw new ArgumentException("Unsupported CaretPositioningMode: " + mode, "mode"); + switch (mode) { + case CaretPositioningMode.Normal: + case CaretPositioningMode.EveryCodepoint: + case CaretPositioningMode.WordBorder: + case CaretPositioningMode.WordBorderOrSymbol: + case CaretPositioningMode.WordStart: + case CaretPositioningMode.WordStartOrSymbol: + break; // OK + default: + throw new ArgumentException("Unsupported CaretPositioningMode: " + mode, "mode"); } if (direction != LogicalDirection.Backward && direction != LogicalDirection.Forward) @@ -267,7 +281,7 @@ namespace ICSharpCode.AvalonEdit.Document int textLength = textSource.TextLength; if (textLength <= 0) { // empty document? has a normal caret position at 0, though no word borders - if (mode == CaretPositioningMode.Normal) { + if (IsNormal(mode)) { if (offset > 0 && direction == LogicalDirection.Backward) return 0; if (offset < 0 && direction == LogicalDirection.Forward) return 0; } @@ -286,14 +300,14 @@ namespace ICSharpCode.AvalonEdit.Document if (nextPos == 0) { // at the document start, there's only a word border // if the first character is not whitespace - if (mode == CaretPositioningMode.Normal || !char.IsWhiteSpace(textSource.GetCharAt(0))) + if (IsNormal(mode) || !char.IsWhiteSpace(textSource.GetCharAt(0))) return nextPos; } else if (nextPos == textLength) { // at the document end, there's never a word start if (mode != CaretPositioningMode.WordStart && mode != CaretPositioningMode.WordStartOrSymbol) { // at the document end, there's only a word border // if the last character is not whitespace - if (mode == CaretPositioningMode.Normal || !char.IsWhiteSpace(textSource.GetCharAt(textLength - 1))) + if (IsNormal(mode) || !char.IsWhiteSpace(textSource.GetCharAt(textLength - 1))) return nextPos; } } else { @@ -320,9 +334,19 @@ namespace ICSharpCode.AvalonEdit.Document } } + static bool IsNormal(CaretPositioningMode mode) + { + return mode == CaretPositioningMode.Normal || mode == CaretPositioningMode.EveryCodepoint; + } + static bool StopBetweenCharacters(CaretPositioningMode mode, CharacterClass charBefore, CharacterClass charAfter) { - // Stop after every character in normal mode + if (mode == CaretPositioningMode.EveryCodepoint) + return true; + // Don't stop in the middle of a grapheme + if (charAfter == CharacterClass.CombiningMark) + return false; + // Stop after every grapheme in normal mode if (mode == CaretPositioningMode.Normal) return true; if (charBefore == charAfter) { @@ -370,6 +394,11 @@ namespace ICSharpCode.AvalonEdit.Document /// /// The character is line terminator (\r or \n). /// - LineTerminator + LineTerminator, + /// + /// The character is a unicode combining mark that modifies the previous character. + /// Corresponds to the Unicode designations "Mn", "Mc" and "Me". + /// + CombiningMark } } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs index b1cf4e6b8b..46a600bf69 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/SingleCharacterElementGenerator.cs @@ -111,7 +111,7 @@ namespace ICSharpCode.AvalonEdit.Rendering public override int GetNextCaretPosition(int visualColumn, LogicalDirection direction, CaretPositioningMode mode) { - if (mode == CaretPositioningMode.Normal) + if (mode == CaretPositioningMode.Normal || mode == CaretPositioningMode.EveryCodepoint) return base.GetNextCaretPosition(visualColumn, direction, mode); else return -1; @@ -146,7 +146,7 @@ namespace ICSharpCode.AvalonEdit.Rendering public override int GetNextCaretPosition(int visualColumn, LogicalDirection direction, CaretPositioningMode mode) { - if (mode == CaretPositioningMode.Normal) + if (mode == CaretPositioningMode.Normal || mode == CaretPositioningMode.EveryCodepoint) return base.GetNextCaretPosition(visualColumn, direction, mode); else return -1; diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs index 76d6e657c1..f1e437588e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs @@ -548,6 +548,15 @@ namespace ICSharpCode.AvalonEdit.Rendering return ch.FirstCharacterIndex; } + /// + /// Gets the text view position from the specified visual column. + /// + public TextViewPosition GetTextViewPosition(int visualColumn) + { + int documentOffset = GetRelativeOffset(visualColumn) + this.FirstDocumentLine.Offset; + return new TextViewPosition(this.Document.GetLocation(documentOffset), visualColumn); + } + /// /// Gets the text view position from the specified visual position. /// If the position is within a character, it is rounded to the next character boundary. @@ -690,12 +699,12 @@ namespace ICSharpCode.AvalonEdit.Rendering static bool HasStopsInVirtualSpace(CaretPositioningMode mode) { - return mode == CaretPositioningMode.Normal; + return mode == CaretPositioningMode.Normal || mode == CaretPositioningMode.EveryCodepoint; } static bool HasImplicitStopAtLineStart(CaretPositioningMode mode) { - return mode == CaretPositioningMode.Normal; + return mode == CaretPositioningMode.Normal || mode == CaretPositioningMode.EveryCodepoint; } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "mode", From ebb5d25c354b9016d21583ed5c1271d3050ecc18 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Thu, 30 May 2013 16:05:53 +0200 Subject: [PATCH 27/27] Backspace now deletes only a single combining mark. Backspace no longer is equivalent to Shift+Left followed by Delete. Caret movement with Shift+Left will select the whole grapheme; only backspace can be used to delete part of a grapheme. --- .../Utils/CaretNavigationTests.cs | 16 ++ .../Editing/CaretNavigationCommandHandler.cs | 200 +++++++++--------- .../Editing/EditingCommandHandler.cs | 48 ++--- .../Editing/SimpleSelection.cs | 16 +- 4 files changed, 146 insertions(+), 134 deletions(-) diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs index 8439d5f2ad..366e0671ff 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit.Tests/Utils/CaretNavigationTests.cs @@ -113,5 +113,21 @@ namespace ICSharpCode.AvalonEdit.Utils Assert.AreEqual(5, GetPrevCaretStop(c, 6, CaretPositioningMode.WordBorder)); Assert.AreEqual(1, GetPrevCaretStop(c, 5, CaretPositioningMode.WordBorder)); } + + [Test] + public void CombiningMark() + { + string str = " x͆ "; + Assert.AreEqual(3, GetNextCaretStop(str, 1, CaretPositioningMode.Normal)); + Assert.AreEqual(1, GetPrevCaretStop(str, 3, CaretPositioningMode.Normal)); + } + + [Test] + public void StackedCombiningMark() + { + string str = " x͆͆͆͆ "; + Assert.AreEqual(6, GetNextCaretStop(str, 1, CaretPositioningMode.Normal)); + Assert.AreEqual(1, GetPrevCaretStop(str, 6, CaretPositioningMode.Normal)); + } } } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs index 8c0774d60f..03a4598beb 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/CaretNavigationCommandHandler.cs @@ -15,6 +15,24 @@ using ICSharpCode.AvalonEdit.Utils; namespace ICSharpCode.AvalonEdit.Editing { + enum CaretMovementType + { + None, + CharLeft, + CharRight, + Backspace, + WordLeft, + WordRight, + LineUp, + LineDown, + PageUp, + PageDown, + LineStart, + LineEnd, + DocumentStart, + DocumentEnd + } + static class CaretNavigationCommandHandler { /// @@ -102,22 +120,6 @@ namespace ICSharpCode.AvalonEdit.Editing return target as TextArea; } - enum CaretMovementType - { - CharLeft, - CharRight, - WordLeft, - WordRight, - LineUp, - LineDown, - PageUp, - PageDown, - LineStart, - LineEnd, - DocumentStart, - DocumentEnd - } - static ExecutedRoutedEventHandler OnMoveCaret(CaretMovementType direction) { return (target, args) => { @@ -140,8 +142,7 @@ namespace ICSharpCode.AvalonEdit.Editing TextViewPosition oldPosition = textArea.Caret.Position; MoveCaret(textArea, direction); textArea.Selection = textArea.Selection.StartSelectionOrSetEndpoint(oldPosition, textArea.Caret.Position); - if (!textArea.Document.IsInUpdate) // if we're inside a larger update (e.g. called by EditingCommandHandler.OnDelete()), avoid calculating the caret rectangle now - textArea.Caret.BringCaretToView(); + textArea.Caret.BringCaretToView(); } }; } @@ -172,43 +173,55 @@ namespace ICSharpCode.AvalonEdit.Editing } #region Caret movement - static void MoveCaret(TextArea textArea, CaretMovementType direction) + internal static void MoveCaret(TextArea textArea, CaretMovementType direction) { - DocumentLine caretLine = textArea.Document.GetLineByNumber(textArea.Caret.Line); - VisualLine visualLine = textArea.TextView.GetOrConstructVisualLine(caretLine); - TextViewPosition caretPosition = textArea.Caret.Position; + double desiredXPos = textArea.Caret.DesiredXPos; + textArea.Caret.Position = GetNewCaretPosition(textArea.TextView, textArea.Caret.Position, direction, textArea.Selection.EnableVirtualSpace, ref desiredXPos); + textArea.Caret.DesiredXPos = desiredXPos; + } + + internal static TextViewPosition GetNewCaretPosition(TextView textView, TextViewPosition caretPosition, CaretMovementType direction, bool enableVirtualSpace, ref double desiredXPos) + { + switch (direction) { + case CaretMovementType.None: + return caretPosition; + case CaretMovementType.DocumentStart: + desiredXPos = double.NaN; + return new TextViewPosition(0, 0); + case CaretMovementType.DocumentEnd: + desiredXPos = double.NaN; + return new TextViewPosition(textView.Document.GetLocation(textView.Document.TextLength)); + } + DocumentLine caretLine = textView.Document.GetLineByNumber(caretPosition.Line); + VisualLine visualLine = textView.GetOrConstructVisualLine(caretLine); TextLine textLine = visualLine.GetTextLine(caretPosition.VisualColumn, caretPosition.IsAtEndOfLine); switch (direction) { case CaretMovementType.CharLeft: - MoveCaretLeft(textArea, caretPosition, visualLine, CaretPositioningMode.Normal); - break; + desiredXPos = double.NaN; + return GetPrevCaretPosition(textView, caretPosition, visualLine, CaretPositioningMode.Normal, enableVirtualSpace); + case CaretMovementType.Backspace: + desiredXPos = double.NaN; + return GetPrevCaretPosition(textView, caretPosition, visualLine, CaretPositioningMode.EveryCodepoint, enableVirtualSpace); case CaretMovementType.CharRight: - MoveCaretRight(textArea, caretPosition, visualLine, CaretPositioningMode.Normal); - break; + desiredXPos = double.NaN; + return GetNextCaretPosition(textView, caretPosition, visualLine, CaretPositioningMode.Normal, enableVirtualSpace); case CaretMovementType.WordLeft: - MoveCaretLeft(textArea, caretPosition, visualLine, CaretPositioningMode.WordStart); - break; + desiredXPos = double.NaN; + return GetPrevCaretPosition(textView, caretPosition, visualLine, CaretPositioningMode.WordStart, enableVirtualSpace); case CaretMovementType.WordRight: - MoveCaretRight(textArea, caretPosition, visualLine, CaretPositioningMode.WordStart); - break; + desiredXPos = double.NaN; + return GetNextCaretPosition(textView, caretPosition, visualLine, CaretPositioningMode.WordStart, enableVirtualSpace); case CaretMovementType.LineUp: case CaretMovementType.LineDown: case CaretMovementType.PageUp: case CaretMovementType.PageDown: - MoveCaretUpDown(textArea, direction, visualLine, textLine, caretPosition.VisualColumn); - break; - case CaretMovementType.DocumentStart: - SetCaretPosition(textArea, 0, 0); - break; - case CaretMovementType.DocumentEnd: - SetCaretPosition(textArea, -1, textArea.Document.TextLength); - break; + return GetUpDownCaretPosition(textView, caretPosition, direction, visualLine, textLine, enableVirtualSpace, ref desiredXPos); case CaretMovementType.LineStart: - MoveCaretToStartOfLine(textArea, visualLine, textLine); - break; + desiredXPos = double.NaN; + return GetStartOfLineCaretPosition(caretPosition.VisualColumn, visualLine, textLine, enableVirtualSpace); case CaretMovementType.LineEnd: - MoveCaretToEndOfLine(textArea, visualLine, textLine); - break; + desiredXPos = double.NaN; + return GetEndOfLineCaretPosition(visualLine, textLine); default: throw new NotSupportedException(direction.ToString()); } @@ -216,81 +229,80 @@ namespace ICSharpCode.AvalonEdit.Editing #endregion #region Home/End - static void MoveCaretToStartOfLine(TextArea textArea, VisualLine visualLine, TextLine textLine) + static TextViewPosition GetStartOfLineCaretPosition(int oldVC, VisualLine visualLine, TextLine textLine, bool enableVirtualSpace) { int newVC = visualLine.GetTextLineVisualStartColumn(textLine); if (newVC == 0) - newVC = visualLine.GetNextCaretPosition(newVC - 1, LogicalDirection.Forward, CaretPositioningMode.WordStart, textArea.Selection.EnableVirtualSpace); + newVC = visualLine.GetNextCaretPosition(newVC - 1, LogicalDirection.Forward, CaretPositioningMode.WordStart, enableVirtualSpace); if (newVC < 0) throw ThrowUtil.NoValidCaretPosition(); // when the caret is already at the start of the text, jump to start before whitespace - if (newVC == textArea.Caret.VisualColumn) + if (newVC == oldVC) newVC = 0; - int offset = visualLine.FirstDocumentLine.Offset + visualLine.GetRelativeOffset(newVC); - SetCaretPosition(textArea, newVC, offset); + return visualLine.GetTextViewPosition(newVC); } - static void MoveCaretToEndOfLine(TextArea textArea, VisualLine visualLine, TextLine textLine) + static TextViewPosition GetEndOfLineCaretPosition(VisualLine visualLine, TextLine textLine) { int newVC = visualLine.GetTextLineVisualStartColumn(textLine) + textLine.Length - textLine.TrailingWhitespaceLength; - int offset = visualLine.FirstDocumentLine.Offset + visualLine.GetRelativeOffset(newVC); - SetCaretPosition(textArea, newVC, offset, isAtEndOfLine: true); + TextViewPosition pos = visualLine.GetTextViewPosition(newVC); + pos.IsAtEndOfLine = true; + return pos; } #endregion #region By-character / By-word movement - static void MoveCaretRight(TextArea textArea, TextViewPosition caretPosition, VisualLine visualLine, CaretPositioningMode mode) + static TextViewPosition GetNextCaretPosition(TextView textView, TextViewPosition caretPosition, VisualLine visualLine, CaretPositioningMode mode, bool enableVirtualSpace) { - int pos = visualLine.GetNextCaretPosition(caretPosition.VisualColumn, LogicalDirection.Forward, mode, textArea.Selection.EnableVirtualSpace); + int pos = visualLine.GetNextCaretPosition(caretPosition.VisualColumn, LogicalDirection.Forward, mode, enableVirtualSpace); if (pos >= 0) { - SetCaretPosition(textArea, pos, visualLine.GetRelativeOffset(pos) + visualLine.FirstDocumentLine.Offset); + return visualLine.GetTextViewPosition(pos); } else { // move to start of next line DocumentLine nextDocumentLine = visualLine.LastDocumentLine.NextLine; if (nextDocumentLine != null) { - VisualLine nextLine = textArea.TextView.GetOrConstructVisualLine(nextDocumentLine); - pos = nextLine.GetNextCaretPosition(-1, LogicalDirection.Forward, mode, textArea.Selection.EnableVirtualSpace); + VisualLine nextLine = textView.GetOrConstructVisualLine(nextDocumentLine); + pos = nextLine.GetNextCaretPosition(-1, LogicalDirection.Forward, mode, enableVirtualSpace); if (pos < 0) throw ThrowUtil.NoValidCaretPosition(); - SetCaretPosition(textArea, pos, nextLine.GetRelativeOffset(pos) + nextLine.FirstDocumentLine.Offset); + return nextLine.GetTextViewPosition(pos); } else { // at end of document - Debug.Assert(visualLine.LastDocumentLine.Offset + visualLine.LastDocumentLine.TotalLength == textArea.Document.TextLength); - SetCaretPosition(textArea, -1, textArea.Document.TextLength); + Debug.Assert(visualLine.LastDocumentLine.Offset + visualLine.LastDocumentLine.TotalLength == textView.Document.TextLength); + return new TextViewPosition(textView.Document.GetLocation(textView.Document.TextLength)); } } } - static void MoveCaretLeft(TextArea textArea, TextViewPosition caretPosition, VisualLine visualLine, CaretPositioningMode mode) + static TextViewPosition GetPrevCaretPosition(TextView textView, TextViewPosition caretPosition, VisualLine visualLine, CaretPositioningMode mode, bool enableVirtualSpace) { - int pos = visualLine.GetNextCaretPosition(caretPosition.VisualColumn, LogicalDirection.Backward, mode, textArea.Selection.EnableVirtualSpace); + int pos = visualLine.GetNextCaretPosition(caretPosition.VisualColumn, LogicalDirection.Backward, mode, enableVirtualSpace); if (pos >= 0) { - SetCaretPosition(textArea, pos, visualLine.GetRelativeOffset(pos) + visualLine.FirstDocumentLine.Offset); + return visualLine.GetTextViewPosition(pos); } else { // move to end of previous line DocumentLine previousDocumentLine = visualLine.FirstDocumentLine.PreviousLine; if (previousDocumentLine != null) { - VisualLine previousLine = textArea.TextView.GetOrConstructVisualLine(previousDocumentLine); - pos = previousLine.GetNextCaretPosition(previousLine.VisualLength + 1, LogicalDirection.Backward, mode, textArea.Selection.EnableVirtualSpace); + VisualLine previousLine = textView.GetOrConstructVisualLine(previousDocumentLine); + pos = previousLine.GetNextCaretPosition(previousLine.VisualLength + 1, LogicalDirection.Backward, mode, enableVirtualSpace); if (pos < 0) throw ThrowUtil.NoValidCaretPosition(); - SetCaretPosition(textArea, pos, previousLine.GetRelativeOffset(pos) + previousLine.FirstDocumentLine.Offset); + return previousLine.GetTextViewPosition(pos); } else { // at start of document Debug.Assert(visualLine.FirstDocumentLine.Offset == 0); - SetCaretPosition(textArea, 0, 0); + return new TextViewPosition(0, 0); } } } #endregion #region Line+Page up/down - static void MoveCaretUpDown(TextArea textArea, CaretMovementType direction, VisualLine visualLine, TextLine textLine, int caretVisualColumn) + static TextViewPosition GetUpDownCaretPosition(TextView textView, TextViewPosition caretPosition, CaretMovementType direction, VisualLine visualLine, TextLine textLine, bool enableVirtualSpace, ref double xPos) { // moving up/down happens using the desired visual X position - double xPos = textArea.Caret.DesiredXPos; if (double.IsNaN(xPos)) - xPos = visualLine.GetTextLineVisualXPosition(textLine, caretVisualColumn); + xPos = visualLine.GetTextLineVisualXPosition(textLine, caretPosition.VisualColumn); // now find the TextLine+VisualLine where the caret will end up in VisualLine targetVisualLine = visualLine; TextLine targetLine; @@ -304,8 +316,8 @@ namespace ICSharpCode.AvalonEdit.Editing if (textLineIndex > 0) { targetLine = visualLine.TextLines[textLineIndex - 1]; } else if (prevLineNumber >= 1) { - DocumentLine prevLine = textArea.Document.GetLineByNumber(prevLineNumber); - targetVisualLine = textArea.TextView.GetOrConstructVisualLine(prevLine); + DocumentLine prevLine = textView.Document.GetLineByNumber(prevLineNumber); + targetVisualLine = textView.GetOrConstructVisualLine(prevLine); targetLine = targetVisualLine.TextLines[targetVisualLine.TextLines.Count - 1]; } else { targetLine = null; @@ -319,9 +331,9 @@ namespace ICSharpCode.AvalonEdit.Editing int nextLineNumber = visualLine.LastDocumentLine.LineNumber + 1; if (textLineIndex < visualLine.TextLines.Count - 1) { targetLine = visualLine.TextLines[textLineIndex + 1]; - } else if (nextLineNumber <= textArea.Document.LineCount) { - DocumentLine nextLine = textArea.Document.GetLineByNumber(nextLineNumber); - targetVisualLine = textArea.TextView.GetOrConstructVisualLine(nextLine); + } else if (nextLineNumber <= textView.Document.LineCount) { + DocumentLine nextLine = textView.Document.GetLineByNumber(nextLineNumber); + targetVisualLine = textView.GetOrConstructVisualLine(nextLine); targetLine = targetVisualLine.TextLines[0]; } else { targetLine = null; @@ -334,11 +346,11 @@ namespace ICSharpCode.AvalonEdit.Editing // Page up/down: find the target line using its visual position double yPos = visualLine.GetTextLineVisualYPosition(textLine, VisualYPosition.LineMiddle); if (direction == CaretMovementType.PageUp) - yPos -= textArea.TextView.RenderSize.Height; + yPos -= textView.RenderSize.Height; else - yPos += textArea.TextView.RenderSize.Height; - DocumentLine newLine = textArea.TextView.GetDocumentLineByVisualTop(yPos); - targetVisualLine = textArea.TextView.GetOrConstructVisualLine(newLine); + yPos += textView.RenderSize.Height; + DocumentLine newLine = textView.GetDocumentLineByVisualTop(yPos); + targetVisualLine = textView.GetOrConstructVisualLine(newLine); targetLine = targetVisualLine.GetTextLineByVisualYPosition(yPos); break; } @@ -347,30 +359,18 @@ namespace ICSharpCode.AvalonEdit.Editing } if (targetLine != null) { double yPos = targetVisualLine.GetTextLineVisualYPosition(targetLine, VisualYPosition.LineMiddle); - int newVisualColumn = targetVisualLine.GetVisualColumn(new Point(xPos, yPos), textArea.Selection.EnableVirtualSpace); - SetCaretPosition(textArea, targetVisualLine, targetLine, newVisualColumn, false); - textArea.Caret.DesiredXPos = xPos; - } - } - #endregion - - #region SetCaretPosition - static void SetCaretPosition(TextArea textArea, VisualLine targetVisualLine, TextLine targetLine, - int newVisualColumn, bool allowWrapToNextLine) - { - int targetLineStartCol = targetVisualLine.GetTextLineVisualStartColumn(targetLine); - if (!allowWrapToNextLine && newVisualColumn >= targetLineStartCol + targetLine.Length) { - if (newVisualColumn <= targetVisualLine.VisualLength) - newVisualColumn = targetLineStartCol + targetLine.Length - 1; + int newVisualColumn = targetVisualLine.GetVisualColumn(new Point(xPos, yPos), enableVirtualSpace); + + // prevent wrapping to the next line; TODO: could 'IsAtEnd' help here? + int targetLineStartCol = targetVisualLine.GetTextLineVisualStartColumn(targetLine); + if (newVisualColumn >= targetLineStartCol + targetLine.Length) { + if (newVisualColumn <= targetVisualLine.VisualLength) + newVisualColumn = targetLineStartCol + targetLine.Length - 1; + } + return targetVisualLine.GetTextViewPosition(newVisualColumn); + } else { + return caretPosition; } - int newOffset = targetVisualLine.GetRelativeOffset(newVisualColumn) + targetVisualLine.FirstDocumentLine.Offset; - SetCaretPosition(textArea, newVisualColumn, newOffset); - } - - static void SetCaretPosition(TextArea textArea, int newVisualColumn, int newOffset, bool isAtEndOfLine = false) - { - textArea.Caret.Position = new TextViewPosition(textArea.Document.GetLocation(newOffset), newVisualColumn) { IsAtEndOfLine = isAtEndOfLine }; - textArea.Caret.DesiredXPos = double.NaN; } #endregion } diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs index f7cbb167ff..204489208e 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/EditingCommandHandler.cs @@ -46,12 +46,12 @@ namespace ICSharpCode.AvalonEdit.Editing static EditingCommandHandler() { - CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, OnDelete(ApplicationCommands.NotACommand), CanDelete)); - AddBinding(EditingCommands.Delete, ModifierKeys.None, Key.Delete, OnDelete(EditingCommands.SelectRightByCharacter)); - AddBinding(EditingCommands.DeleteNextWord, ModifierKeys.Control, Key.Delete, OnDelete(EditingCommands.SelectRightByWord)); - AddBinding(EditingCommands.Backspace, ModifierKeys.None, Key.Back, OnDelete(EditingCommands.SelectLeftByCharacter)); + CommandBindings.Add(new CommandBinding(ApplicationCommands.Delete, OnDelete(CaretMovementType.None), CanDelete)); + AddBinding(EditingCommands.Delete, ModifierKeys.None, Key.Delete, OnDelete(CaretMovementType.CharRight)); + AddBinding(EditingCommands.DeleteNextWord, ModifierKeys.Control, Key.Delete, OnDelete(CaretMovementType.WordRight)); + AddBinding(EditingCommands.Backspace, ModifierKeys.None, Key.Back, OnDelete(CaretMovementType.Backspace)); InputBindings.Add(TextAreaDefaultInputHandler.CreateFrozenKeyBinding(EditingCommands.Backspace, ModifierKeys.Shift, Key.Back)); // make Shift-Backspace do the same as plain backspace - AddBinding(EditingCommands.DeletePreviousWord, ModifierKeys.Control, Key.Back, OnDelete(EditingCommands.SelectLeftByWord)); + AddBinding(EditingCommands.DeletePreviousWord, ModifierKeys.Control, Key.Back, OnDelete(CaretMovementType.WordLeft)); AddBinding(EditingCommands.EnterParagraphBreak, ModifierKeys.None, Key.Enter, OnEnter); AddBinding(EditingCommands.EnterLineBreak, ModifierKeys.Shift, Key.Enter, OnEnter); AddBinding(EditingCommands.TabForward, ModifierKeys.None, Key.Tab, OnTab); @@ -225,34 +225,24 @@ namespace ICSharpCode.AvalonEdit.Editing #endregion #region Delete - static ExecutedRoutedEventHandler OnDelete(RoutedUICommand selectingCommand) + static ExecutedRoutedEventHandler OnDelete(CaretMovementType caretMovement) { return (target, args) => { TextArea textArea = GetTextArea(target); if (textArea != null && textArea.Document != null) { - // call BeginUpdate before running the 'selectingCommand' - // so that undoing the delete does not select the deleted character - using (textArea.Document.RunUpdate()) { - if (textArea.Selection.IsEmpty) { - TextViewPosition oldCaretPosition = textArea.Caret.Position; - if (textArea.Caret.IsInVirtualSpace && selectingCommand == EditingCommands.SelectRightByCharacter) - EditingCommands.SelectRightByWord.Execute(args.Parameter, textArea); - else - selectingCommand.Execute(args.Parameter, textArea); - bool hasSomethingDeletable = false; - foreach (ISegment s in textArea.Selection.Segments) { - if (textArea.GetDeletableSegments(s).Length > 0) { - hasSomethingDeletable = true; - break; - } - } - if (!hasSomethingDeletable) { - // If nothing in the selection is deletable; then reset caret+selection - // to the previous value. This prevents the caret from moving through read-only sections. - textArea.Caret.Position = oldCaretPosition; - textArea.ClearSelection(); - } - } + if (textArea.Selection.IsEmpty) { + TextViewPosition startPos = textArea.Caret.Position; + bool enableVirtualSpace = textArea.Options.EnableVirtualSpace; + // When pressing delete; don't move the caret further into virtual space - instead delete the newline + if (caretMovement == CaretMovementType.CharRight) + enableVirtualSpace = false; + double desiredXPos = textArea.Caret.DesiredXPos; + TextViewPosition endPos = CaretNavigationCommandHandler.GetNewCaretPosition( + textArea.TextView, startPos, caretMovement, enableVirtualSpace, ref desiredXPos); + // Don't select the text to be deleted; just reuse the ReplaceSelectionWithText logic + var sel = new SimpleSelection(textArea, startPos, endPos); + sel.ReplaceSelectionWithText(string.Empty); + } else { textArea.RemoveSelectedText(); } textArea.Caret.BringCaretToView(); diff --git a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs index 5f053b08ac..76e48d2cf6 100644 --- a/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs +++ b/src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/SimpleSelection.cs @@ -55,10 +55,16 @@ namespace ICSharpCode.AvalonEdit.Editing if (segmentsToDelete[i].Offset == SurroundingSegment.Offset && segmentsToDelete[i].Length == SurroundingSegment.Length) { newText = AddSpacesIfRequired(newText, start, end); } - int vc = textArea.Caret.VisualColumn; - textArea.Caret.Offset = segmentsToDelete[i].EndOffset; - if (string.IsNullOrEmpty(newText)) - textArea.Caret.VisualColumn = vc; + if (string.IsNullOrEmpty(newText)) { + // place caret at the beginning of the selection + if (start.CompareTo(end) <= 0) + textArea.Caret.Position = start; + else + textArea.Caret.Position = end; + } else { + // place caret so that it ends up behind the new text + textArea.Caret.Offset = segmentsToDelete[i].EndOffset; + } textArea.Document.Replace(segmentsToDelete[i], newText); } else { textArea.Document.Remove(segmentsToDelete[i]); @@ -100,7 +106,7 @@ namespace ICSharpCode.AvalonEdit.Editing /// public override bool IsEmpty { - get { return startOffset == endOffset; } + get { return startOffset == endOffset && start.VisualColumn == end.VisualColumn; } } ///