VSCode commands from ToSc and LiHu.
Open the Extensions Tab in VSCode's activity bar and search for
vstosc. Then click
Ctrl+Shift+P to open the Command Palette and then choose a command.
For often used commands you might want to define a shortcut as shown below:
Updates the roxygen2 docstring of the R function the cursor currently is in.
⚠️WARNING: This command requires the R package toscutil (version 2.7.1 or greater). For now you have to install it by hand using command:
install.packages("toscutil") from within a running R session.
🗒️NOTE: In case a function is defined multiple times in the same file. The generated roxygen2 docstring will always be based on the last definition of the function.
Executes the current selection in a shell (
cmd.exe) and replaces the selection with the command output.
Opens an input box asking the user for a command. The entered command will be run in a shell (
cmd.exe) and the output is inserted at the current cursor position. In case there is text selected while the command is executed, the selected text will be used as stdin for the command and replaced with the command's output.
Sends the following text to the currently active console:
~$$ at the current position and places the cursor in between
$$. A potential leading space is removed.
- Clone this repo and open the folder in VSCode
npm install to install all dependencies
- Modify package.json and src/extensions.ts as required (ChatGPT is your friend).
- Hit F5 to and run the extension in a new Extension Development Host window.
- See Debugging the extension in case something isn't working as expected.
- Increase the version in package.json according to the rules of Semantic versioning
- Push your changes and tag the commit (see section publish for details about the publishing process triggered by tagging a commit from the main branch)
Whenever a commit from the main branch receives a tag, the publish action is triggered, which uploads the extension
vsce to the VSCode Marketplace. In case the pipeline fails and you want to do the publishing manually, the following steps would be required:
npm install -g @vscode/vsce to install the Visual Studio Code Extension Tool.
vsce package to build the new package in VSCode package format
- Login to the VSCode Marketplace using a valid access token for the Azure DevOps Organization toscm using command
vsce login toscm
- Publish the extension using command
For further guidelines see VSCode Extension API and VSCode Publishing Extensions.