mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
215 stars 26 forks source link

Shorthand values valid in MSBuild are treated as errors in the editor #170

Closed OronDF343 closed 5 months ago

OronDF343 commented 5 months ago

Certain values are understood by MSBuild but are reported as errors by the editor.

In these cases, it would be better if the editor reported a warning or suggestion rather than an error since the values are technically valid in MSBuild.

Example 1: LangVersion

10 is considered an error, 10.0 is considered valid.

<LangVerison>10</LangVersion>

image

Example 2: csharp-warning-code

1591 is considered an error, CS1591 is considered valid.

<NoWarn>$(NoWarn);1591</NoWarn>

image

mhutch commented 5 months ago

Thnks for the report!

Regarding the first one, I'll probably add some kind of aliasing mechanism, as I don't really want to treat "10" and "10.0" as separate values for the purposes of Find References etc.

Regarding the second, this was kinda intentional as I consider it good practice to include the prefix now we have so many other prefixes for analyzers, NuGet, etc. However, it is indeed valid to omit the prefix, and the editor should treat it as correct, but perhaps have an analyzer/fix to add the prefix.