diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2015-04-14 15:22:36 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2015-04-14 15:22:36 +0300 |
commit | f776f82bdf50eb5c88638122dc4f8873958f2e7f (patch) | |
tree | bfcf6e65eb05527c469a5f8f0da23d297dd822bd /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks | |
parent | d8e4d297887dd9e15cfad402359c701f2e889a14 (diff) | |
parent | 9c96fb6825447a5e7804f861d852f6a59aa29338 (diff) |
Merge branch 'master' into roslyn
Conflicts:
main/external/fsharpbinding
main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
main/src/addins/NUnit/Services/NUnitProjectTestSuite.cs
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs
version-checks
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs | 67 |
1 files changed, 43 insertions, 24 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs index 8cd708bbae..7661d53b0f 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/TaskStore.cs @@ -23,17 +23,17 @@ // 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. -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3074
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
+//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.3074 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +using System; using System.Collections; using System.Collections.Generic; using MonoDevelop.Core; @@ -41,12 +41,13 @@ using MonoDevelop.Projects; using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Gui.Content; using MonoDevelop.Ide.Navigation; -using MonoDevelop.Ide.TextEditing;
-
-namespace MonoDevelop.Ide.Tasks
-{
- public class TaskStore: IEnumerable<TaskListEntry>, ILocationList
- {
+using MonoDevelop.Ide.TextEditing; +using MonoDevelop.Ide.Desktop; + +namespace MonoDevelop.Ide.Tasks +{ + public class TaskStore: IEnumerable<TaskListEntry>, ILocationList + { int taskUpdateCount; List<TaskListEntry> tasks = new List<TaskListEntry> (); Dictionary<FilePath,TaskListEntry[]> taskIndex = new Dictionary<FilePath, TaskListEntry[]> (); @@ -58,12 +59,12 @@ namespace MonoDevelop.Ide.Tasks List<TaskListEntry> tasksAdded; List<TaskListEntry> tasksRemoved; - public TaskStore ()
+ public TaskStore () { if (IdeApp.Workspace != null) { IdeApp.Workspace.FileRenamedInProject += ProjectFileRenamed; IdeApp.Workspace.FileRemovedFromProject += ProjectFileRemoved; - }
+ } TextEditorService.LineCountChangesCommitted += delegate (object sender, TextFileEventArgs args) { foreach (TaskListEntry task in GetFileTasks (args.TextFile.Name.FullPath)) @@ -195,7 +196,7 @@ namespace MonoDevelop.Ide.Tasks yield return t; } } -
+ public TaskListEntry[] GetFileTasks (FilePath file) { TaskListEntry[] ta; @@ -429,15 +430,33 @@ namespace MonoDevelop.Ide.Tasks return null; } } - + + /// <summary> + /// Determines whether the task's file should be opened automatically when jumping to the next error. + /// </summary> public static bool IsProjectTaskFile (TaskListEntry t) { if (t.FileName.IsNullOrEmpty) return false; + + //only files that are part of project Project p = t.WorkspaceObject as Project; if (p == null) return false; - return p.GetProjectFile (t.FileName) != null; + if (p.GetProjectFile (t.FileName) == null) + return false; + + //only text files + var mimeType = DesktopService.GetMimeTypeForUri (t.FileName); + if (!DesktopService.GetMimeTypeIsText (mimeType)) + return false; + + //only files for which we have a default internal display binding + var binding = DisplayBindingService.GetDefaultBinding (t.FileName, mimeType, p); + if (binding == null || !binding.CanUseAsDefault || binding is IExternalDisplayBinding) + return false; + + return true; } @@ -500,7 +519,7 @@ namespace MonoDevelop.Ide.Tasks } #endregion - }
+ } public delegate void TaskEventHandler (object sender, TaskEventArgs e); @@ -522,4 +541,4 @@ namespace MonoDevelop.Ide.Tasks get { return tasks; } } } -}
+} |