File tree Expand file tree Collapse file tree 3 files changed +3
-1
lines changed
ExternalProjects/BizHawk.SrcGen.ReflectionCache Expand file tree Collapse file tree 3 files changed +3
-1
lines changed Original file line number Diff line number Diff line change 6
6
<AnalysisModeReliability >Recommended</AnalysisModeReliability >
7
7
<AnalysisModePerformance >Recommended</AnalysisModePerformance >
8
8
<AnalysisModeUsage >Recommended</AnalysisModeUsage >
9
- <EmitCompilerGeneratedFiles >false</EmitCompilerGeneratedFiles > <!-- enable to copy Roslyn Source Gemerators ' outputs to $(ProjectDir)/obj/.../generated -->
9
+ <EmitCompilerGeneratedFiles >false</EmitCompilerGeneratedFiles > <!-- enable to copy Roslyn Source Generators ' outputs to $(ProjectDir)/obj/.../generated -->
10
10
<EnforceCodeStyleInBuild >true</EnforceCodeStyleInBuild >
11
11
<CentralPackageTransitivePinningEnabled >true</CentralPackageTransitivePinningEnabled >
12
12
<ContinuousIntegrationBuild Condition =" '$(GITLAB_CI)' != '' Or '$(APPVEYOR)' != '' " >true</ContinuousIntegrationBuild >
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ private sealed class NamespaceInferrer
27
27
28
28
private string CalcNamespace ( )
29
29
{
30
+ if ( _namespaces . Count is 0 ) return string . Empty ; // this can happen if the Analyzer is applied to a project with no source files
30
31
// black magic wizardry to find common prefix https://stackoverflow.com/a/35081977
31
32
var ns = new string ( _namespaces [ 0 ]
32
33
. Substring ( 0 , _namespaces . Min ( s => s . Length ) )
@@ -63,6 +64,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
63
64
64
65
public void Execute ( SourceProductionContext context , string nSpace )
65
66
{
67
+ if ( string . IsNullOrWhiteSpace ( nSpace ) ) return ; // see note in `CalcNamespace`
66
68
var src = $@ "#nullable enable
67
69
68
70
using System;
You can’t perform that action at this time.
0 commit comments