提交 db62d957 编写于 作者: J Jason Malinowski

Let StubProjects correctly return null bin paths

I should have overriden this from the start -- the ExplicitBinPath
didn't give you a way to specify you really did want it to be null.
上级 df4adf64
......@@ -94,12 +94,17 @@ internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObj
}
}
protected string ExplicitBinPath;
/// <summary>
/// A full path to the project bin output binary, or null if the project doesn't have an bin output binary.
/// </summary>
internal string BinOutputPath => ExplicitBinPath ?? VisualStudioProject.OutputFilePath;
// FYI: this can't be made virtual because there are calls to this where a 'call' instead of 'callvirt' is being used to call
// the method.
internal string BinOutputPath => GetOutputFilePath();
protected virtual string GetOutputFilePath()
{
return VisualStudioProject.OutputFilePath;
}
public IReferenceCountedDisposable<IRuleSetFile> RuleSetFile { get; private set; }
......@@ -128,7 +133,7 @@ internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObj
public VersionStamp Version { get; }
public IProjectCodeModel ProjectCodeModel { get; protected set; }
/// <summary>
/// The containing directory of the project. Null if none exists (consider Venus.)
/// </summary>
......@@ -235,7 +240,7 @@ internal IVisualStudioHostDocument GetCurrentDocumentFromPath(string filePath)
var id = _visualStudioWorkspace.CurrentSolution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(d => d.ProjectId == Id);
if (id != null)
{
{
return new DocumentProvider.ShimDocument(this, id, filePath);
}
else
......
......@@ -202,10 +202,17 @@ internal AbstractProject GetHostProject(ProjectId projectId)
private sealed class StubProject : AbstractProject
{
private readonly string _outputPath;
public StubProject(VisualStudioProjectTracker projectTracker, CodeAnalysis.Project project, IVsHierarchy hierarchy, string outputPath)
: base(projectTracker, null, project.Name + "_Stub", null, hierarchy, project.Language, Guid.Empty, null, null, null, null)
{
ExplicitBinPath = outputPath;
_outputPath = outputPath;
}
protected override string GetOutputFilePath()
{
return _outputPath;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册