This repository has been archived by the owner on Nov 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jeff Young
committed
Mar 25, 2016
1 parent
83ec5c4
commit e56f84b
Showing
57 changed files
with
23,696 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules/ | ||
out/ | ||
*.vsix | ||
team-extension.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// A launch configuration that compiles the extension and then opens it inside a new window | ||
{ | ||
"version": "0.1.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ], | ||
"stopOnEntry": false, | ||
"sourceMaps": true, | ||
"outDir": "${workspaceRoot}/out/src", | ||
"preLaunchTask": "npm" | ||
}, | ||
{ | ||
"name": "Launch Tests", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"runtimeExecutable": "${execPath}", | ||
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], | ||
"stopOnEntry": false, | ||
"sourceMaps": true, | ||
"outDir": "${workspaceRoot}/out/test", | ||
"preLaunchTask": "npm" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false // set this to true to hide the "out" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true // set this to false to include "out" folder in search results | ||
}, | ||
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Available variables which can be used inside of strings. | ||
// ${workspaceRoot}: the root folder of the team | ||
// ${file}: the current opened file | ||
// ${fileBasename}: the current opened file's basename | ||
// ${fileDirname}: the current opened file's dirname | ||
// ${fileExtname}: the current opened file's extension | ||
// ${cwd}: the current working directory of the spawned process | ||
|
||
// A task runner that calls a custom npm script that compiles the extension. | ||
{ | ||
"version": "0.1.0", | ||
|
||
// we want to run npm | ||
"command": "npm", | ||
|
||
// the command is a shell script | ||
"isShellCommand": true, | ||
|
||
// show the output window only if unrecognized errors occur. | ||
"showOutput": "silent", | ||
|
||
// we run the custom script "compile" as defined in package.json | ||
"args": ["run", "compile", "--loglevel", "silent"], | ||
|
||
// The tsc compiler is started in watching mode | ||
"isWatching": true, | ||
|
||
// use the standard tsc in watch mode problem matcher to find compile problems in the output. | ||
"problemMatcher": "$tsc-watch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.vscode/** | ||
typings/** | ||
out/test/** | ||
test/** | ||
src/** | ||
**/*.map | ||
.gitignore | ||
tsconfig.json | ||
gulpfile.js | ||
tsd.json | ||
tslint.json | ||
team-extension.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
#Visual Studio Team Services Extension Contributor Guide | ||
The instructions below will help you set up your development environment to contribute to this repository. | ||
Make sure you've already cloned the repo. :smile: | ||
|
||
## Ways to Contribute | ||
Interested in contributing to the vsts-vscode project? There are plenty of ways to contribute, all of which help make the project better. | ||
* Submit a [bug report](https://github.com/Microsoft/vsts-vscode/issues/new) or [feature request](https://github.com/Microsoft/vsts-vscode/issues/new) through the Issue Tracker | ||
* Review the [source code changes](https://github.com/Microsoft/vsts-vscode/pulls) | ||
* Submit a code fix for a bug (see `Submitting Pull Requests` below) | ||
* Participate in [discussions](https://github.com/Microsoft/vsts-vscode/issues) | ||
|
||
## Set up Node, npm and gulp | ||
|
||
### Node and npm | ||
**Windows and Mac OSX**: Download and install node from [nodejs.org](http://nodejs.org/) | ||
|
||
**Linux**: Install [using package manager](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) | ||
|
||
From a terminal ensure at least node 5.4.1 and npm 3: | ||
```bash | ||
$ node -v && npm -v | ||
v5.9.0 | ||
3.8.2 | ||
``` | ||
**Note**: To get npm version 3.8.2, you may need to update npm after installing node. To do that: | ||
```bash | ||
[sudo] npm install npm -g | ||
``` | ||
|
||
### Gulp | ||
Install gulp | ||
```bash | ||
[sudo] npm install gulp -g | ||
``` | ||
From the root of the repo, install all of the build dependencies: | ||
```bash | ||
[sudo] npm install --greedy | ||
``` | ||
|
||
### Install the Visual Studio Code Extension Manager (VSCE) | ||
Before packaging via gulp, ensure that you have the "vsce" tool installed globally. Otherwise, the package step will fail. | ||
|
||
From the root of the repo, run: | ||
```bash | ||
[sudo] npm install vsce -g | ||
``` | ||
|
||
## Build | ||
To build the extension, run the following from the root of the repo: | ||
|
||
```bash | ||
gulp | ||
``` | ||
This command will create the out\src and out\test folders at the root of the repository. | ||
|
||
## Tests | ||
Tests should be run with changes. Before you run tests, make sure you have built the extension. Run the following from the root of the repo: | ||
|
||
```bash | ||
gulp test | ||
``` | ||
To run the tests within Visual Studio Code, change the debug profile to "Launch Tests" and press `F5`. | ||
|
||
## Package | ||
The package command will package the extension into a Visual Studio extension installer (.vsix file). | ||
It will also transpile the TypeScript into the out\src and out\test folders. | ||
|
||
From the root of the repo: | ||
```bash | ||
gulp package | ||
``` | ||
The VSIX package will be created in the root of the repository. | ||
|
||
## All | ||
You can also build, run tests and package all at once. | ||
|
||
From the root of the repo: | ||
```bash | ||
gulp all | ||
``` | ||
The VSIX package will be created in the root of the repository. | ||
|
||
## Code Structure | ||
The code is structured between the Visual Studio Code extension file, the Team Services extension object, and the clients, contexts, helpers and services. | ||
|
||
### Visual Studio Code Extension file | ||
This is the file with the code called by Visual Studio Code to bootstrap the extension. **extension.ts** should be thin and delegate to the Team Services Extension object. | ||
|
||
### Team Services Extension object | ||
This is the object intended to have small methods that call to the feature-specific clients that manipulate the UI and make calls to Team Services via the service objects. When adding new commands, the functions that are called should be defined here. | ||
|
||
### Clients | ||
These are the clients used to talk to the services (see Services below). The clients can manipulate the UI but should be the only objects calling the feature-specific services. | ||
|
||
### Contexts | ||
* Git - This context is meant to contain the client-side Git configuration information | ||
* Server - This context is meant to contain the server-side information needed when making calls to Team Services | ||
|
||
### Helpers | ||
These are classes used to define constants, a logger, settings (configuration), strings and various utility functions. | ||
|
||
### Services | ||
All of the communication to Team Services should be done via services found in this folder. These services should not know anything about the client-side types used to manipulate the Visual Studio Code UI. The Q promise APIs found in the vso-node-api package is the model used in this extension. | ||
|
||
## Debugging | ||
To debug the extension, make sure you've installed all of the npm packages as instructed earlier. Then, open the root of the repository in Visual Studio Code and press F5. If you have the extension already installed, you'll need to uninstall it via the Command Palette and try again. | ||
|
||
During debugging, you may want to control how often polling occurs for build status and pull request updates. Or you may want to turn on debug console and winston logging. The [README.md](README.md) file has instructions on how to change those settings. | ||
|
||
## Code Styles | ||
1. The various gulp commands will run `tslint` and flag any errors. Please ensure that the code stays clean. | ||
2. All source files must have the following lines at the top: | ||
``` | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
``` | ||
3. We keep LF line-endings on the server. Please set the `core.safecrlf` git config property to true. | ||
``` | ||
git config core.safecrlf true | ||
``` | ||
|
||
## Contribution License Agreement | ||
In order to contribute, you will need to sign a [Contributor License Agreement](https://cla.microsoft.com/). | ||
|
||
## Submitting Pull Requests | ||
We welcome pull requests! Fork this repo and send us your contributions. Go [here](https://help.github.com/articles/using-pull-requests/) to get familiar with GitHub pull requests. | ||
|
||
Before submitting your request, ensure that `gulp all` succeeds. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Visual Studio Team Services Extension for Visual Studio Code | ||
|
||
Copyright (c) Microsoft Corporation | ||
|
||
All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished to do | ||
so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,112 @@ | ||
# vsts-vscode | ||
Visual Studio Team Services Extension for VS Code | ||
# Visual Studio Team Services Extension | ||
The extension allows you to manage your pull requests for your Team Services Git repositories as well as monitor builds and work items for your team project. It will use your Git repository information to connect to Team Services. | ||
|
||
![Visual Studio Team Services extension](assets/vscode.png) | ||
|
||
## Ensure you have a Team Services account | ||
If you do not already have a Team Services account, [sign up for Team Services](https://www.visualstudio.com/en-us/get-started/setup/sign-up-for-visual-studio-team-services). | ||
|
||
## Install the Extension | ||
First, you will need to install [Visual Studio Code](https://code.visualstudio.com/download) `0.10.8` or later. Then, in the Visual Studio Code Command Palette (`F1`) select `Install Extension` and choose `Visual Studio Team Services` by Microsoft. | ||
|
||
You'll also need to create a personal access token on your Team Services account and add it to Visual Studio Code's user settings. The extension uses basic authentication with your personal access token in the password field to authenticate you with Team Services. | ||
|
||
To create the token and add it to your user settings: | ||
1. Go [here](https://www.visualstudio.com/en-us/get-started/setup/use-personal-access-tokens-to-authenticate) to learn how to create a personal access token for your account. | ||
- When you create your token, ensure you create it for **All Scopes**. | ||
- If you would rather not use *All Scopes*, you can enable **Build (read)**, **Code (read)** and **Work items (read)**. If you do this, note that the Build Status indicator will not function properly until an upcoming update to Team Services. Once that update is available, the Build Status indicator will begin to function normally and we will update these instructions. | ||
2. Open Visual Studio Code's user settings (**File > Preferences > User Settings**) and add an entry similar to the one below. | ||
```javascript | ||
"team.accessTokens": [ | ||
{ | ||
"account": "your-account-name", | ||
"token": "access-token" | ||
} | ||
] | ||
``` | ||
3. Replace **your-account-name** with the name of your Team Services account. For example, if your Team Services URL is `https://fabrikam.visualstudio.com`, your account name is **fabrikam**. | ||
4. Replace **access-token** with the token you created earlier. | ||
|
||
If you would like to add multiple accounts, simply add an additional entry per account. | ||
|
||
The extension also supports a *global access token*. A global access token is one that can be used across all of the Team Services accounts that you have access to (so you will not need to add a token per account in your User Settings). To create a global token, set the "Accounts" value on the "Create a personal access token" page to "All accessible accounts". After creating that global token, add an entry to `team.accessTokens` similar to the following: | ||
```javascript | ||
"team.accessTokens": [ | ||
{ | ||
"account": "global", | ||
"token": "global-access-token" | ||
} | ||
] | ||
``` | ||
- Replace **global-access-token** with the global token you created. | ||
|
||
If the extension doesn't find an *account-specific* access token, it'll look for the *global* token. | ||
|
||
## Open a local Team Services Repository folder | ||
After adding your personal access token and restarting Visual Studio Code, open either the root folder or sub-folder of the Team Services repository. Once a Team Services repository is detected by the extension, the status bar indicators will be active and the commands will be ready. | ||
|
||
**Note:** In order for the extension to be activated, a repository *folder* must be opened. The extension won't be activated if only a single *file* in the repository is opened. | ||
|
||
## Status Bar Indicators | ||
* ![Team Project indicator](assets/project-indicator.png) – This status bar item is populated with the name of the team project to which the Git repository belongs. Clicking on the item will open your browser to the team website. | ||
|
||
* ![Pull Requests indicator](assets/pullrequest-indicator.png) – This status bar item is a count of active pull requests that you either requested yourself or were added to explicitly as a reviewer. Clicking the item will display that list of pull requests in the quick pick list. Choosing one will take you to that pull request in your browser. This indicator will update its status every 5 minutes. | ||
|
||
* ![Build Status indicator](assets/buildstatus-indicator.png) – This status bar item shows the status of the build for this particular repository and branch. Hovering over the item will provide additional information about which build was referenced (if any). Clicking on the item will take you to that build’s summary page in your browser. This indicator will update its status every 5 minutes. | ||
|
||
## Commands | ||
In addition to the status bar integrations, the extension also provides several commands for interacting with Team Services. In the Command Palette (`F1`), type ```team``` and choose a command. | ||
|
||
* `team create bug` – Opens your browser to the webpage used to create a new bug. If a single line of text is highlighted in Visual Studio Code, it will be used as the title of the bug. The bug will be assigned to you. You can then choose to update the fields, save, cancel, etc. | ||
|
||
* `team create pull request` – Opens your browser for a new pull request based on the current repository and branch. Before creating the pull request, ensure that you save, commit and push any changes you have before running the command. Doing so will ensure that all of your latest changes are part of the pull request. | ||
|
||
* `team create task` – Opens your browser to the webpage used to create a new task. If a single line of text is highlighted in Visual Studio Code, it will be used as the title of the task. The task will be assigned to you. You can then choose to update the fields, save, cancel, etc. | ||
|
||
* `team create work item` – Prompts you to choose a work item type from the list available in your team project. Once you make a selection, your browser is opened to the webpage used to create the work item. If a single line of text is highlighted in Visual Studio Code, it will be used as the title of the task. The work item will be assigned to you. You can then choose to update the fields, save, cancel, etc. | ||
|
||
* `team send feedback` – Prompts you to either send a smile or a frown. After choosing, you can provide us feedback of up to 1000 characters. Optionally, provide your email address so we can contact if you needed. If you do not want to provide your email address, leave it empty (we'll still get your feedback). | ||
|
||
* `team view blame` – If a file in the repository is opened in the editor, it will open your browser to the blame page for that file in the current branch in the server repository. | ||
|
||
* `team view build summary` – Same behavior as clicking on the Build Status status bar item. | ||
|
||
* `team view history` – If a file in the repository is opened in the editor, it will open your browser to the history page for that file in the current branch in the server repository. Otherwise, the history of the current branch in the server repository will be opened. | ||
|
||
* `team view pull requests` – Same behavior as clicking on the Pull Requests status bar item. | ||
|
||
* `team view website` – Same behavior as clicking on the team project status bar item. | ||
|
||
* `team view work items` – Prompts you to choose a work item that is assigned to you, sorted by ChangedDate descending. Choosing a work item will open it in your browser. | ||
|
||
* `team view work item queries` – Prompts you to choose a query stored in your “My Queries” folder in your Team Services team project. Choosing a query will run it and display the results in the Quick Pick list. Choosing one of the results will open that work item in your browser. If you don’t have any queries under “My Queries”, you can go to `https://account.visualstudio.com/DefaultCollection/project/_workitems` (where *account* is your account name and *project* is your team project) to create one. | ||
|
||
## How to disable telemetry reporting | ||
The Visual Studio Team Services extension collects usage data and sends it to Microsoft to help improve our products and services. Read our [privacy statement](http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409) to learn more. | ||
|
||
If you don’t wish to send usage data to Microsoft (including any feedback via the `send feedback` command), add the following entry to User Settings (**File > Preferences > User Settings**): | ||
```javascript | ||
"team.appInsights.enabled": "false" | ||
``` | ||
|
||
## Polling interval | ||
The polling interval for the pull request and build status bar indicators defaults to five minutes. You can change this value in the Visual Studio Code User Settings by adding an entry like the one below. The minimum value is 1. | ||
```javascript | ||
"team.pollingInterval": 2 | ||
``` | ||
|
||
## Logging | ||
There may be times when you need to enable file logging to troubleshoot an issue. There are five levels of logging (`error`, `warn`, `info`, `verbose` and `debug`). Since logging is disabled by default, you can add an entry like the one shown below to Visual Studio Code's User Settings. Once you are finished logging, either remove the setting or set it to an empty string. | ||
```javascript | ||
"team.logging.level": "debug" | ||
``` | ||
The log file will be placed at the root of your workspace and will be named `team-extension.log`. | ||
|
||
## Contributing to the Extension | ||
See the [developer documentation](CONTRIBUTING.md) for details on how to contribute to this extension. | ||
|
||
## Privacy Statement | ||
The [Microsoft Visual Studio Product Family Privacy Statement](http://go.microsoft.com/fwlink/?LinkId=528096&clcid=0x409) describes the privacy statement of this software. | ||
|
||
## License | ||
This extension is [licensed under the MIT License](LICENSE.txt). Please see the [third-party notices](Third Party Notices.txt) file for additional copyright notices and license terms applicable to portions of the software. |
Oops, something went wrong.