-
Notifications
You must be signed in to change notification settings - Fork 97
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
Update test callable discovery to work within the language service #2095
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not done looking at all the files, posting all my comments for today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished looking. I really like the overall approach. Also I assume integration tests are coming up in a different PR.
@sezna hitting this odd bug where you can't navigate to the test case after it fails. |
I ran into an issue where if I open a notebook that includes Q# cells the test explorer loses its content and can't get it back until a full window reload: Screen.Recording.2025-01-13.at.10.40.09.AM.mov |
Just FYI @minestarks @swernli that test-disappearing bug is fixed and this is all green again. |
@@ -1,6 +1,7 @@ | |||
// Copyright (c) Microsoft Corporation. | |||
// Licensed under the MIT License. | |||
|
|||
import { ITestDescriptor } from "../../lib/node/qsc_wasm.cjs"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be imported as part of the following import list.
|
||
async onTestCallables(callables: ITestDescriptor[]) { | ||
try { | ||
const event = new Event("testCallables") as LanguageServiceEvent & Event; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this and onDiagnostics (line 278 above) now be the specific event type? (e.g. LanguageServiceDiagnosticEvent above and the TestCallables version here)
QscEventTarget, | ||
VSDiagnostic, | ||
log, | ||
ProgramConfig, | ||
TargetProfile, | ||
LanguageServiceDiagnosticEvent, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this rename it'll likely be a breaking change for QCOM. We'll need to ensure we communicate this when they take a new drop.
@@ -58,7 +60,35 @@ impl LanguageService { | |||
) | |||
.expect("callback should succeed"); | |||
}; | |||
let mut worker = self.0.create_update_worker(diagnostics_callback, host); | |||
|
|||
let test_callables_callback = test_callables_callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the initial call done on line 40 for the diagnostics callback unnecessary then? (Mine thinks it might be)
This PR rewrites #2059 to trigger test discovery from within the language server, as opposed to externally in an entirely separate context. Please read the description in that PR for more detail.
It also adds tests for LS state in both the Rust-based LS tests and the JS-based
basics.js
npm API tests.