diff --git a/src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs b/src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs index a1397fd61a..0d1b5a86da 100644 --- a/src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs +++ b/src/AddIns/Misc/CodeAnalysis/Src/FxCopLogger.cs @@ -79,6 +79,7 @@ namespace ICSharpCode.CodeAnalysis string[] moreData = (subcategory ?? "").Split('|'); BuildError err = engineWorker.CurrentErrorOrWarning; + err.ErrorCode = (checkId != null) ? checkId.Split(':')[0] : null; if (FileUtility.IsValidPath(file) && Path.GetFileName(file) == "SharpDevelop.CodeAnalysis.targets") { diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin index cb63b2fea0..1986b1d070 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin +++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin @@ -98,4 +98,11 @@ insertafter = "PreviousHelpTopic"/> + + + + + diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj index 2559f039c0..5384603a88 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj +++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.csproj @@ -19,7 +19,8 @@ 4096 4 false - v2.0 + v3.5 + C:\SharpDevelop Projects\0\SharpDevelop 3\src\AddIns\Misc\HtmlHelp2\Project\Settings.SourceAnalysis ..\..\..\..\..\AddIns\AddIns\Misc\HtmlHelp2\ @@ -78,6 +79,7 @@ Always + Form @@ -137,6 +139,7 @@ ICSharpCode.SharpDevelop.Dom False + \ No newline at end of file diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs new file mode 100644 index 0000000000..5ae1cc5c4f --- /dev/null +++ b/src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs @@ -0,0 +1,65 @@ +// +// +// +// +// $Revision: 3555 $ +// +using MSHelpServices; +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop; +using ICSharpCode.SharpDevelop.Gui; + +namespace HtmlHelp2.Commands +{ + /// + /// Description of ShowErrorHelpCommand + /// + public class ShowErrorHelpCommand : AbstractMenuCommand + { + AxMSHelpControls.AxHxIndexCtrl indexControl; + /// + /// Starts the command + /// + public override void Run() + { + ICSharpCode.SharpDevelop.Gui.TaskView view = (ICSharpCode.SharpDevelop.Gui.TaskView)Owner; + + // Search all selected tasks + foreach (Task t in new List(view.SelectedTasks)) + { + string code = t.BuildError.ErrorCode; + + if (string.IsNullOrEmpty(code)) + return; + + // Get help content + MSHelpServices.IHxTopic topic; + + // If HtmlHelp2 AddIn is initialised correctly we can start! + if (HtmlHelp2.Environment.HtmlHelp2Environment.SessionIsInitialized) + { + // Get the topic + IHxIndex index = HtmlHelp2.Environment.HtmlHelp2Environment.GetIndex(HtmlHelp2.Environment.HtmlHelp2Environment.CurrentFilterQuery); + int indexSlot = index.GetSlotFromString(code); + topic = index.GetTopicsFromSlot(indexSlot).ItemAt(1); + string topicTitle = topic.get_Title(HxTopicGetTitleType.HxTopicGetTOCTitle, HxTopicGetTitleDefVal.HxTopicGetTitleFileName); + if (!topicTitle.Contains(code)) { + MessageService.ShowErrorFormatted("No help available for {0}!", code); + return; + } + } + else // Otherwise we have to show an Error message ... + { + LoggingService.Error("Couldn't initialize help database"); + return; + } + + // Show Browser window + HtmlHelp2.ShowHelpBrowser.OpenHelpView(topic); + } + } + } +} diff --git a/src/Main/Base/Project/Src/Services/Tasks/Task.cs b/src/Main/Base/Project/Src/Services/Tasks/Task.cs index c9c8277862..d54632158f 100644 --- a/src/Main/Base/Project/Src/Services/Tasks/Task.cs +++ b/src/Main/Base/Project/Src/Services/Tasks/Task.cs @@ -97,6 +97,11 @@ namespace ICSharpCode.SharpDevelop } } + /// + /// Contains a reference to the build error. + /// + public BuildError BuildError { get; private set; } + public Task(string fileName, string description, int column, int line, TaskType type) { this.type = type; @@ -121,6 +126,7 @@ namespace ICSharpCode.SharpDevelop contextMenuAddInTreeEntry = error.ContextMenuAddInTreeEntry; } tag = error.Tag; + this.BuildError = error; } public void JumpToPosition()