Skip to content

Commit f1702c9

Browse files
committed
Merge pull request #4346 from KevinH-MS/Directives
#load directives...
2 parents 3fc89fe + cd0908b commit f1702c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1439
-902
lines changed

src/Compilers/CSharp/Portable/CSharpCodeAnalysis.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@
230230
<Compile Include="Compilation\AttributeSemanticModel.cs" />
231231
<Compile Include="Compilation\AwaitExpressionInfo.cs" />
232232
<Compile Include="Compilation\BuiltInOperators.cs" />
233+
<Compile Include="Compilation\SyntaxAndDeclarationManager.cs" />
234+
<Compile Include="Compilation\SyntaxAndDeclarationManager.LazyState.cs" />
233235
<Compile Include="Compilation\CSharpCompilerDiagnosticAnalyzer.cs" />
234236
<Compile Include="Compilation\CSharpCompilation.cs" />
235237
<Compile Include="Compilation\CSharpCompilationReference.cs" />

src/Compilers/CSharp/Portable/CSharpExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ internal static bool HasReferenceDirectives(this SyntaxTree tree)
351351
return csharpTree != null && csharpTree.HasReferenceDirectives;
352352
}
353353

354+
internal static bool HasReferenceOrLoadDirectives(this SyntaxTree tree)
355+
{
356+
var csharpTree = tree as CSharpSyntaxTree;
357+
return csharpTree != null && csharpTree.HasReferenceOrLoadDirectives;
358+
}
359+
354360
internal static bool IsAnyPreprocessorSymbolDefined(this SyntaxTree tree, ImmutableArray<string> conditionalSymbols)
355361
{
356362
var csharpTree = tree as CSharpSyntaxTree;

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

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

src/Compilers/CSharp/Portable/CSharpResources.resx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4161,15 +4161,9 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
41614161
<data name="CantReferenceCompilationOf" xml:space="preserve">
41624162
<value>Can't reference compilation of type '{0}' from {1} compilation.</value>
41634163
</data>
4164-
<data name="TreesMustHaveRootNode" xml:space="preserve">
4165-
<value>trees[{0}] must have root node with SyntaxKind.CompilationUnit.</value>
4166-
</data>
41674164
<data name="SyntaxTreeAlreadyPresent" xml:space="preserve">
41684165
<value>Syntax tree already present</value>
41694166
</data>
4170-
<data name="Trees0" xml:space="preserve">
4171-
<value>trees[{0}]</value>
4172-
</data>
41734167
<data name="SubmissionCanOnlyInclude" xml:space="preserve">
41744168
<value>Submission can only include script code.</value>
41754169
</data>
@@ -4641,4 +4635,20 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
46414635
<data name="ERR_DebugEntryPointNotSourceMethodDefinition" xml:space="preserve">
46424636
<value>Debug entry point must be a definition of a method declared in the current compilation.</value>
46434637
</data>
4638+
<data name="ERR_LoadDirectiveOnlyAllowedInScripts" xml:space="preserve">
4639+
<value>#load is only allowed in scripts</value>
4640+
</data>
4641+
<data name="ERR_PPLoadFollowsToken" xml:space="preserve">
4642+
<value>Cannot use #load after first token in file</value>
4643+
</data>
4644+
<data name="CouldNotFindFile" xml:space="preserve">
4645+
<value>Could not find file.</value>
4646+
<comment>File path referenced in source (#load) could not be resolved.</comment>
4647+
</data>
4648+
<data name="CannotHavePreviousSubmission" xml:space="preserve">
4649+
<value>Cannot have a previousSubmission when not a submission.</value>
4650+
</data>
4651+
<data name="SyntaxTreeFromLoadNoRemoveReplace" xml:space="preserve">
4652+
<value>SyntaxTree '{0}' resulted from a #load directive and cannot be removed or replaced directly.</value>
4653+
</data>
46444654
</root>

0 commit comments

Comments
 (0)