Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>gitlab-example-extensionNew to Visual Studio Code? Get it now.
gitlab-example-extension

gitlab-example-extension

Tomas Vik

|
1,242 installs
| (0) | Free
Example of an extension hosted on GitLab
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

gitlab-example-extension

This project offers a single command: "Open GitLab Permalink". The main goal of this project is to show how to host a VS Code extension on GitLab.

Features

  • Open GitLab Permalink - this command will open GitLab repository website and highlights the current selection.

Repository

The purpose of this project is to build on top of the VS Code generated extension and provide automation for linting, testing and publishing the extension.

Automation

Linting

Task: yarn run lint

Linting is done using eslint and prettier. Code can be formatted/fixed automatically by running yarn run lint-fix

Unit Testing

Task: yarn run test-unit

Unit testing is done by mocha and assert. Only files that are not importing vscode can be unit tested.

The *.text.ts name format for both integration tests and unit tests is a bit confusing and potentially subject to change.

Integration testing

Task: yarn run test-integration

These tests need an X server and vscode binary to run. More information is in the official documentation on testing

Publishing

  1. Get a personal access token
  2. Add the token as AZURE_ACCESS_TOKEN environment variable to your project CI
  3. Change extension version in package.json commit, push and tag the commit.
  4. On tag pipelines, you can now manually trigger the publish step.

Extension Settings

  • gitlab.instanceUrl: the base URL for your GitLab instance, defaults to https://gitlab.com
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft