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

Copy extension binaries during main vscode task #6392

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

jmcphers
Copy link
Collaborator

@jmcphers jmcphers commented Feb 18, 2025

This change addresses an issue in which the tree-sitter.wasm file does not load in release builds, which causes R testing to fail.

This problem is a regression from the 1.96 merge. The problem was that we were copying the binaries as part of the build task compileExtensionsBuildTask.

const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
compileBuildTask,
compileExtensionsBuildTask,
compileExtensionMediaBuildTask,
minified ? minifyVSCodeTask : bundleVSCodeTask,
vscodeTaskCI
));

After 1.96, this build task is no longer invoked as part of the main vscode task; it was replaced with compileNonNativeExtensionsBuildTask.

const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
compileBuildTask,
cleanExtensionsBuildTask,
compileNonNativeExtensionsBuildTask,
compileExtensionMediaBuildTask,
minified ? minifyVSCodeTask : bundleVSCodeTask,
vscodeTaskCI
));

This change did not generate a merge conflict since there are no Positron edits to this list.

The fix is to add the copyExtensionBinariesTask to the main vscode task in a Positron code fence, to reduce the odds of this situation happening again.

Addresses #6345.

Reusing VS Code's tree-sitter-wasm

As a side note, the first thing I tried was using VS Code's tree-sitter-wasm instead of continuing to bundle a redundant copy in positron-r. This turned out to be more of a mess than it was worth. Specifically:

  • it is possible to cause VS Code's tree-sitter.wasm file to load using the locateFile option in Parser.init, but it is not compatible with the JavaScript side of the module
  • it is also not possible (or at least not easy) to wholly switch from web-tree-sitter => @vscode/tree-sitter-wasm due to API differences

Release Notes

New Features

  • N/A

Bug Fixes

QA Notes

I'm surprised this problem is not causing more failures! This fix isn't really specific to R or testing UI. If you see any issues post 1.96 that appear to be due to a missing binary in an extension, this is a likely cause.

Copy link

github-actions bot commented Feb 18, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@jmcphers jmcphers requested a review from juliasilge February 18, 2025 23:52
@jmcphers jmcphers force-pushed the bugfix/tree-sitter-module branch from 7520e9c to b73444b Compare February 19, 2025 05:38
Copy link
Contributor

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

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

I made a local release build and the R package testing UI now works for me. ✅

Note

I had to blow away the state for the release build of Positron on my machine in order to get things going again. I think the state of the testing UI is stored in its broken, no-parsing, trying-to-run situation in some storage somewhere. If folks have run into this problem in the wild, I suspect they will need to also do this to get unstuck again.

@jmcphers jmcphers merged commit 44ee79e into main Feb 19, 2025
8 checks passed
@jmcphers jmcphers deleted the bugfix/tree-sitter-module branch February 19, 2025 16:42
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
@jennybc
Copy link
Member

jennybc commented Feb 19, 2025

Thanks @jmcphers for this!

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

Successfully merging this pull request may close these issues.

3 participants