Skip to main content
Version: Latest (In Progress)

Running the Extension

How to run the extension in a local environment.

Install the dependencies

Node.js is required and can be installed from here. From the "extension" folder in the root directory run:

npm install

The extension requires that the server to be running on port 8080. The server that the extension is looking for can be changed in the VSCode settings. To do this open the command palette(ctrl+shift+p Windows/Linux or cmd+shift+p), search for Clover, and change the debug Api Url setting.

Main -> Production

Dev -> Development

Local -> On your machine

Running in debug mode

Open the extension folder in VSCode Once it is loaded pressing f5 will open a debug version of VSCode with the extension installed. Alternatively, you can open the command palette with either CMD+Shift+P on Mac or CTRL+Shift+P on Windows/Linux and search for "Debug: Start Debugging". In the original VSCode instance there should now be a terminal open with the tab "Debug Console" open. This will display that clover has been activated and any console.log statements will be shown here.

Packaging the extension

For a more detailed explanation visit the Official VSCode Docs

First you need to install the Visual Studio Code Extension tool

npm install -g @vscode/vsce

To package the extension run:

vsce package

This will look at the values in the extensions package.json and generate a .vsix file that can then be installed in VSCode.

Installing from a .vsix file

Inside of the extension menu in VSCode:

  • Press the three dots in the top right of the menu
  • Press the "Install from VSIX..." option
  • Locate the file that was either downloaded or just created when packaging the extension.

Alternatively, it can be done through the command line

code --install-extension <path to .vsix file>

Publishing the extension

The extension is currently hosted on the Visual Studio Marketplace under Nick Rucinski's account(tur45021@temple.edu). The publisher id is "capstone-team-2.tu-clover" and the name of the extension is "CLOVER HCI".

The extension can either be updated from the command line by running

vsce publish --pat <Azure Private Key>

in the extension directory or by going to the extension management area in the Visual Studio Marketplace and manually updating the extension with a .vsix file.

The major, minor, or patch commands can be optionally added to increment the version number by 1.0.0, 0.1.0, or 0.0.1. If this is not supplied it refers to the package.json version number.

Building the docs

Run

npx typedoc

in the extension directory.

To update the docs shown on docusaurus move the tsdoc folder to /documentation/static/. This goes for the extension and webserver docs. To update the api doc run the server with the new changes and navigate to localhost:8080/api/v1/docs/doc.json and download the file. Replace the old apispec in "/documentation/static" with the new file

Running tests

To run the test fetchSuggestion:

npx jest suggestion.test.ts