The GitLab Workflow extension for Visual Studio Code integrates GitLab Duo and other GitLab features directly into your IDE. It adds a GitLab Workflow panel to the VS Code sidebar where you can view issues, merge requests, and pipelines, and extend your view with custom queries.
To get started, install and configure the extension.
When configured, this extension brings the GitLab features you use every day directly into your VS Code environment:
The GitLab Workflow extension also streamlines your VS Code workflow with AI-assisted features:
When you view a GitLab project in VS Code, the extension shows you information about your current branch:
The GitLab Workflow extension uses one account for each VS Code Workspace (window). The extension automatically selects the account when:
git remote
configuration.What the extension shows in the status bar depends on your account setup:
To select a GitLab account for the active VS Code window, select the status bar item, or:
GitLab: Select Account for this Workspace
.When your Git repository can be associated with multiple GitLab projects, the extension cannot determine which account to use. This can happen when you have multiple remotes, for example:
origin
: git@gitlab.com:gitlab-org/gitlab-vscode-extension.git
personal-fork
: git@gitlab.com:myusername/gitlab-vscode-extension.git
In these cases, the extension adds a (multiple projects) label to show you must choose an account.
To select an account:
The Issues and Merge requests list updates with your selected project’s information.
Change your selectionTo change your project selection:
Issues and merge requests support GitLab slash commands to perform actions directly in VS Code.
Create a snippetCreate a snippet to store and share bits of code and text with other users. Snippets can be a selection or an entire file.
To create a snippet in VS Code:
GitLab: Create Snippet
.GitLab opens the new snippet’s page in a new browser tab.
Create a patch fileWhen you review a merge request, create a snippet patch when you want to suggest multi-file changes.
GitLab: Create snippet patch
, and select it. This command runs a git diff
command and creates a GitLab snippet in your project..patch
.VS Code opens the snippet patch in a new browser tab. The snippet patch’s description contains instructions on how to apply the patch.
Insert a snippetTo insert an existing single-file or multi-file snippet from a project you are a member of:
GitLab: Insert Snippet
and select it.To view issues and merge requests for a specific project:
Select an issue or merge request to open it in a new VS Code tab.
Review a merge requestUse this extension to review, comment on, and approve merge requests without leaving VS Code:
While viewing issues and merge requests in VS Code, select the merge request you want to review. Its sidebar entry expands with more information.
Under the merge request’s number and title, select Description to read more about the merge request.
To review the proposed changes to a file, select the file from the list to show it in a VS Code tab. GitLab shows diff comments inline in the tab. In the list, deleted files are marked in red:
Use the diff to:
To compare your branch with your project’s default branch, without creating a merge request:
The extension opens a new browser tab. It shows a diff between the most recent commit on your branch, and the most recent commit on your project’s default branch.
Open current file in GitLab UITo open a file from your current GitLab project in the GitLab UI, with specific lines highlighted:
Prerequisites:
To view security findings:
History
Static application security testing (SAST) in VS Code detects vulnerabilities in the active file. With early detection, you can remediate vulnerabilities before you merge your changes into the default branch.
When you trigger a SAST scan, the content of the active file is passed to GitLab and checked against SAST vulnerability rules. GitLab shows scan results in the primary side bar.
To learn about setting up SAST scanning, see SAST scanning in VS Code on GitLab Unfiltered.
Prerequisites:
To perform SAST scanning of a file in VS Code:
Open the file.
Trigger the SAST scan by either:
View the results of the SAST scan.
The results of the SAST scan are listed in descending order by severity. To see details of a finding, select it in the GITLAB REMOTE SCAN (SAST) section of the extension sidebar.
To search your project’s issues and merge requests directly from VS Code, use filtered search or Advanced Search. With filtered search, you use predefined tokens to refine your search results. Advanced Search provides faster, more efficient search across the entire GitLab instance.
Prerequisites:
To search the titles and description fields in your project:
GitLab: Search project merge requests
or GitLab: Search project issues
.GitLab opens the results in a browser tab.
Filter searches with tokensSearches in large projects return better results when you add filters. The extension supports these tokens for filtering merge requests and issues:
Token Example Description assigneeassignee: timzallmann
Username of the assignee, without @
. author author: fatihacet
Username of the author, without @
. label label: frontend
or label:frontend label: Discussion
A single label. Usable more than once, and can be used in the same query as labels
. labels labels: frontend, Discussion, performance
Multiple labels in a comma-separated list. Can be used in the same query as label
. milestone milestone: 18.1
Milestone title without %
. scope scope: created-by-me
or scope: assigned-to-me
or scope: all
. Issues and merge requests matching the given scope. Values: created-by-me
(default), assigned-to-me
or all
. title title: discussions refactor
Issues and merge requests with title or description matching these words. Don’t add quotation marks around phrases.
Token syntax and guidelines:
:
) after it, like label:
.
label :
) is invalid and returns a parse error.label: frontend
and label:frontend
are valid.label
and labels
tokens multiple times and together. These queries return the same results:
labels: frontend discussion label: performance
label: frontend label: discussion label: performance
labels: frontend discussion performance
(the resulting, combined query)You can combine multiple tokens in a single search query. For example:
title: new merge request widget author: fatihacet assignee: jschatz1 labels: frontend, performance milestone: 17.5
This search query looks for:
new merge request widget
fatihacet
jschatz1
frontend
and performance
17.5
You can assign different keyboard shortcuts for Accept Inline Suggestion, Accept Next Word Of Inline Suggestion, or Accept Next Line Of Inline Suggestion:
Preferences: Open Keyboard Shortcuts
command.To update your extension to the latest version:
gitlab.com
).RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4