Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
Contributions to this project are released to the public under the project's open source license.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
- Fork and clone the repository
- Set up a local build
- Create a new branch:
git checkout -b my-branch-name
- Make your change
- Push to your fork and submit a pull request
- Pat yourself on the back and wait for your pull request to be reviewed and merged.
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
- Follow the style guide.
- Write tests. Tests that don't require the VS Code API are located here. Integration tests that do require the VS Code API are located here.
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
- Write a good commit message.
Make sure you have a fairly recent version of vscode (>1.32) and are using nodejs version >=v10.13.0. (Tested on v10.15.1 and v10.16.0).
This repo uses Rush to handle package management, building, and other operations across multiple projects. See the Rush "Getting started as a developer" docs for more details.
If you plan on building from the command line, it's easiest if Rush is installed globally:
npm install -g @microsoft/rush
Note that when you run the rush
command from the globally installed version, it will examine the
rushVersion
property in the repo's rush.json
, and if it differs from the globally installed
version, it will download, cache, and run the version of Rush specified in the rushVersion
property.
If you plan on only building via VS Code tasks, you don't need Rush installed at all, since those
tasks run common/scripts/install-run-rush.js
to bootstrap a locally installed and cached copy of
Rush.
After updating any package.json
file, or after checking or pulling a new branch, you need to
make sure all the right npm packages are installed, which you would normally do via npm install
in
a single-project repo. With Rush, you need to do an "update" instead:
Terminal > Run Task... > Update
$ rush update
Rush builds all projects in the repo, in dependency order, building multiple projects in parallel
where possible. By default, the build also packages the extension itself into a .vsix file in the
dist
directory. To build:
Terminal > Run Build Task...
(or just Ctrl+Shift+B
with the default key bindings)
rush build --verbose
Rush does a reasonable job of detecting on its own which projects need to be rebuilt, but if you need to force a full rebuild of all projects:
Terminal > Run Task... > Rebuild
rush rebuild --verbose
You can install the .vsix
file from within VS Code itself, from the Extensions container in the sidebar:
More Actions...
(top right) > Install from VSIX...
Or, from the command line, use something like (depending on where you have VSCode installed):
$ code --install-extension dist/vscode-codeql-*.vsix # normal VSCode installation
# or maybe
$ vscode/scripts/code-cli.sh --install-extension dist/vscode-codeql-*.vsix # if you're using the open-source version from a checkout of https://github.com/microsoft/vscode
You can use VS Code to debug the extension without explicitly installing it. Just open this directory as a workspace in VS Code, and hit F5
to start a debugging session.
- Trigger a release build on Actions by adding a new tag on master of the format
vxx.xx.xx
- Monitor the status of the release build in the
Release
workflow in the Actions tab. - Download the VSIX from the draft GitHub release that is created when the release build finishes.
- Log into the Visual Studio Marketplace.
- Click the
...
menu in the CodeQL row and click Update. - Drag the
.vsix
file you downloaded from the GitHub release into the Marketplace and click Upload. - Publish the draft GitHub release and confirm the new release is marked as the latest release at https://github.com/github/vscode-codeql/releases.