diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-09 15:21:12 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-09 15:21:12 +0000 |
commit | 360890fcec3af854c4848ba7ed3511b4bae2ff5e (patch) | |
tree | 5820313364f04233fe6a36794bc370ff25407cc5 /docs/user | |
parent | 0db5525c445fb86a7fb7441267ffab2604d78a41 (diff) | |
parent | dfb81a8cd4b9a2efd8151b4ac36105c51df7d683 (diff) |
Merge #3053
3053: Feature: downloading lsp server from GitHub r=matklad a=Veetaha
This is currently very WIP, I may need to change this and that, add "download language server command", logging stuff (for future bug reports), etc., but it already works.
Also didn't test this on windows yet and mac (don't have the latter)
The quirks:
* Downloaded binary doesn't have executable permissions by default, that's why we ~~`chmod 111`~~ (**[UPD]** `chmod 755` as per @lnicola [suggestion](https://github.com/rust-analyzer/rust-analyzer/pull/3053#discussion_r376694456)) for it.
* To remove installed binary run `rm /${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer/ra_lsp_server-linux`, ~~note that `-f` flag is necessary, because of `111` permissions (I think this should be changed)~~ (**[UPD]** --force is no longer needed due to 755 permissions).
I also tried to keep things simple and not to use too many dependencies, all the ones added have 0 dependencies, (`ts-not-nil` is my personal npm package, that imitates `unwrap()` in TypeScript)
**[UPD]** I reduced throttle latency of progress indicator to 200ms for smoother UX
// TODO:
- [x] ~~Add `Rust Analyzer: Download latest language server` vscode command.~~ **[UPD]**: having reviewed the code and estimated available options I concluded that this feature requires too many code changes, I'd like to extract this into a separate PR after we merge this one.
- [x] Add some logging for future debugging
- [x] ~~Gracefully handle the case when language server is not available (e.g. no internet connection, user explicitly rejected the download, etc.)~~ **[UPD]** Decided to postpone better implementation of graceful degradation logic as per [conversation](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Deployment.20and.20installation/near/187758550).
Demo (**[UPD]** this is a bit outdated, but still mainly reflects the feature):

Related issue: #2988 #3007
Co-authored-by: Veetaha <[email protected]>
Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/README.md | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/docs/user/README.md b/docs/user/README.md index da99a063c..3da30a193 100644 --- a/docs/user/README.md +++ b/docs/user/README.md | |||
@@ -31,7 +31,38 @@ a minimum version of 10 installed. Please refer to | |||
31 | You will also need the most recent version of VS Code: we don't try to | 31 | You will also need the most recent version of VS Code: we don't try to |
32 | maintain compatibility with older versions yet. | 32 | maintain compatibility with older versions yet. |
33 | 33 | ||
34 | The experimental VS Code plugin can then be built and installed by executing the | 34 | ### Installation from prebuilt binaries |
35 | |||
36 | We ship prebuilt binaries for Linux, Mac and Windows via | ||
37 | [GitHub releases](https://github.com/rust-analyzer/rust-analyzer/releases). | ||
38 | In order to use them you need to install the client VSCode extension. | ||
39 | |||
40 | Publishing to VSCode marketplace is currently WIP. Thus, you need to clone the repository and install **only** the client extension via | ||
41 | ``` | ||
42 | $ git clone https://github.com/rust-analyzer/rust-analyzer.git --depth 1 | ||
43 | $ cd rust-analyzer | ||
44 | $ cargo xtask install --client-code | ||
45 | ``` | ||
46 | Then open VSCode (or reload the window if it was already running), open some Rust project and you should | ||
47 | see an info message pop-up. | ||
48 | |||
49 | |||
50 | <img height="140px" src="https://user-images.githubusercontent.com/36276403/74103174-a40df100-4b52-11ea-81f4-372c70797924.png" alt="Download now message"/> | ||
51 | |||
52 | |||
53 | Click `Download now`, wait until the progress is 100% and you are ready to go. | ||
54 | |||
55 | For updates you need to remove installed binary | ||
56 | ``` | ||
57 | rm -rf ${HOME}/.config/Code/User/globalStorage/matklad.rust-analyzer | ||
58 | ``` | ||
59 | |||
60 | `"Donwload latest language server"` command for VSCode and automatic updates detection is currently WIP. | ||
61 | |||
62 | |||
63 | ### Installation from sources | ||
64 | |||
65 | The experimental VS Code plugin can be built and installed by executing the | ||
35 | following commands: | 66 | following commands: |
36 | 67 | ||
37 | ``` | 68 | ``` |
@@ -46,6 +77,7 @@ doesn't, report bugs! | |||
46 | **Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular | 77 | **Note** [#1831](https://github.com/rust-analyzer/rust-analyzer/issues/1831): If you are using the popular |
47 | [Vim emulation plugin](https://github.com/VSCodeVim/Vim), you will likely | 78 | [Vim emulation plugin](https://github.com/VSCodeVim/Vim), you will likely |
48 | need to turn off the `rust-analyzer.enableEnhancedTyping` setting. | 79 | need to turn off the `rust-analyzer.enableEnhancedTyping` setting. |
80 | (// TODO: This configuration is no longer available, enhanced typing shoud be disabled via removing Enter key binding, [see this issue](https://github.com/rust-analyzer/rust-analyzer/issues/3051)) | ||
49 | 81 | ||
50 | If you have an unusual setup (for example, `code` is not in the `PATH`), you | 82 | If you have an unusual setup (for example, `code` is not in the `PATH`), you |
51 | should adapt these manual installation instructions: | 83 | should adapt these manual installation instructions: |