Skip to content

Commit 3b8c432

Browse files
authored
Expand #error version output to include compiler assembly path and use full commit SHA everywhere (#80894)
1 parent 459ce89 commit 3b8c432

18 files changed

+40
-59
lines changed

src/Compilers/CSharp/Portable/CSharpResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5460,7 +5460,7 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
54605460
<value>Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.</value>
54615461
</data>
54625462
<data name="ERR_CompilerAndLanguageVersion" xml:space="preserve">
5463-
<value>Compiler version: '{0}'. Language version: {1}.</value>
5463+
<value>Compiler version: '{0}'. Language version: {1}. Compiler path: '{2}'.</value>
54645464
</data>
54655465
<data name="IDS_FeatureAsyncMain" xml:space="preserve">
54665466
<value>async main</value>

src/Compilers/CSharp/Portable/Parser/DirectiveParser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,14 @@ private DirectiveTriviaSyntax ParseErrorOrWarningDirective(SyntaxToken hash, Syn
333333
if (errorText.Equals("version", StringComparison.Ordinal))
334334
{
335335
string version = CommonCompiler.GetProductVersion(typeof(CSharpCompiler));
336+
string assemblyPath = CommonCompiler.GetAssemblyLocation(typeof(CSharpCompiler));
336337
var specified = this.Options.SpecifiedLanguageVersion;
337338
var effective = specified.MapSpecifiedToEffectiveVersion();
338339

339340
var displayLanguageVersion = specified == effective ? specified.ToDisplayString() : $"{specified.ToDisplayString()} ({effective.ToDisplayString()})";
340341

341342
eod = this.AddError(eod, triviaOffset, triviaWidth, ErrorCode.ERR_CompilerAndLanguageVersion, version,
342-
displayLanguageVersion);
343+
displayLanguageVersion, assemblyPath);
343344
}
344345
else
345346
{

src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.de.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.es.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.fr.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.it.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.ja.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.ko.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Compilers/CSharp/Portable/xlf/CSharpResources.pl.xlf

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)