Closed svick closed 3 years ago
This can be closed - it works now as expected
@bernd5 I'm not sure that's the case. Quoter now understands C# 9.0 top-level statements, but those are subtly different from C# scripts. For example, if you parse the code int i;
as "regular" C# code, then that's considered to be a global statement containing a local declaration statement and this is what Quoter shows. But if you parse it as a script, then it's treated as a field declaration statement instead.
On the other hand, the C# script dialect never became popular, so there may not be much need to do this.
Ah, right - I created a PR...
Right now, Roslyn Quoter always parses the input as a regular C# file. It would be nice if it also supported parsing the input as a script file (i.e.
SourceCodeKind.Script
).For example, parsing
f();
currently produces:I think there should be an option where it instead produces something like: