Skip to content

Commit 3556c7d

Browse files
Update CONTRIBUTING.md with instructions on building a .vsix (#893)
* Update CONTRIBUTING.md with instructions on building a .vsix Add instructions that outline how to build and install a .vsix from a local repository. This will help users who want to live on unreleased features without having to build and run the extension in an extension host. Co-authored-by: Adam Fowler <[email protected]>
1 parent 52cc3fe commit 3556c7d

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Welcome to the Swift Community!
1+
# Welcome to the Swift Community!
22

33
Contributions to vscode-swift are welcomed and encouraged! Please see the [Contributing to Swift guide](swift.org/contributing) and check out the [structure of the community](https://www.swift.org/community/#community-structure).
44

@@ -16,12 +16,44 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
1616
```
1717
More details on nvm installation can be found in the [README](https://github.com/nvm-sh/nvm/blob/master/README.md) from its GitHub repository.
1818

19-
Once you have installed nvm, clone this repository, and in the project directory run `nvm install`. This will install the correct version of Node.js for developing the extension. Then you should run `npm install` to install all the dependencies the extension requires.
19+
Once you have installed nvm, you can clone and configure the repository.
20+
21+
```sh
22+
git clone https://github.com/swift-server/vscode-swift.git && cd vscode-swift
23+
24+
# Install the correct version of Node.JS for developing the extension
25+
nvm install
26+
27+
# Installs all the dependencies the extension requires
28+
npm install
29+
```
2030

2131
When you first open the project in VS Code you will be recommended to also install [`ESLint`](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint), [`Prettier - Code formatter`](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) and [`esbuild Problem Matchers`](https://marketplace.visualstudio.com/items?itemName=connor4312.esbuild-problem-matchers). Please do so. `ESLint`, `Prettier - Code formatter` is used to ensure a consistent style and we expect everyone who contributes to follow this style as well. `esbuild Problem Matchers` provides proper error output from building the project.
2232

2333
To run your version of the Swift extension while in VS Code, press `F5`. This will open up another instance of VS Code with it running. You can use the original version of VS Code to debug it.
2434

35+
### Installing a pre-released version
36+
37+
If you'd like to try out a change during your day to day work that has not yet been released to the VS Code Marketplace you can build and install your own `.vsix` package from this repository.
38+
39+
#### Building
40+
41+
If you haven't already, follow the instructions in [Development](#development) to clone the repository and install its dependencies. Now we can generate the `.vsix` package:
42+
43+
```sh
44+
npm run dev-package
45+
```
46+
47+
This builds a file that looks like `swift-lang-[version]-dev.vsix`. Now install the extension with:
48+
49+
```sh
50+
code --install-extension swift-lang-[version]-dev.vsix
51+
```
52+
53+
Alternatively you can install the extension from the Extensions panel by clicking the `...` button at the top of the panel and choosing `Install from VSIX...`.
54+
55+
If you'd like to return to using the released version of the extension you can uninstall then reinstall Swift for VS Code from the Extensions panel.
56+
2557
## Submitting a bug or issue
2658

2759
Please ensure to include the following in your bug report:

0 commit comments

Comments
 (0)