Autocomplete Hinter support for different p5.js versions#4151
Open
skyash-dev wants to merge 3 commits into
Open
Autocomplete Hinter support for different p5.js versions#4151skyash-dev wants to merge 3 commits into
skyash-dev wants to merge 3 commits into
Conversation
Member
|
Hi @skyash-dev just fyi I moved around a bunch of files recently as a final cleanup before we merge v6 into develop! I didn't realize there were other PRs that would be opened against this branch as it looked like most of the subissues had been resolved (except for 2 that had been assigned). You may need to resolve the merge conflicts or hold onto this PR until v6 is merged in the next week and then just point it at develop? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
Fixes #4104
Adds support for version-specific autocomplete hints by generating separate hinter datasets for p5.js v1 and v2, and reconfiguring the JavaScript language extension when the selected p5.js version changes.
Demo:
Changes:
Generate versioned hinter files
Updated
update-p5-hinter.jsto generate:p5-hinter-v1.jsfromhttps://p5js.org/reference/data.jsonp5-hinter-v2.jsfromhttps://beta.p5js.org/reference/data.jsonThis ensures the autocomplete dataset matches the selected p5.js version and includes APIs that are only available in v2.
Reconfigure language support on version changes
Added a dedicated CodeMirror compartment for the JavaScript language extension and reconfigure it when the selected p5.js version changes.
This allows the completion source to switch between the v1 and v2 hinter datasets without recreating editor state.
Version-aware completion source
p5JavaScript()now selects the appropriate hinter dataset based on the active p5.js version:p5HinterV1p5HinterV2I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)develop-codemirror-v6branch.Fixes #123