@@ -1054,7 +1054,7 @@ private CSharpDirective() { }
1054
1054
"sdk" => Sdk . Parse ( errors , sourceFile , span , directiveKind , directiveText ) ,
1055
1055
"property" => Property . Parse ( errors , sourceFile , span , directiveKind , directiveText ) ,
1056
1056
"package" => Package . Parse ( errors , sourceFile , span , directiveKind , directiveText ) ,
1057
- "project" => Project . Parse ( errors , sourceFile , span , directiveText ) ,
1057
+ "project" => Project . Parse ( errors , sourceFile , span , directiveKind , directiveText ) ,
1058
1058
_ => ReportError < Named > ( errors , sourceFile , span , string . Format ( CliCommandStrings . UnrecognizedDirective , directiveKind , sourceFile . GetLocationString ( span ) ) ) ,
1059
1059
} ;
1060
1060
}
@@ -1213,8 +1213,13 @@ public sealed class Project : Named
1213
1213
{
1214
1214
private Project ( ) { }
1215
1215
1216
- public static Project Parse ( ImmutableArray < SimpleDiagnostic > . Builder ? errors , SourceFile sourceFile , TextSpan span , string directiveText )
1216
+ public static new Project ? Parse ( ImmutableArray < SimpleDiagnostic > . Builder ? errors , SourceFile sourceFile , TextSpan span , string directiveKind , string directiveText )
1217
1217
{
1218
+ if ( directiveText . IsWhiteSpace ( ) )
1219
+ {
1220
+ return ReportError < Project ? > ( errors , sourceFile , span , string . Format ( CliCommandStrings . MissingDirectiveName , directiveKind , sourceFile . GetLocationString ( span ) ) ) ;
1221
+ }
1222
+
1218
1223
try
1219
1224
{
1220
1225
// If the path is a directory like '../lib', transform it to a project file path like '../lib/lib.csproj'.
0 commit comments