README.md 3.2 KB
Newer Older
F
Fatih Acet 已提交
1
# [GitLab VSCode Extension](https://gitlab.com/fatihacet/gitlab-vscode-extension)
F
Fatih Acet 已提交
2

F
Fatih Acet 已提交
3
This extension adds GitLab specific options to VSCode command pallette and status bar like showing pipeline status or opening active file on GitLab and much more.
F
Fatih Acet 已提交
4

F
Fatih Acet 已提交
5
### Features
F
Fatih Acet 已提交
6

F
Fatih Acet 已提交
7
- Shows pipeline status for last commit on VSCode status bar.
8
- Shows MR id of your current branch on VSCode status bar and click it to view on GitLab.
F
Fatih Acet 已提交
9 10 11 12 13 14 15 16 17
- View current file on GitLab, including active line number and range selection.
- View MR of current branch on GitLab.
- View issues assigned to you on GitLab.
- View MRs assigned to you on GitLab.
- View current project on GitLab.
- Open new issue page for your current project.
- Open new MR page for your current project.
- Ability to add and remove your GitLab Personal Access Token.

18 19
**Curious to know what's next?** [See here](#whats-next)

F
Fatih Acet 已提交
20

F
Fatih Acet 已提交
21
### Setup
F
Fatih Acet 已提交
22

F
Fatih Acet 已提交
23
To use this extension, you need to create a GitLab Personal Access Token and give it to the extension.
F
Fatih Acet 已提交
24

F
Fatih Acet 已提交
25 26 27 28 29 30 31 32 33
##### Step 1: Create your Personal Access Token
- Go to "Settings" page on GitLab.com or your self hosted GitLab instance.
- On the left navigation menu, click "Access Tokens".
- On "Add a personal access token" form
  - Give a name to your token.
  - Select and expiry date.
  - Select "api" and "read_user" permissions.
  - Hit "Create personal access token" button.
- Copy the token. _Remember you won't be able to see value of this token ever again for security reasons._
F
Fatih Acet 已提交
34

F
Fatih Acet 已提交
35 36 37 38
##### Step 2: Add token to GitLab Workflow Extension
- Open up Command Palette by pressing `Cmd+Shift+P`.
- Search for "GitLab: Set GitLab Personal Access Token" and hit Enter.
- Extension will ask your PAT. Paste your PAT and hit Enter. _It won't be visible and accessible to others._
F
Fatih Acet 已提交
39

F
Fatih Acet 已提交
40
That's it. 🏁
F
Fatih Acet 已提交
41

F
Fatih Acet 已提交
42
You can start using this extension right away. If your project has a pipeline for last commit and a MR from your current branch, you should see them on VSCode status bar. 🎉
F
Fatih Acet 已提交
43

44

F
Fatih Acet 已提交
45
### Usage
F
Fatih Acet 已提交
46 47
- Open up Command Palette by pressing `Cmd+Shift+P`.
- Search for GitLab
F
Fatih Acet 已提交
48 49

![https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/gitlab-vscode.png](https://gitlab.com/fatihacet/gitlab-vscode-extension/raw/master/src/assets/gitlab-vscode.png)
F
Fatih Acet 已提交
50 51 52 53 54 55 56 57 58 59


### Configuration options

##### `gitlab.instanceUrl` (required: false, default: 'https://gitlab.com')
If you are using GitLab on a custom domain, you should add this to your user settings file. Example: `"gitlab.instanceUrl": "https://my-gitlab-domain.com"`

> You can open User Settings file by pressing `Cmd+,` on Mac OS or following `Code > Preferences > User Settings`. You can simply add extension configuration values to you User Settings file. This won't break or change anything on your VSCode.


60 61 62 63 64 65 66 67 68 69
### What's next?
- Pipeline link to pipeline status bar item.
- View last pipeline on GitLab
- Pipeline actions menu to quickly retry or cancel a pipeline.
- Issue and MR search
- Detailed issue and MR search
  - `title:MR discussions refactor label:frontend label:discussions assignee:fatihacet`
- Compare your changes with master on GitLab


F
Fatih Acet 已提交
70 71
### Contribution
This extension is open source and [hosted on GitLab](https://gitlab.com/fatihacet/gitlab-vscode-extension). Contributions are more than welcome. Feel free to fork and add new features or submit bug reports.