rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[rush] VSCode Extension

Open chengcyber opened this issue 3 years ago • 3 comments

Summary

RushStack VSCode Extention

Details

Fixes https://github.com/microsoft/rushstack/issues/3157

How to develop in local

  1. Prepare
rush update
rush build --to rushstack
  1. Run predefined launcher in your VSCode

2022-02-05 at 5 29 AM

  1. Play in Extension Host

a [Extension Development Host] window should popup if everything works fine. Open a rush project now

2022-02-05 at 5 34 AM

2022-02-05 at 5 35 AM

2022-02-05 at 5 59 AM

How to pack a production version and install it locally

Run the following command, a vsix format file called "rushstack-0.0.0.vsix" will be generated.

cd vsce/vscode-extension
rushx package

Run code --install-extension rushstack-0.0.0.vsix to install the prod version of rushstack vscode extension Run code --uninstall-extension rushstack to uninstall it

Recipe: code --uninstall-extension rushstack || true && code --install-extension rushstack-0.0.0.vsix

chengcyber avatar Jan 16 '22 15:01 chengcyber

Questions 2022/3/3

  1. The way to get RushConfiguration and RushCommandLineParser 1.1 RushConfiguration is used to extract projects. 1.2 RushCommandLineParser is used to extract Rush commands and parameters For now, the idea is leverage rush-sdk, making rush-sdk supports reload from another location, may related with https://github.com/microsoft/rushstack/pull/3212

  2. rush add is a smart CLI, it uses the working directory (cwd) to decide the target project where the package should be installed to. It can be hardcode in Extension side like rush add push a project selector, or involving sth like a parameter configuration to make it as a canonical use case.

chengcyber avatar Mar 03 '22 10:03 chengcyber

Note: PR #3337 has renamed our GitHub master branch to main. This should not affect your pull request, but we recommend to redo your git clone to avoid confusion with the old branch name.

iclanton avatar Apr 09 '22 02:04 iclanton

Thanks to the hints from David's PR: https://github.com/microsoft/rushstack/pull/3651

I updated the building and packing process to rushstack vscode extension

Now, in extension development, it will be always try to load @microsoft/rush-lib first, while in a production version of extension, it will try to load @rushstack/rush-sdk from current workspace folders.

Also, this extension can be correctly packed to a "visx" format file, which means it's ready to be published to VSCode marketplace!

chengcyber avatar Nov 24 '22 02:11 chengcyber