Commit graph

887 commits

Author SHA1 Message Date
bors 1dc25e51a0 Auto merge of #12253 - Veykril:bm, r=Veykril
feat: Add binding mode inlay hints

![image](https://user-images.githubusercontent.com/3757771/168427387-2f299438-a0cc-496b-a9a5-d689ef6a2b55.png)
2022-05-16 11:16:22 +00:00
Lukas Wirth 977f0ba968 Update package.json 2022-05-14 15:18:18 +02:00
Lukas Wirth 622defb373 internal: Make VSCode config more GUI edit friendly 2022-05-14 13:53:41 +02:00
Lukas Wirth 8ac429dad9 fix: Fix incorrect hover actions config keys 2022-05-13 21:17:03 +02:00
Lukas Wirth e47f4597d4 feat: Change VSCode extension publisher to rust-lang 2022-05-13 13:21:52 +02:00
bors 135164f547 Auto merge of #12226 - Veykril:reborrow-inlay-hints, r=Veykril
feat: Allow reborrow inlay hints to be restricted to mutable reborrows only
2022-05-12 12:21:06 +00:00
Lukas Wirth c2190ad87c feat: Allow reborrow inlay hints to be restricted to mutable reborrows only 2022-05-12 14:00:06 +02:00
Lukas Wirth 84176f6b24 internal: Rename primeCaches config keys 2022-05-12 12:30:00 +02:00
Elliot Roberts 2298a76222 fix typo in inlayHints.renderColons option description 2022-05-10 19:15:07 -07:00
bors 460e389f54 Auto merge of #12010 - Veykril:r-a-config, r=Veykril
Config revamp

Fixes https://github.com/rust-lang/rust-analyzer/issues/11790
Fixes https://github.com/rust-lang/rust-analyzer/issues/12115

This PR changes a lot of config names, and a few ones are being merged or split apart. The reason for this is that our configuration names currently are rather inconsistent and some where poorly chosen in regards to extensability. This PR plans to fix that.

We still allow the old config names by patching them to the new ones before deserializing to keep backwards compatability with other clients (the VSCode client will auto update the config) but ideally we will get rid of that layer in the future.

Here is a list of the changes:

These are simple renames `old_name | alias1 | alias2 ... -> new_name` (the vscode client will fix these up automagically):
```
assist_allowMergingIntoGlobImports -> imports_merge_glob
assist_exprFillDefault -> assist_expressionFillDefault
assist_importEnforceGranularity -> imports_granularity_enforce
assist_importGranularity | assist_importMergeBehavior | assist_importMergeBehaviour -> imports_granularity_group
assist_importGroup -> imports_group_enable
assist_importPrefix -> imports_prefix

cache_warmup -> primeCaches_enable

cargo_loadOutDirsFromCheck -> cargo_buildScripts_enable
cargo_runBuildScripts | cargo_runBuildScriptsCommand -> cargo_runBuildScripts_overrideCommand
cargo_useRustcWrapperForBuildScripts -> cargo_runBuildScripts_useRustcWrapper

completion_snippets -> completion_snippets_custom

diagnostics_enableExperimental -> diagnostics_experimental_enable

experimental_procAttrMacros -> procMacro_attributes_enable

highlighting_strings -> semanticHighlighting_strings_enable

highlightRelated_breakPoints -> semanticHighlighting_breakPoints_enable
highlightRelated_exitPoints -> semanticHighlighting_exitPoints_enable
highlightRelated_yieldPoints -> semanticHighlighting_yieldPoints_enable
highlightRelated_references -> semanticHighlighting_references_enable

hover_documentation -> hover_documentation_enable
hover_linksInHover | hoverActions_linksInHover -> hover_links_enable
hoverActions_debug -> hoverActions_debug_enable
hoverActions_enable -> hoverActions_enable_enable
hoverActions_gotoTypeDef -> hoverActions_gotoTypeDef_enable
hoverActions_implementations -> hoverActions_implementations_enable
hoverActions_references -> hoverActions_references_enable
hoverActions_run -> hoverActions_run_enable

inlayHints_chainingHints -> inlayHints_chainingHints_enable
inlayHints_closureReturnTypeHints -> inlayHints_closureReturnTypeHints_enable
inlayHints_hideNamedConstructorHints -> inlayHints_typeHints_hideNamedConstructorHints
inlayHints_parameterHints -> inlayHints_parameterHints_enable
inlayHints_reborrowHints -> inlayHints_reborrowHints_enable
inlayHints_typeHints -> inlayHints_typeHints_enable

lruCapacity -> lru_capacity

runnables_cargoExtraArgs -> runnables_extraArgs
runnables_overrideCargo -> runnables_command

rustcSource -> rustc_source

rustfmt_enableRangeFormatting -> rustfmt_rangeFormatting_enable
```

These are configs that have been merged or split apart, which have to be manually updated by the user:

```
callInfo_full -> signatureInfo_detail, signatureInfo_documentation_enable

cargo_allFeatures, cargo_features -> cargo_features
checkOnSave_allFeatures, checkOnSave_features -> checkOnSave_features
completion_addCallArgumentSnippets completion_addCallParenthesis -> completion_callable_snippets
```
2022-05-10 12:07:24 +00:00
Lukas Wirth 291f94e22e Fix up config docs 2022-05-01 19:57:09 +02:00
Lukas Wirth 1f11b70c3b Final fixups 2022-05-01 19:57:09 +02:00
Lukas Wirth 3d17261972 Adjust signature info and enum variant lenses 2022-05-01 19:57:08 +02:00
Lukas Wirth b84f3cc98f Update docs and config 2022-05-01 19:57:08 +02:00
unknown b373e62f1a Reload project on .cargo/config[.toml] changes
Fixes #11024
2022-04-27 12:10:43 -03:00
bors 9ee080f8b2 Auto merge of #12015 - arjo129:master, r=jonas-schievink
[Documentation]: Update developer documentation link.

Just noticed the docs links broken. The current doc link was broken. replaced with the updated version as found on the front page. Should the rest of the links be updated?
2022-04-21 16:52:10 +00:00
Jonas Schievink c6ffffccbd Allows triggering commands after an assist edit 2022-04-19 18:45:48 +02:00
Hongxu Xu 4390a8ad7c
Fix typo "GreeNode" in syntax.md 2022-04-19 15:45:03 +08:00
Arjo Chakravarty f75bad52d7
Update docs link
The current doc link was broken. replaced with the updated version as found on the front page.
2022-04-17 20:32:06 +08:00
Laurențiu Nicola f77adb3a23 Remove old inlay hints settings 2022-04-16 08:05:07 +03:00
bors 15844bf48c Auto merge of #11956 - fee1-dead:master, r=flodiebold
feat: allow customizing the command for running build scripts

I have tested this locally and it fixed #9201 with some small changes on the compiler side with suggestions from https://github.com/rust-analyzer/rust-analyzer/issues/9201#issuecomment-1019554086.

I have also added an environment variable `IS_RA_BUILDSCRIPT_CHECK` for crates to detect that it is a check for buildscripts, and allows defaulting to bogus values for expected environment variables.
2022-04-13 22:53:31 +00:00
Deadbeef 8b60bf6764 Update CI for Rust bors 2022-04-13 16:55:10 +02:00
Deadbeef 73a033e77c
feat: allow customizing the command for running build scripts 2022-04-13 23:45:51 +10:00
bors[bot] 7a564af989
Merge #11935
11935: feat: Switch to LSP inlay hints r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-04-11 09:29:15 +00:00
OKURA Masafumi afe1155e64
Fix typo in the manual
The -> There
2022-04-11 01:17:39 +09:00
Laurențiu Nicola d3d6267112 Switch to LSP inlay hints 2022-04-08 14:10:24 +03:00
bors[bot] bc0825d135
Merge #10802
10802: Allow clients to configure the global workspace search limit r=Veykril a=knutwalker

Playing around with [helix](https://helix-editor.com) I realized that the global worksapce symbol search works different compared to vs-code.
Helix requires all possible symbols in one query and does no subsequent refinement searched.
This PR adds a configuration option to override the default search limit with the default being the currently hardocded value.
Helix users can increment this limit for their instance with a config like

```toml
[[language]]
name = "rust"
language-server = { command = "rust-analyzer" }
[language.config]
workspace = { symbol = { search = { limit = 65536 }}}
```

Other editors are not affected by this change.


Co-authored-by: Paul Horn <dev@knutwalker.engineer>
2022-04-03 12:03:46 +00:00
Jonas Schievink ec2d023383 Add "view file text" command to debug sync issues 2022-03-31 14:50:33 +02:00
Gibson Fahnestock 6b38c2d75e
docs(auto_import): change by_self -> self and by_crate -> crate
Keep things consistent with the package.json , which uses `self` and
`crate` instead of `by_self` and `by_crate`. Both names are in fact
allowed as aliases, but we should be consistent so that people reading
the docs and using a schema do not see red squiggles.
2022-03-30 12:33:07 +01:00
Marius Ungureanu b70fa1c717
Fix typo in the style documentation
Was going through the documentation itself and found this typo just waiting to be fixed
2022-03-27 15:23:33 +03:00
Jonas Schievink 44a99d6e49 Disable experimental diagnostics by default 2022-03-24 17:00:17 +01:00
Lukas Wirth ecf2c98859 fix: Fix lifetime elision hint configuration key 2022-03-22 16:28:36 +01:00
Lukas Wirth 37b48ceb8f feat: Visualize compiler inserted reborrows via inlay hints 2022-03-20 14:38:16 +01:00
Lukas Wirth 7da5b80f25 Change skip trivial behaviour 2022-03-19 20:12:14 +01:00
Lukas Wirth 7ab0aaa82a Add option to skip trivial cases 2022-03-19 19:01:19 +01:00
Lukas Wirth bd17933c31 feat: Add return type hints for closures with block bodies 2022-03-16 21:25:03 +01:00
Ian Chamberlain 606ac3e73a
Update manual for inlay hint customization
Closes #6883 

This functionality was changed as of #11445 and now can be customized using native VSCode settings instead of `rust-analyzer`-specific ones.
2022-03-14 17:21:36 -04:00
Lukas Wirth 119ba82e4b minor: add missing definitions of lsp_ext::InlayHintLabel 2022-03-12 01:08:33 +01:00
Lukas Wirth 62265ee9cb fix: Allow configuration of colons in inlay-hints 2022-03-11 21:15:36 +01:00
bors[bot] 49646b71d4
Merge #11445
11445: Upstream inlay hints r=lnicola a=lnicola

Closes https://github.com/rust-analyzer/rust-analyzer/issues/2797
Closes https://github.com/rust-analyzer/rust-analyzer/issues/3394 (since now resolve the hints for the range given only, not for the whole document. We don't actually resolve anything due to [hard requirement](https://github.com/rust-analyzer/rust-analyzer/pull/11445#issuecomment-1035227434) on label being immutable. Any further heavy actions could go to the `resolve` method that's now available via the official Code API for hints)

Based on `@SomeoneToIgnore's` branch, with a couple of updates:

 - I squashed, more or less successfully, the commits on that branch
 - downloading the `.d.ts` no longer works, but you can get it manually from https://raw.githubusercontent.com/microsoft/vscode/release/1.64/src/vscode-dts/vscode.proposed.inlayHints.d.ts
 - you might need to pass `--enable-proposed-api matklad.rust-analyzer`
 - if I'm reading the definition right, `InlayHintKind` needs to be serialized as a number, not string
 - this doesn't work anyway -- the client-side gets the hints, but they don't display

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-07 16:49:12 +00:00
Laurențiu Nicola b9d74fe2ed Update LSP docs 2022-03-07 15:09:31 +02:00
Vitaly Shukela 6e62d93c95
Update manual.adoc
Resolves #11507
2022-03-07 14:22:07 +03:00
Lukas Wirth 2a7793d912 feat: Make private editable completions configurable, disable by default 2022-02-25 22:16:40 +01:00
Jean SIMARD 8025b6449c
Add Kakoune and Helix configuration
Follow-up of rust-analyzer/rust-analyser.github.io#181
Fixes rust-analyzer/rust-analyser.github.io#180
2022-02-23 08:55:56 +01:00
Laurențiu Nicola b97ab63cbe Rephrase nightly instructions in the manual 2022-02-23 06:37:16 +02:00
Lukas Wirth 8db88df758 simplify and document 2022-02-22 10:45:29 +01:00
Jan Tache 90916b726e Change Rust Analyzer->rust-analyzer to match style 2022-02-21 23:01:05 -08:00
Jan Tache 08461cc8f0 doc: state that only the latest stable toolchain is supported
This closes #11226. The content seemed to make more sense in the
installation section as opposed to the Troubleshooting section.
2022-02-21 22:54:25 -08:00
bors[bot] d771e3a7e9
Merge #11142
11142: Updated the Sublime Text section r=Veykril a=AmjadHD

rust-analyzer/rust-analyzer.github.io#160

Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
2022-02-21 10:29:16 +00:00
Heyward Fann 1988ea2b48
chore(manual): update coc-rust-analyzer manual
Semantic tokens highlighting is added now
2022-02-21 11:04:39 +08:00
Felicián Németh 7c7d6991dd fix: documentation of SsrParams
Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'.  Copy its description from lsp_ext.rs.
2022-02-12 15:47:54 +01:00
Moritz Vetter 482533ea9a add missing snake case attribute, update hash 2022-02-07 04:57:20 +01:00
Laurențiu Nicola befaa874ac Update install notes 2022-02-03 21:54:23 +02:00
Waffle Maybe 6ab66d4c9a
minor: fix a typo in the style guide 2022-01-26 17:07:17 +03:00
Jake Heinz 25f67b6939 make it a config 2022-01-15 02:47:47 +00:00
Matt Williams 1ded222c8b
Kate uses rust-analyzer by default 2022-01-11 13:36:06 +00:00
Wang Ruochen 01b3ce3006
Fix documentation of snippet 2022-01-10 21:29:41 -08:00
bors[bot] 40009e07d0
Merge #11145
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj

Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields

before:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {<|>};
}
``` 

after: 

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {
        text: String::new(),
        num: 0,
        other: todo!(),
    };
}
``` 



Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
2022-01-07 14:10:11 +00:00
Benjamin Coenen 8e0a05eb70 feat(diagnostics): use default expression instead of todo! when missing fields
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-01-07 15:01:37 +01:00
Lukas Wirth f6eba28ef8 Adjust config name 2022-01-06 13:50:35 +01:00
Lukas Wirth dd4b53402d Regenrate docs and package.json 2022-01-06 13:50:24 +01:00
Benjamin Coenen df6fa50f92 feat(diagnostics): add new config to fill default expression
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-12-31 16:29:08 +01:00
Amjad Ben Hedhili 3475a30080
Update manual.adoc 2021-12-29 22:22:02 +01:00
Laurențiu Nicola f55cca4d3b Update privacy note 2021-12-23 14:04:15 +02:00
bors[bot] 0dbbf14bd6
Merge #11042
11042: minor: clarify RA_LOG env var troubleshooting r=lnicola a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/pull/10261

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-18 20:21:29 +00:00
Lukas Wirth dc9257682c
Fix typo 2021-12-18 21:02:03 +01:00
Laurențiu Nicola 262a698875 Prepare Code extension for bundling 2021-12-18 17:44:16 +02:00
Lukas Wirth 1cd40a408a minor: clarify RA_LOG env var troubleshooting 2021-12-17 18:08:40 +01:00
bors[bot] 6674756c07
Merge #11041
11041: minor: Fix some clippy lints r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-17 15:52:53 +00:00
Laurențiu Nicola fb9529626d Spelling nits 2021-12-17 17:26:35 +02:00
Lukas Wirth 9fe0f0d1d9 Add a few default snippets for VSCode 2021-12-17 16:24:29 +01:00
Jonas Schievink 0db5aacfcd Update lsp-extensions.md 2021-12-07 16:41:24 +01:00
Aleksey Kladov d9dc925c2e doc: document absence of stability guarantees 2021-11-22 13:06:37 +03:00
Laurențiu Nicola a68ce62f6a Add toggle to disable cache priming 2021-11-19 19:30:11 +02:00
Paul Horn 553bb7f50a
Allow clients to configure the global workspace search limit 2021-11-18 17:52:02 +01:00
Jake Heinz 520ff62f4e flip the default 2021-11-13 23:39:34 +00:00
Jake Heinz d3d768de0d inlay hints: add the option to always show constructor inlay hints 2021-11-13 23:12:29 +00:00
mjkalyan 364f1ed5be
Update docs: include Gentoo source build
Mention the dev-util/rust-analyzer package for building from source.
2021-11-12 18:26:21 -07:00
Wilfred Hughes 54b636f1e2 Fix type names in typescript sample code 2021-11-12 11:15:08 -08:00
Laurențiu Nicola 834916bad1 Show how to create ~/.local/bin 2021-11-05 19:32:55 +02:00
Jan Scheer 1bfedc3591
Amend the instruction for rustup.
The current instruction for installation via rustup are misleading.
2021-10-21 23:04:43 +02:00
Laurențiu Nicola e43e1240a7 Document rustc source auto-discovery 2021-10-14 08:57:07 +03:00
Mirko Rainer a1c544f85a Add link to ECS acronym to clarify. 2021-10-12 09:24:00 -04:00
bors[bot] 5ff992465e
Merge #10447
10447: Add enum variant references CodeLens. r=Veykril a=ericsampson



Co-authored-by: Eric Sampson <esampson@eaze.com>
2021-10-05 22:03:23 +00:00
Lukas Wirth 041cfbe0f4 Render the expansion of snippets as their docs 2021-10-05 18:11:22 +02:00
Lukas Wirth ca1fdd75f1 Regen docs 2021-10-04 22:13:12 +02:00
Lukas Wirth d0c8777a44 Regen generated_config.adoc 2021-10-04 21:47:02 +02:00
Eric Sampson 99dd8066d9 need to update some generated files. 2021-10-04 02:30:46 -05:00
Laurențiu Nicola 81891f7abe Enable attribute proc macros by default 2021-09-27 18:11:31 +03:00
Aleksey Kladov d72f7cf3af internal: add => () rule; emphasize n_items rule 2021-09-25 14:10:25 +03:00
Carlos Menezes 8ad484b341 Add missing files 2021-09-24 14:53:11 +01:00
Terry Sun 04e1d72354 Fix title of User Manual page
Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.
2021-09-22 21:39:21 -07:00
Wilfred Hughes e543fe855b
Fix typescript syntax errors
Remove unwanted `:` and fix the naming of the boolean type.
2021-09-15 17:53:36 -07:00
Laurențiu Nicola b66e506cc2 Don't spam the manual with warnings 2021-09-13 10:56:14 +03:00
Dezhi Wu eb8508ae80
docs: fix unknown configuration setting 2021-09-06 19:57:17 +08:00
Dorian Peake a2bc57c28f
Update manual.adoc 2021-09-05 16:59:38 +01:00
Dorian Peake aae1e97590
Add rust-project.json + cargo check info to docs
Add information about how to configure compilation errors/checks when using rust-project.json.
2021-09-05 16:32:05 +01:00
Aleksey Kladov cff88a819f no need to reed the docs, feel free to charge ahead!
But knowing where the docs are is useful ;)
2021-09-04 20:34:17 +03:00
Aleksey Kladov b535804e1b docs: make dev docs more discoverable
I *think* people might try to debug ra by using only the troubleshooting
section. Might make sense to point them to dev docs then!
2021-09-04 20:17:28 +03:00
Aleksey Kladov 2d2c4e7c22 internal: deduplicate 2021-09-04 16:56:23 +03:00