microsoft / qsharp-compiler

Q# compiler, command line tool, and Q# language server
https://docs.microsoft.com/quantum
MIT License
684 stars 172 forks source link

Conditionally treat capability warnings as errors (alternative approach) #1594

Closed DmitryVasilevsky closed 1 year ago

DmitryVasilevsky commented 1 year ago

Adding optional --error command line argument to treat specified capability errors as warnings. Accepts a list of warning numbers (space separated).

Language server accepts build property WarningsAsErrors - a list of semicolon separated warning numbers.

Diagnostics is generated as Warnings in F# code, but when the corresponding diagnostic in C# is constructed, its severity is controlled by the list of integers passed as the --error option. If the warning number is among the integers passed, it is generated as error.