提交 2e8351a0 编写于 作者: H Heejae Chang 提交者: Jason Malinowski

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.
上级 58c91c0a
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
namespace Microsoft.VisualStudio.LanguageServices.ProjectSystem namespace Microsoft.VisualStudio.LanguageServices.ProjectSystem
...@@ -36,6 +38,8 @@ internal interface IWorkspaceProjectContext : IDisposable ...@@ -36,6 +38,8 @@ internal interface IWorkspaceProjectContext : IDisposable
void RemoveSourceFile(string filePath); void RemoveSourceFile(string filePath);
void AddAdditionalFile(string filePath, bool isInCurrentContext = true); void AddAdditionalFile(string filePath, bool isInCurrentContext = true);
void RemoveAdditionalFile(string filePath); void RemoveAdditionalFile(string filePath);
void AddDynamicFile(string filePath, IEnumerable<string> folderNames = null);
void RemoveDynamicFile(string fullPath);
void SetRuleSetFile(string filePath); void SetRuleSetFile(string filePath);
void StartBatch(); void StartBatch();
......
...@@ -101,7 +101,7 @@ public string BinOutputPath ...@@ -101,7 +101,7 @@ public string BinOutputPath
// Compute the ref path based on the non-ref path. Ideally this should come from the // 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. // project system but we don't have a way to fetch that.
_visualStudioProject.OutputRefFilePath = _visualStudioProject.OutputRefFilePath =
Path.Combine(Path.GetDirectoryName(_visualStudioProject.OutputFilePath), Path.Combine(Path.GetDirectoryName(_visualStudioProject.OutputFilePath),
"ref", "ref",
Path.GetFileName(_visualStudioProject.OutputFilePath)); Path.GetFileName(_visualStudioProject.OutputFilePath));
...@@ -184,6 +184,14 @@ public void RemoveAdditionalFile(string filePath) ...@@ -184,6 +184,14 @@ public void RemoveAdditionalFile(string filePath)
_visualStudioProject.RemoveAdditionalFile(filePath); _visualStudioProject.RemoveAdditionalFile(filePath);
} }
public void AddDynamicFile(string filePath, IEnumerable<string> folderNames = null)
{
}
public void RemoveDynamicFile(string fullPath)
{
}
public void SetRuleSetFile(string filePath) 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 // 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() ...@@ -201,7 +209,7 @@ public void EndBatch()
Contract.ThrowIfFalse(_batchScopes.TryDequeue(out var scope)); Contract.ThrowIfFalse(_batchScopes.TryDequeue(out var scope));
scope.Dispose(); scope.Dispose();
} }
internal VisualStudioProject GetProject_TestOnly() internal VisualStudioProject GetProject_TestOnly()
{ {
return _visualStudioProject; return _visualStudioProject;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册