Skip to content

Commit eba6a27

Browse files
authored
Update developer docs, don't --watch by default (#330)
A bunch of stuff in the docs is out of date. Also we no longer have any recommended workflows that use --watch.
1 parent cb68170 commit eba6a27

File tree

3 files changed

+38
-37
lines changed

3 files changed

+38
-37
lines changed

.vscode/tasks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121
"reveal": "silent",
2222
},
2323

24-
// Build bundle with sourcemaps, suitable for debugging.
25-
"args": ["run", "esbuild", "--", "--sourcemap"],
24+
"args": ["run", "compile"],
2625
}

DEVELOPING.md

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,49 @@ A guide of developing `vscode-clangd` extension.
77
* VS Code
88
* node.js and npm
99

10-
## Steps
11-
12-
1. Make sure you disable the installed `vscode-clangd` extension in VS Code.
13-
2. Make sure you have clangd in `/usr/bin/clangd` or edit `src/extension.ts` to
14-
point to the binary.
15-
3. To start a development instance of VS code extended with this, run:
10+
## Building and running (command line)
1611

1712
```bash
18-
$ cd vscode-clangd
19-
$ npm install
20-
$ npm run compile # it runs in watch mode, so you can hit ctrl^c.
21-
$ code . --extensionDevelopmentPath=$PWD
13+
cd vscode-clangd
14+
npm install
15+
npm run compile # it runs in watch mode, you can hit ctrl-c.
16+
code --extensionDevelopmentPath=$PWD
2217
```
2318

24-
# Contributing
19+
## Building, running, and debugging (VSCode)
2520

26-
Please follow the existing code style when contributing to the extension, we
27-
recommend to run `npm run format` before sending a patch.
21+
- ```bash
22+
cd vscode-clangd
23+
npm install
24+
code .
25+
```
26+
- with the `vscode-clangd` directory open in VSCode, select
27+
`Run => Run Without Debugging` or `Run => Start Debugging`
2828

29-
# Publish to VS Code Marketplace
29+
VSCode will recompile the sources for you before launching.
30+
If you change dependencies in `package.json`, you should run `npm install`.
3031

31-
New changes to `vscode-clangd` are not released until a new version is published
32-
to the marketplace.
32+
## Editing and typechecking
3333

34-
## Requirements
34+
`npm run compile` does not actually typecheck the TypeScript code!
35+
(It stripts type annotations and bundles it, using `esbuild`).
36+
You can see diagnostics with `npm run check-ts`.
3537

36-
* Make sure install the `vsce` command (`npm install -g vsce`)
37-
* `llvm-vs-code-extensions` account
38-
* Bump the version in `package.json`, and commit the change.
38+
Using a Typescript-aware editor will show you diagnostics, provide
39+
go-to-definition etc. VSCode works well, or any LSP-capable editor can use
40+
[typescript-language-server](https://github.com/typescript-language-server/typescript-language-server).
3941

40-
The extension is published under `llvm-vs-code-extensions` account, which is
41-
maintained by clangd developers. If you want to make a new release, please
42-
42+
# Contributing
4343

44-
## Steps
44+
Please follow the existing code style when contributing to the extension, we
45+
recommend to run `npm run format` before sending a patch.
4546

46-
```bash
47-
$ cd vscode-clangd
48-
# For the first time, you need to login into the account. vsce will ask you
49-
for the Personal Access Token and will remember it for future commands.
50-
$ vsce login llvm-vs-code-extensions
51-
# Publish the extension to the VSCode marketplace.
52-
$ npm run publish
53-
```
47+
# Publish to Marketplace
48+
49+
To create a new release, create a commit that:
50+
51+
- increases the version number in `package.json`
52+
- updates `CHANGELOG.md` to cover changes since the last release
53+
54+
Our CI will recognize the commit and publish new versions to the VSCode
55+
Marketplace and the alternative OpenVSX registry.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"main": "./out/bundle",
3636
"scripts": {
3737
"esbuild": "esbuild ./src/extension.ts --bundle --outfile=out/bundle.js --external:vscode --format=cjs --platform=node",
38-
"vscode:prepublish": "npm run esbuild -- --minify --keep-names",
39-
"compile": "npm run esbuild -- --sourcemap --watch",
40-
"ts-compile": "tsc -watch -p ./",
38+
"vscode:prepublish": "npm run check-ts && npm run esbuild -- --minify --keep-names",
39+
"compile": "npm run esbuild -- --sourcemap",
40+
"check-ts": "tsc -noEmit -p ./",
4141
"format": "clang-format -i --glob=\"{src,test}/*.ts\"",
4242
"test": "tsc -p ./ && node ./out/test/index.js",
4343
"package": "vsce package --baseImagesUrl https://raw.githubusercontent.com/clangd/vscode-clangd/master/",

0 commit comments

Comments
 (0)