Skip to main content

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. If the server is deployed then setting the testing variable in "extension/src/api/types/endpoints.ts" to false will use that version. If set to true the extension will look for a localhost server running on port 8001.

Running in debug mode

Open the extension folder in VSCode Once it is loaded pressing f5 will opne 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.

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.temple-capstone-clover" and the name of the extension is "Temple Capstone Clover".

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

vsce publish

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.

Building the docs

Run

npx typedoc

in the extension directory.

Docs automatically get put in "/webserver/docs/tsdoc" so they can be served from the api.

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:8001/apispec_1.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