Plugin that modifies text using shell utilities.
Implemented using napi-rs
- a framework for building compiled Node.js add-ons in Rust via Node-API.
- src/ - contains extension source functions that interact with VSCode API
- custom_command/ - contains Napi project with Rust source files that will be build into native module for Node.js
- Go to project directory:
cd ./plugin_rs
- Install extension dependencies
npm install
- Build Rust module:
cd custom_command
- install dependencies with
yarn install
- install
napi
cli
npm install -g @napi-rs/cli
- build module
napi build --platform --release
When plugin is built, it can be run in debug mode to test functionality.
- Open
extension.ts
in VSCode and run with F5. - Select text to modify and open
Command Palette
by pressingCtrl
+Shift
+P
or by navigating toView
->Command Palette
in VSCode menu. - Select
CustomTextModification: Modify text with utility
and select command from history or type command in window.
- Install Visual Studio Code Extensions command line tool
vsce
:
npm install -g @vscode/vsce
- Build extension package:
vsce package
- Run in VSCode:
- switch to
Extensions
panel - select
Install from VSIX
in menu - select .vsix package created by previous command
Implemented with plain TypeScript.
- src/ - contains extension source functions that interact with VSCode API.
- Go to project directory:
cd ./plugin_ts
- Install extension dependencies
npm install
When plugin is built, it can be run in debug mode to test functionality.
- Open
extension.ts
in VSCode and run with F5. - Select text to modify and open
Command Palette
by pressingCtrl
+Shift
+P
or by navigating toView
->Command Palette
in VSCode menu. - Select
CustomTextModification: Modify text with utility
and select command from history or type command in window.
- Install Visual Studio Code Extensions command line tool
vsce
:
npm install -g @vscode/vsce
- Build extension package:
vsce package
- Run in VSCode:
- switch to
Extensions
panel - select
Install from VSIX
in menu - select .vsix package created by previous command