@@ -43,11 +43,16 @@ If you have enough free disk space and you would like to be able to run `x`
4343commands while rust-analyzer runs in the background, you can also add
4444` --build-dir build-rust-analyzer ` to the ` overrideCommand ` to avoid x locking.
4545
46+ Running ` ./x setup editor ` will prompt you to create a project-local LSP config
47+ file for one of the supported editors. You can also create the config file as a
48+ step of running ` ./x setup ` .
49+
4650### Visual Studio Code
4751
48- Running ` ./x setup vscode ` will prompt you to create a ` .vscode/settings.json `
49- file which will configure Visual Studio code. The recommended ` rust-analyzer `
50- settings live at [ ` src/etc/rust_analyzer_settings.json ` ] .
52+ Selecting ` vscode ` in ` ./x setup editor ` will prompt you to create a
53+ ` .vscode/settings.json ` file which will configure Visual Studio code. The
54+ recommended ` rust-analyzer ` settings live at
55+ [ ` src/etc/rust_analyzer_settings.json ` ] .
5156
5257If running ` ./x check ` on save is inconvenient, in VS Code you can use a [ Build
5358Task] instead:
@@ -83,13 +88,14 @@ here](https://rust-analyzer.github.io/manual.html#nvim-lsp).
8388
84891 . First install the plugin. This can be done by following the steps in the
8590 README.
86- 2 . Run ` x setup ` , which will have a prompt for it to create a
91+ 2 . Run ` ./ x setup editor ` , and select ` vscode ` to create a
8792 ` .vscode/settings.json ` file. ` neoconf ` is able to read and update
8893 rust-analyzer settings automatically when the project is opened when this
8994 file is detected.
9095
91- If you're running ` coc.nvim ` , you can use ` :CocLocalConfig ` to create a
92- ` .vim/coc-settings.json ` , and copy the settings from
96+ If you're using ` coc.nvim ` , you can run ` ./x setup editor ` and select ` vim ` to
97+ create a ` .vim/coc-settings.json ` . The settings can be edited with
98+ ` :CocLocalConfig ` . The recommended settings live at
9399[ ` src/etc/rust_analyzer_settings.json ` ] .
94100
95101Another way is without a plugin, and creating your own logic in your
@@ -111,9 +117,10 @@ Emacs provides support for rust-analyzer with project-local configuration
111117through [ Eglot] ( https://www.gnu.org/software/emacs/manual/html_node/eglot/ ) .
112118Steps for setting up Eglot with rust-analyzer can be [ found
113119here] ( https://rust-analyzer.github.io/manual.html#eglot ) .
114- Having set up Emacs & Eglot for Rust development in general, you can use the
115- configuration for rustc provided in [ ` src/etc/rust_analyzer_eglot.el ` ] .
116- Simply copy the provided file to ` .dir-locals.el ` in the project root directory.
120+ Having set up Emacs & Eglot for Rust development in general, you can run
121+ ` ./x setup editor ` and select ` emacs ` , which will prompt you to create
122+ ` .dir-locals.el ` with the recommended configuration for Eglot.
123+ The recommended settings live at [ ` src/etc/rust_analyzer_eglot.el ` ] .
117124For more information on project-specific Eglot configuration, consult [ the
118125manual] ( https://www.gnu.org/software/emacs/manual/html_node/eglot/Project_002dspecific-configuration.html ) .
119126
@@ -122,14 +129,13 @@ manual](https://www.gnu.org/software/emacs/manual/html_node/eglot/Project_002dsp
122129Helix comes with built-in LSP and rust-analyzer support.
123130It can be configured through ` languages.toml ` , as described
124131[ here] ( https://docs.helix-editor.com/languages.html ) .
125- You can use the configuration for rustc provided in
126- [ ` src/etc/rust_analyzer_helix.toml ` ] .
127- Simply copy the provided file to ` .helix/languages.toml ` in the project root
128- directory.
132+ You can run ` ./x setup editor ` and select ` helix ` , which will prompt you to
133+ create ` languages.toml ` with the recommended configuration for Helix. The
134+ recommended settings live at [ ` src/etc/rust_analyzer_helix.toml ` ] .
129135
130136## Check, check, and check again
131137
132- When doing simple refactorings , it can be useful to run ` ./x check `
138+ When doing simple refactoring , it can be useful to run ` ./x check `
133139continuously. If you set up ` rust-analyzer ` as described above, this will be
134140done for you every time you save a file. Here you are just checking that the
135141compiler can ** build** , but often that is all you need (e.g., when renaming a
@@ -355,3 +361,5 @@ Adding this to your shell's startup script (e.g. `.bashrc`) will automatically
355361load this completion.
356362
357363[ `src/etc/rust_analyzer_settings.json` ] : https://github.com/rust-lang/rust/blob/master/src/etc/rust_analyzer_settings.json
364+ [ `src/etc/rust_analyzer_eglot.el` ] : https://github.com/rust-lang/rust/blob/master/src/etc/rust_analyzer_eglot.el
365+ [ `src/etc/rust_analyzer_helix.toml` ] : https://github.com/rust-lang/rust/blob/master/src/etc/rust_analyzer_helix.toml
0 commit comments