Skip to content

Help make the extensions Marketplace better for everyone. Take this survey!

| Marketplace
Sign in
Visual Studio Code>Other>VSCode Commands from ToSc and LiHuNew to Visual Studio Code? Get it now.
VSCode Commands from ToSc and LiHu

VSCode Commands from ToSc and LiHu

Tobias Schmidt 331

|
9 installs
| (0) | Free
VSCode Commands from ToSc and LiHu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

version installs build

vstosc

VSCode commands from ToSc and LiHu.

Installation

Open the Extensions Tab in VSCode's activity bar and search for vstosc. Then click install.

image

Usage

Hit F1 or Ctrl+Shift+P to open the Command Palette and then choose a command.

image image

For often used commands you might want to define a shortcut as shown below:

image image

Commands

updateRDocstring

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.

image

runSelection

Executes the current selection in a shell (/bin/sh or cmd.exe) and replaces the selection with the command output.

image

runCommand

Opens an input box asking the user for a command. The entered command will be run in a shell (/bin/sh or 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.

image

knitRmd

Sends the following text to the currently active console:

rmarkdown::render("<path-of-currently-active-file")

mathMode

Inserts ~$$ at the current position and places the cursor in between $$. A potential leading space is removed.

Contribute

  1. Clone this repo and open the folder in VSCode
  2. Run npm install to install all dependencies
  3. Modify package.json and src/extensions.ts as required (ChatGPT is your friend).
  4. Hit F5 to and run the extension in a new Extension Development Host window.
  5. See Debugging the extension in case something isn't working as expected.
  6. Increase the version in package.json according to the rules of Semantic versioning
  7. 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)

Publish

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:

  1. Run npm install -g @vscode/vsce to install the Visual Studio Code Extension Tool.
  2. Run vsce package to build the new package in VSCode package format .vsix
  3. Login to the VSCode Marketplace using a valid access token for the Azure DevOps Organization toscm using command vsce login toscm
  4. Publish the extension using command vsce publish

For further guidelines see VSCode Extension API and VSCode Publishing Extensions.

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft