Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix language service panic when file isn't listed in the files field of qsharp.json #2109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minestarks
Copy link
Member

@minestarks minestarks commented Jan 18, 2025

Fixes #2090

Notably, this also changes how we treat the files field in qsharp.json for local projects their local dependencies.

Previously, if the qsharp.json explicitly listed any files , that list would take priority and we would skip crawling the directory.

With this change: we always crawl the src/ directory and include all found *.qs files in the project. But we raise an explicit error to the user if any of those files are missing from the files list.

@minestarks minestarks force-pushed the minestarks/doc-not-in-files branch from a3d9843 to b24e63b Compare January 22, 2025 19:03
@minestarks minestarks changed the title fix language service panic when file is under the project folder but … Fix language service panic when file isn't listed in the files field of qsharp.json Jan 22, 2025
@minestarks minestarks marked this pull request as ready for review January 22, 2025 19:17
@@ -436,7 +440,12 @@ fn explicit_files_list() {
packages: {},
},
lints: [],
errors: [],
errors: [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I'd prefer duplicating the original test, leaving it as the "confirm no errors in good configuration" test and making the copy a test specific to this new error.

Copy link
Member Author

@minestarks minestarks Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the unrelated changes. There are 2 new test cases here which ARE relevant.

I changed how we format the test output in these files, so that they are readable and only include the information that the tests are concerned with.

I got fed up with the ridiculously long Debug outputs we had been using.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Righteous fix!

);
}

#[tokio::test]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the 2 new test cases, in case you have trouble finding it in the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creating a new .qs file in a project folder where the qsharp.json has files list triggers panic
2 participants