Add support for getting the output version

This was missed in an earlier PR.
This commit is contained in:
Ryan Nowak 2018-10-24 20:02:50 -07:00
parent 4d44639a51
commit e637e17d34
3 changed files with 32 additions and 0 deletions

View File

@ -60,6 +60,12 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem
return output;
}
public override async Task<VersionStamp> GetGeneratedOutputVersionAsync()
{
var (_, _, version) = await State.GetGeneratedOutputAndVersionAsync(ProjectInternal, this).ConfigureAwait(false);
return version;
}
public override bool TryGetText(out SourceText result)
{
return State.TryGetText(out result);
@ -81,5 +87,17 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem
result = null;
return false;
}
public override bool TryGetGeneratedOutputVersionAsync(out VersionStamp result)
{
if (State.IsGeneratedOutputResultAvailable)
{
result = State.GetGeneratedOutputAndVersionAsync(ProjectInternal, this).Result.outputVersion;
return true;
}
result = default(VersionStamp);
return false;
}
}
}

View File

@ -37,6 +37,11 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem
throw new NotSupportedException();
}
public override Task<VersionStamp> GetGeneratedOutputVersionAsync()
{
throw new NotSupportedException();
}
public override IReadOnlyList<DocumentSnapshot> GetImports()
{
return Array.Empty<DocumentSnapshot>();
@ -81,5 +86,10 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem
{
throw new NotSupportedException();
}
public override bool TryGetGeneratedOutputVersionAsync(out VersionStamp result)
{
throw new NotSupportedException();
}
}
}

View File

@ -26,10 +26,14 @@ namespace Microsoft.CodeAnalysis.Razor.ProjectSystem
public abstract Task<RazorCodeDocument> GetGeneratedOutputAsync();
public abstract Task<VersionStamp> GetGeneratedOutputVersionAsync();
public abstract bool TryGetText(out SourceText result);
public abstract bool TryGetTextVersion(out VersionStamp result);
public abstract bool TryGetGeneratedOutput(out RazorCodeDocument result);
public abstract bool TryGetGeneratedOutputVersionAsync(out VersionStamp result);
}
}