-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidy up Sapling VS Code extension's CONTRIBUTING.md
Summary: Add some Markdown formatting, as well as fix some typos, grammar, punctuation, capitalization, etc., to tidy up Sapling VS Code extension's `CONTRIBUTING.md` Reviewed By: evangrayk Differential Revision: D66506218 fbshipit-source-id: 85847b3fc454755a9634f9df95c9f6f609e03e3f
- Loading branch information
1 parent
a49dd0b
commit da33eb0
Showing
1 changed file
with
28 additions
and
28 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 |
---|---|---|
@@ -1,58 +1,58 @@ | ||
# Sapling VS Code extension | ||
|
||
This folder contains the VS Code extension, | ||
including Sapling SCM provider and embedded ISL. | ||
including the Sapling SCM provider and embedded ISL. | ||
|
||
Note: this file acts the techincal README for the vscode/ folder, | ||
while README.md is the user-facing description of the extension visible in the extension marketplace. | ||
> NOTE: This file acts as the technical `README` for the `vscode/` folder, | ||
> while `README.md` is the user-facing description of the extension visible in the extension marketplace. | ||
The vscode extension consists of two forms of javascript: | ||
The VS Code extension consists of two forms of JavaScript: | ||
|
||
- extension code, running in the vscode extension host process. | ||
This code uses the vscode API and acts like a node process. | ||
- (ISL) webview code, running in a vscode webview. | ||
This code cannot use the vscode API, and acts like its running in a browser. | ||
- Extension code, running in the VS Code extension host process. | ||
This code uses the VS Code API and acts like a node process. | ||
- Webview code (of ISL), running in a VS Code webview. | ||
This code cannot use the VS Code API, and acts like it's running in a browser. | ||
|
||
The two are built separately, and communicate via message passing. | ||
Unlike web `sl` in isl-server/proxy, this does not use websockets | ||
but rather VS Code's own message passing system (which still works across remoting). | ||
Unlike web `sl` in `isl-server/proxy`, this does not use WebSockets | ||
but rather VS Code's own message passing system (which still works across remote connections). | ||
|
||
## Building & Running | ||
|
||
Build artifacts live in `./dist`. | ||
|
||
**Development**: | ||
**Development** | ||
|
||
`yarn watch-extension` to compile extension code | ||
`yarn watch-webview` to compile webview code | ||
- `yarn watch-extension` to compile extension code | ||
- `yarn watch-webview` to compile webview code | ||
|
||
**Production**: | ||
**Production** | ||
|
||
`yarn build-extension` to build production extension code | ||
`yarn build-webview` to build production extension code | ||
- `yarn build-extension` to build production extension code | ||
- `yarn build-webview` to build production webview code | ||
|
||
**Dogfooding** | ||
|
||
You can use a development build of the vscode extension by symlinking into this folder, | ||
since package.json points to `dist/`: | ||
You can use a development build of the VS Code extension by symlinking into this folder, | ||
since `package.json` points to `dist/`: | ||
|
||
``` | ||
```sh | ||
ln -s ./vscode ~/.vscode/extensions/meta.sapling-scm-100.0.0-dev | ||
``` | ||
|
||
**Debugging** | ||
|
||
VS Code Webview source maps don't load automatically, since we produce separate .js.map files | ||
VS Code webview source maps don't load automatically, since we produce separate `.js.map` files | ||
instead of inline source maps. The VS Code webview resource system doesn't seem to load these correctly. | ||
|
||
To get source maps in the webview, you need to load them manually: | ||
|
||
- Open ISL in vscode | ||
- Open the developer tools from the Help menu | ||
- Go to the "console" tab | ||
- Change "top" to the "pending-frame" that corresponds to ISL | ||
- open webview.js in the "sources" tab. (e.g. from a stack trace) | ||
- right click on the file, choose "Add source map..." | ||
- enter the full URL to the .map file: `file:///path/to/addons/vscode/dist/webview/webview.js.map` | ||
1. Open ISL in VS Code | ||
2. Open the developer tools from the Help menu | ||
3. Go to the "console" tab | ||
4. Change "top" to the "pending-frame" that corresponds to ISL | ||
5. Open `webview.js` in the "sources" tab (e.g. from a stack trace) | ||
6. Right-click on the file, choose "Add source map..." | ||
7. Enter the full URL to the `.map` file: `file:///path/to/addons/vscode/dist/webview/webview.js.map` | ||
|
||
Enjoy your proper stack traces, files, breakpoints! | ||
Enjoy your proper stack traces, files, and breakpoints! :D |