617: Use npm ci instead of install r=matklad a=h-michael

fix #422

`npm install` is always recreate `package-lock.json`.
So we might use `npm ci` with `install-code`

https://docs.npmjs.com/cli/ci.html#description

618: Add install-lsp subcommand r=matklad a=h-michael

related https://github.com/rust-analyzer/rust-analyzer/pull/617#issuecomment-456914650

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
This commit is contained in:
bors[bot] 2019-01-23 19:15:50 +00:00
commit bf9cd6ee30
3 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,10 @@
[alias]
# Automatically generates the ast and syntax kinds files
gen-syntax = "run --package tools --bin tools -- gen-syntax"
# Extracts the tests from
# Extracts the tests from
gen-tests = "run --package tools --bin tools -- gen-tests"
# Installs ra_lsp_server
install-lsp = "install --path crates/ra_lsp_server --force"
# Installs the visual studio code extension
install-code = "run --package tools --bin tools -- install-code"
# Formats the full repository or installs the git hook to do it automatically.

View File

@ -29,6 +29,8 @@ $ cargo run --package ra_cli parse < crates/ra_syntax/src/lib.rs
$ cargo run --package ra_cli symbols < crates/ra_syntax/src/lib.rs
# install the language server
$ cargo install-lsp
or
$ cargo install --path crates/ra_lsp_server
```

View File

@ -150,10 +150,10 @@ fn existing_tests(dir: &Path, ok: bool) -> Result<HashMap<String, (PathBuf, Test
fn install_code_extension() -> Result<()> {
run("cargo install --path crates/ra_lsp_server --force", ".")?;
if cfg!(windows) {
run(r"cmd.exe /c npm.cmd install", "./editors/code")?;
run(r"cmd.exe /c npm.cmd ci", "./editors/code")?;
run(r"cmd.exe /c npm.cmd run package", "./editors/code")?;
} else {
run(r"npm install", "./editors/code")?;
run(r"npm ci", "./editors/code")?;
run(r"npm run package", "./editors/code")?;
}
if cfg!(windows) {