From 2e8351a031c524cf6dcaf9e70406146c8a803d9a Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Thu, 18 Oct 2018 16:32:59 -0700 Subject: [PATCH] Add APIs for adding dynamic files to IWorkspaceProjectContext This adds an API for the project system to notify us about files that can generate .cs files in the workspace. The rest of the implementation is still coming but this unblocks the project system side of things. --- .../ProjectSystem/CPS/IWorkspaceProjectContext.cs | 4 ++++ .../CPS/CPSProject_IWorkspaceProjectContext.cs | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs index c4f85e677e0..52fdb3316f9 100644 --- a/src/VisualStudio/Core/Def/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs +++ b/src/VisualStudio/Core/Def/Implementation/ProjectSystem/CPS/IWorkspaceProjectContext.cs @@ -2,6 +2,8 @@ using System; using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; using Microsoft.CodeAnalysis; namespace Microsoft.VisualStudio.LanguageServices.ProjectSystem @@ -36,6 +38,8 @@ internal interface IWorkspaceProjectContext : IDisposable void RemoveSourceFile(string filePath); void AddAdditionalFile(string filePath, bool isInCurrentContext = true); void RemoveAdditionalFile(string filePath); + void AddDynamicFile(string filePath, IEnumerable folderNames = null); + void RemoveDynamicFile(string fullPath); void SetRuleSetFile(string filePath); void StartBatch(); diff --git a/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs b/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs index 7a72c218fd4..9ea80f2d5c3 100644 --- a/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs +++ b/src/VisualStudio/Core/Impl/ProjectSystem/CPS/CPSProject_IWorkspaceProjectContext.cs @@ -101,7 +101,7 @@ public string BinOutputPath // Compute the ref path based on the non-ref path. Ideally this should come from the // project system but we don't have a way to fetch that. - _visualStudioProject.OutputRefFilePath = + _visualStudioProject.OutputRefFilePath = Path.Combine(Path.GetDirectoryName(_visualStudioProject.OutputFilePath), "ref", Path.GetFileName(_visualStudioProject.OutputFilePath)); @@ -184,6 +184,14 @@ public void RemoveAdditionalFile(string filePath) _visualStudioProject.RemoveAdditionalFile(filePath); } + public void AddDynamicFile(string filePath, IEnumerable folderNames = null) + { + } + + public void RemoveDynamicFile(string fullPath) + { + } + public void SetRuleSetFile(string filePath) { // This is now a no-op: we also recieve the rule set file through SetOptions, and we'll just use that one @@ -201,7 +209,7 @@ public void EndBatch() Contract.ThrowIfFalse(_batchScopes.TryDequeue(out var scope)); scope.Dispose(); } - + internal VisualStudioProject GetProject_TestOnly() { return _visualStudioProject; -- GitLab