|
1 | 1 | // Copyright (c) .NET Foundation. All rights reserved. |
2 | 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. |
3 | 3 |
|
| 4 | +#nullable enable |
| 5 | + |
4 | 6 | using System; |
5 | 7 | using System.Collections.Generic; |
6 | 8 | using System.IO; |
@@ -117,7 +119,7 @@ protected virtual void ConfigureProjectEngine(RazorProjectEngineBuilder builder) |
117 | 119 | { |
118 | 120 | } |
119 | 121 |
|
120 | | - protected CSharpSyntaxTree AddCSharpSyntaxTree(string text, string filePath = null) |
| 122 | + protected CSharpSyntaxTree AddCSharpSyntaxTree(string text, string? filePath = null) |
121 | 123 | { |
122 | 124 | var syntaxTree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(text, CSharpParseOptions, path: filePath); |
123 | 125 | CSharpSyntaxTrees.Add(syntaxTree); |
@@ -164,7 +166,7 @@ private RazorProjectItem CreateProjectItemFromText(string text, string filePath) |
164 | 166 | return projectItem; |
165 | 167 | } |
166 | 168 |
|
167 | | - protected RazorProjectItem CreateProjectItemFromFile(string filePath = null, string fileKind = null) |
| 169 | + protected RazorProjectItem CreateProjectItemFromFile(string? filePath = null, string? fileKind = null) |
168 | 170 | { |
169 | 171 | if (FileName == null) |
170 | 172 | { |
@@ -297,14 +299,14 @@ private CSharpCompilation CreateCompilation() |
297 | 299 | return compilation; |
298 | 300 | } |
299 | 301 |
|
300 | | - protected RazorProjectEngine CreateProjectEngine(Action<RazorProjectEngineBuilder> configure = null) |
| 302 | + protected RazorProjectEngine CreateProjectEngine(Action<RazorProjectEngineBuilder>? configure = null) |
301 | 303 | { |
302 | 304 | var compilation = CreateCompilation(); |
303 | 305 | var references = compilation.References.Concat(new[] { compilation.ToMetadataReference(), }).ToArray(); |
304 | 306 | return CreateProjectEngine(Configuration, references, configure); |
305 | 307 | } |
306 | 308 |
|
307 | | - private RazorProjectEngine CreateProjectEngine(RazorConfiguration configuration, MetadataReference[] references, Action<RazorProjectEngineBuilder> configure) |
| 309 | + private RazorProjectEngine CreateProjectEngine(RazorConfiguration configuration, MetadataReference[] references, Action<RazorProjectEngineBuilder>? configure) |
308 | 310 | { |
309 | 311 | return RazorProjectEngine.Create(configuration, FileSystem, b => |
310 | 312 | { |
|
0 commit comments