qdk icon indicating copy to clipboard operation
qdk copied to clipboard

Surface a warning or error if `src/` does not contain any `.qs` files as direct children

Open sezna opened this issue 1 year ago • 2 comments

As of #1416, if you are using implicit namespaces and nesting all of your source files deeply in the project, in the same nested directory, e.g. project/src/Microsoft/Quantum/Canon.qs and project/src/Microsoft/Quantum/Diagnostics.qs, you will experience non-intuitive behavior where the namespace detected will only be the final segment of the path (Canon and Diagnostics), not the full path Microsoft.Quantum.___. We should detect this and throw an error or warning.

Adding this to the linter may be difficult as the linter currently only has access to the AST, HIR, and FIR. So, this will likely have to be an error originating from the parser itself.

sezna avatar May 13 '24 21:05 sezna

Is the fact that it only has the final segment of the path in the generated namespace a bug?

ScottCarda-MS avatar Aug 07 '24 21:08 ScottCarda-MS

It should have everything after src/, is that not the behavior that you're seeing?

sezna avatar Aug 08 '24 13:08 sezna