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

Adds ability to install a missing bsc version #583

Merged
merged 31 commits into from
Sep 23, 2024

Conversation

TwitchBronBron
Copy link
Member

@TwitchBronBron TwitchBronBron commented Jul 30, 2024

Adds the ability to install brighterscript versions automatically without requiring it to exist in ${workspaceFolder}/node_modules.

  1. After this PR, the bsdk value can support the following values:

    • an absolute path to a preinstalled version of brighterscript (i.e. C:/roku/brighterscript)
    • a relative path to a preinstalled version of brighterscript (i.e. ./node_modules/brighterscript)
    • an exact version of brighterscript from the npm registry (i.e. 0.67.6, 1.0.0-alpha.36)
    • an absolute path to a .tgz file (i.e. C:/downloads/brighterscript-0.67.6.tgz)
    • a relative path to a .tgz file (i.e. ./packages/brighterscript-0.67.6.tgz)
    • a URL to a .tar file (i.e. npm install https://github.com/rokucommunity/brighterscript/releases/download/v0.67.6/brighterscript-0.67.6.tgzz)
  2. We've added a new setting called npmCacheRetentionDays which determines how long to wait before deleting unused brighterscript versions from the local cache.

  3. Added a new command called clearNpmPackageCache which will clear all downloaded brighterscript packages

  4. Added a new series of menu options for downloading brighterscript versions, and also a few maintenance items like opening the install directory or clearing the downloaded files
    image

Here's a demo of the feature in action:

bsc-picker.mp4

TODO:

  • add menu item/command to clear all cached versions
  • delete bsc versions that are older than 45 days (make this configurable)
  • add vscode.window.onDidChangeWindowState event to mark a bsc version's "last used date"
  • show all npm versions in the dropdown
  • show mainline and prerelease versions in separate menus
  • verify the extension storage gets cleaned up on extension uninstall (there's no way to do this, it's probably fine?)

Comment on lines +3090 to +3093
"command": "extension.brightscript.clearNpmPackageCache",
"title": "Clear the extension's local node_modules cache",
"category": "BrighterScript",
"icon": "$(link-external)"
Copy link
Member Author

Choose a reason for hiding this comment

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

@chrisdp what do you think about this command name and the message?

@@ -21,6 +28,13 @@ export class LanguageServerInfoCommand {
label: `View language server logs`,
description: ``,
command: this.focusLanguageServerOutputChannel.bind(this)
}, {
label: `Delete cached brighterscript versions`,
Copy link
Member Author

Choose a reason for hiding this comment

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

@chrisdp what do you think of this message?

@TwitchBronBron TwitchBronBron added the create-vsix PRs with this tag will trigger a vsix build on vscode-brightscript-language for every push label Sep 20, 2024
@rokucommunity-bot
Copy link

Hey there! I just built a new version of the vscode extension based on 112a5d1. You can downloaded the .vsix here and then follow these installation instructions.

@TwitchBronBron TwitchBronBron marked this pull request as ready for review September 23, 2024 14:48
@rokucommunity-bot
Copy link

Hey there! I just built a new version of the vscode extension based on 43e015f. You can downloaded the .vsix here and then follow these installation instructions.

@TwitchBronBron TwitchBronBron merged commit db3dfcd into master Sep 23, 2024
5 checks passed
@TwitchBronBron TwitchBronBron deleted the enhanced-bsc-picker branch September 23, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-vsix PRs with this tag will trigger a vsix build on vscode-brightscript-language for every push
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant