diff --git a/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs b/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs index bcf5e103fa..62d3419293 100644 --- a/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/src/unittests/Tests.ProjectSystem.UpToDate.fs @@ -33,6 +33,7 @@ type UpToDate() = + ", (fun project -> @@ -44,6 +45,7 @@ type UpToDate() = let sourcePath = Path.Combine(project.ProjectFolder, "file1.fs") let contentPath = Path.Combine(project.ProjectFolder, "content.txt") let resourcePath = Path.Combine(project.ProjectFolder, "resource.txt") + let configPath = Path.Combine(project.ProjectFolder, "App.config") let nonePath = Path.Combine(project.ProjectFolder, "none.txt") let embedPath = Path.Combine(project.ProjectFolder, "embedresource.txt") @@ -52,6 +54,7 @@ type UpToDate() = File.AppendAllText(sourcePath, "printfn \"hello\"") File.AppendAllText(contentPath, "some content") File.AppendAllText(resourcePath, "some resource") + File.AppendAllText(configPath, """""") File.AppendAllText(nonePath, "none") File.AppendAllText(embedPath, "some embedded resource") @@ -59,11 +62,11 @@ type UpToDate() = project.Build(configNameDebug, output, "Build") |> ignore Assert.IsTrue(config.IsUpToDate(logger, true)) - // None items should not affect up-to-date + // None items should not affect up-to-date (unless captured by well-known items, e.g. App.config) File.SetLastWriteTime(nonePath, DateTime.Now.AddMinutes(5.)) Assert.IsTrue(config.IsUpToDate(logger, true)) - for path in [sourcePath; contentPath; resourcePath; embedPath] do + for path in [sourcePath; contentPath; resourcePath; embedPath; configPath] do printfn "Testing path %s" path // touch file diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/GroupingReferenceNode.cs b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/GroupingReferenceNode.cs index 6b4d0e0303..39e5806b9c 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/GroupingReferenceNode.cs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/GroupingReferenceNode.cs @@ -35,14 +35,16 @@ public class GroupingReferenceNode : ReferenceNode public string Identity { get; private set; } public string ResolutionPath { get; private set; } public string Version { get; private set; } + public string[] GroupedItems { get; private set; } - public GroupingReferenceNode(ProjectNode project, string name, string identity, string resolutionPath, string version) + public GroupingReferenceNode(ProjectNode project, string name, string identity, string resolutionPath, string version, string[] groupedItems) : base(project) { Name = name; Identity = identity; ResolutionPath = resolutionPath; Version = version; + GroupedItems = groupedItems; } public override string Caption diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectConfig.cs b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectConfig.cs index 00607561e1..f49c9dee7c 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectConfig.cs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ProjectConfig.cs @@ -1484,16 +1484,44 @@ internal bool GetUTDCheckInputs(ref HashSet inputs) inputs.Add(Utilities.CanonicalizeFileNameNoThrow(Path.Combine(projDir, propVal))); } + // other well-known special files that were otherwise missed + var specialFiles = this.project.InteropSafeIVsHierarchy as IVsProjectSpecialFiles; + if (specialFiles == null) + return false; + + for (int fileId = (int)__PSFFILEID5.PSFFILEID_FIRST5; fileId <= (int)__PSFFILEID.PSFFILEID_LAST; fileId++) + { + uint itemId; + string fileName; + if (ErrorHandler.Succeeded(specialFiles.GetFile(fileId, (uint)__PSFFLAGS.PSFF_FullPath, out itemId, out fileName)) + && itemId != (uint)VSConstants.VSITEMID.Nil) + { + inputs.Add(Utilities.CanonicalizeFileNameNoThrow(fileName)); + } + } + // assembly and project references - foreach (var reference in this.project .GetReferenceContainer().EnumReferences()) + foreach (var reference in this.project.GetReferenceContainer().EnumReferences()) { if (reference is AssemblyReferenceNode) inputs.Add(Utilities.CanonicalizeFileNameNoThrow(reference.Url)); else if (reference is ProjectReferenceNode) inputs.Add(Utilities.CanonicalizeFileNameNoThrow((reference as ProjectReferenceNode).ReferencedProjectOutputPath)); + else if (reference is ComReferenceNode) + inputs.Add(Utilities.CanonicalizeFileNameNoThrow((reference as ComReferenceNode).InstalledFilePath)); + else if (reference is GroupingReferenceNode) + { + foreach (var groupedRef in ((GroupingReferenceNode)reference).GroupedItems) + { + inputs.Add(Utilities.CanonicalizeFileNameNoThrow(groupedRef)); + } + } else + { // some reference type we don't know about + System.Diagnostics.Debug.Assert(false, "Unexpected reference type", "{0}", reference); return false; + } } return true; diff --git a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ReferenceContainerNode.cs b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ReferenceContainerNode.cs index 36cef64464..8768304b30 100644 --- a/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ReferenceContainerNode.cs +++ b/vsintegration/src/vs/FsPkgs/FSharp.Project/Common.Source.CSharp/Project/ReferenceContainerNode.cs @@ -372,6 +372,8 @@ public void LoadReferencesFromBuildProject(Microsoft.Build.Evaluation.Project bu } // pick property values from the first item - they should be the same for all elements in the grouping var first = grouping.First(); + var groupedFiles = grouping.Select(x => x.file).ToArray(); + var versonText = string.Format( "{0}.{1}.{2}.{3}", version.Major, @@ -380,7 +382,7 @@ public void LoadReferencesFromBuildProject(Microsoft.Build.Evaluation.Project bu version.Revision != -1 ? version.Revision : 0 ); - var node = new GroupingReferenceNode(ProjectMgr, first.referenceGroupingDisplayName, first.referenceGrouping, Path.GetDirectoryName(first.file), versonText); + var node = new GroupingReferenceNode(ProjectMgr, first.referenceGroupingDisplayName, first.referenceGrouping, Path.GetDirectoryName(first.file), versonText, groupedFiles); AddChild(node); } }