You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build python .\build.py --wasm --npm --vscode --play --no-check --no-test to build VS Code extension
F5 to launch with the "Run VS Code Web Extension" configuration
Open a .qs file from the samples directory and start typing in it.
Expected:
Completion list shows up
Actual:
No completion. ctrl+space does force completion list to show up.
No qsharp.json involved anywhere.
This looks suspect in the debug output:
ERR recursive use of an object detected which would lead to unsafe aliasing in rust: Error: recursive use of an object detected which would lead to unsafe aliasing in rust
at imports.wbg.__wbindgen_throw (file:///Users/swernli/Programming/qsharp/vscode/out/extension.js#vscode-extension:31495:11)
at wasm://wasm/008e4686:wasm-function[2298]:0x1c2b3d
at wasm://wasm/008e4686:wasm-function[2300]:0x1c2b59
at wasm://wasm/008e4686:wasm-function[1667]:0x1af2a7
at _LanguageService.get_completions (file:///Users/swernli/Programming/qsharp/vscode/out/extension.js#vscode-extension:31061:22)
at QSharpLanguageService.getCompletions (file:///Users/swernli/Programming/qsharp/vscode/out/extension.js#vscode-extension:32000:41)
at async QSharpCompletionItemProvider.provideCompletionItems (file:///Users/swernli/Programming/qsharp/vscode/out/extension.js#vscode-extension:32980:25)
at async Se.provideCompletionItems (../../../vs/workbench/api/worker/extensionHostWorker.js:98:52770)
ORIGINAL:
There are many repros, but this is the one I'm working off. Will update the issue when I find a minimal repro and a specific blame commit.
I believe there are roughly two root causes that's causing the flaky behavior.
Completions- With update_document now being async and somewhat long-running, now, the compilation is not ready by the time get_completions is called for the same keystroke that updated the document. In fact, the language service is still mutably borrowed by the time we call get_completions . The code generated by wasm-bindgen actually detects this and throws up the error above. FIX: The language service needs to be able to handle async, long-running compilation updates. This is nontrivial and requires implementing some kind of message queue for when the update messages (i.e. keystrokes) inevitably get backed up behind recompiling the project. Fix almost complete here: https://github.com/microsoft/qsharp/tree/minestarks/fix-async
Open buffer updates in project mode - When an open document is part of a project, and we receive buffer updates to that open document, the compilation needs to be updated with the current contents of the open buffer. Instead we reread the contents from disk for that file. The result is that it appears that updates don't even "take" until the document is saved, i.e. squiggles only appear after the document is saved. FIX: The project compilation/recompilation path needs to be reworked to take open buffers into account.
Since the issue is mitigated in main by reverting the PR, I'm closing this issue. To bring back multi-file support for the language service I believe we need to fix the two above issues first.
UPDATE 12pm:
Narrowed down to commit 8be9143 .
Minimal repro for completion issue:
python .\build.py --wasm --npm --vscode --play --no-check --no-test
to build VS Code extensionExpected:
Completion list shows up
Actual:
No completion. ctrl+space does force completion list to show up.
No
qsharp.json
involved anywhere.This looks suspect in the debug output:
ORIGINAL:
There are many repros, but this is the one I'm working off. Will update the issue when I find a minimal repro and a specific blame commit.
test
in the root of the workspace (which issamples
)foo.qs
insidetest
.@EntryPoint
in that file. Observe language service behavior. errors, completions seem to worktest/qsharp.json
with contents{}
.bar.qs
. Observe language service behavior. errors start appearingSecond repro - single files
test
in the same place.The text was updated successfully, but these errors were encountered: