Commit Graph

1481 Commits

Author SHA1 Message Date
Lukas Wirth
8496633c87 Don't make r-a fail to initialize if updating the config fails 2022-05-13 21:20:37 +02:00
Lukas Wirth
8ac429dad9 fix: Fix incorrect hover actions config keys 2022-05-13 21:17:03 +02:00
Lukas Wirth
99a51dfe9b Update package description 2022-05-13 14:11:09 +02:00
Lukas Wirth
a8133680af fix: Fix typo in publisher field 2022-05-13 14:10:37 +02:00
Lukas Wirth
e47f4597d4 feat: Change VSCode extension publisher to rust-lang 2022-05-13 13:21:52 +02:00
Lukas Wirth
d57beac7e6 fix: Fix vscode config descriptions not recognizing all valid values 2022-05-12 18:15:48 +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
bors
927ef0ce7e Auto merge of #12215 - listochkin:Support-variable-substitution-in-vscode-settings, r=Veykril
feat: Support variable substitution in VSCode settings

Currently support a subset of [variables provided by VSCode](https://code.visualstudio.com/docs/editor/variables-reference) in `server.extraEnv` section of Rust-Analyzer settings:

  * `workspaceFolder`
  * `workspaceFolderBasename`
  * `cwd`
  * `execPath`
  * `pathSeparator`

Also, this PR adds support for general environment variables resolution. You can declare environment variables and reference them from other variables like this:

```JSON
"rust-analyzer.server.extraEnv": {
    "RUSTFLAGS": "-L${env:OPEN_XR_SDK_PATH}",
    "OPEN_XR_SDK_PATH": "${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release"
},
```
The order of variable declaration doesn't matter, you can reference variables before defining them. If the variable is not present in `extraEnv` section, VSCode will search for them in your environment. Missing variables will be replaced with empty string. Circular references won't be resolved and will be passed to rust-analyzer server process as is.

Closes #9626, but doesn't address use cases where people want to use values provided by `rustc` or `cargo`, such as `${targetTriple}` proposal #11649
2022-05-12 11:05:21 +00:00
Lukas Wirth
84176f6b24 internal: Rename primeCaches config keys 2022-05-12 12:30:00 +02:00
Luna Razzaghipour
23ec7cfec4
Fix character semantic token type definition 2022-05-12 18:15:39 +10:00
Andrei Listochkin
33d2c8a3f9 Enable variable substitutions before passing them over to R-A server 2022-05-11 15:53:28 +01:00
Andrei Listochkin
684fa2794f VSCode variables support for substitutions
Tests now open Rust-Analyzer extension code in order to populate
VSCode variables.
2022-05-11 15:50:59 +01:00
Andrei Listochkin
6c769ac00d handle references to external environment variables
use cross-env to enable env variables on Windows
2022-05-11 15:50:25 +01:00
Andrei Listochkin
a86db5d0d1 iterative dependency solver
First, we go through every environment variable key and record all cases
where there are reference to other variables / dependencies.

We track two sets of variables - resolved and yet-to-be-resolved.
We pass over a list of variables over and over again and when all
variable's dependencies were resolved during previous passes we perform
a replacement for that variable, too.

Over time the size of `toResolve` set should go down to zero, however
circular dependencies may prevent that. We track the size of `toResolve`
between iterations to avoid infinite looping.

At the end we produce an object of the same size and shape as
the original, but with the values replace with resolved versions.
2022-05-11 15:05:41 +01:00
Andrei Listochkin
18d2fb81a7 search for test files instead of explicitly name them 2022-05-11 15:03:34 +01:00
bors
94fa8a6534 Auto merge of #12213 - Veykril:config-fix, r=Veykril
fix: Fix incorrect config patching for runBuildScripts
2022-05-11 10:38:56 +00:00
Lukas Wirth
e68352a9f5 fix: Fix incorrect config patching for runBuildScripts 2022-05-11 12:38:21 +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
bors
9e10d4b717 Auto merge of #12093 - nico-abram:uwu, r=Veykril
Reload project on .cargo/config[.toml] changes

Fixes #11024

Not adding tests as discussed in the issue
2022-05-02 12:21:42 +00:00
Lukas Wirth
291f94e22e Fix up config docs 2022-05-01 19:57:09 +02:00
Lukas Wirth
d6dba1c97c auto update old configurations to newer ones 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
Mika Lehtinen
2a714590b2
Fix typo in VSCode readme 2022-04-30 21:03:51 +03:00
unknown
b373e62f1a Reload project on .cargo/config[.toml] changes
Fixes #11024
2022-04-27 12:10:43 -03:00
Will Crichton
d607c1b558 Export lc.LanguageClient from VSCode extension 2022-04-21 13:39:53 -07:00
Jonas Schievink
c1a28ccf8c fix: remove angle brackets from language configuration 2022-04-20 16:43:24 +02:00
Laurențiu Nicola
ad751e08ec Pass the language id when toggling inlay hints 2022-04-20 07:34:00 +03:00
Laurențiu Nicola
4de7793425 Actually remove rust-analyzer.inlayHints.enable 2022-04-20 07:33:26 +03:00
Jonas Schievink
c6ffffccbd Allows triggering commands after an assist edit 2022-04-19 18:45:48 +02:00
bors
66c232d03b Auto merge of #12006 - lnicola:toggle-inlay-hints, r=lnicola
fix: Remove old inlay hints settings

Closes #11998
2022-04-16 05:10:17 +00:00
Laurențiu Nicola
f77adb3a23 Remove old inlay hints settings 2022-04-16 08:05:07 +03:00
bors
9ed459751f Auto merge of #11997 - lnicola:es-target, r=lnicola
minor: Bump target JS version
2022-04-15 18:17:23 +00:00
Lukas Wirth
77a9d951bd Update feature listing in extension README 2022-04-15 19:11:56 +02:00
Laurențiu Nicola
1698afc05d Bump target JS version 2022-04-15 18:18:18 +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
73a033e77c
feat: allow customizing the command for running build scripts 2022-04-13 23:45:51 +10:00
Laurențiu Nicola
bfa2a08da1 Update for languageclient API changes 2022-04-08 14:24:28 +03: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
bors[bot]
40cba42e47
Merge #11821
11821: minor: Bump npm deps r=lnicola a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-04-03 07:14:14 +00:00
Laurențiu Nicola
a7e83418d5 Load @hpcc-js/wasm as a script, not worker 2022-04-03 10:05:39 +03:00
bors[bot]
ee84622c92
Merge #11796
11796: minor: Remove sponsors from readme files r=Veykril a=Veykril

No need to merge this now though

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-01 15:51:29 +00:00
Jonas Schievink
ec2d023383 Add "view file text" command to debug sync issues 2022-03-31 14:50:33 +02:00
Laurențiu Nicola
0690973f8e Bump npm deps 2022-03-25 20:35:44 +02:00
Jonas Schievink
44a99d6e49 Disable experimental diagnostics by default 2022-03-24 17:00:17 +01:00
Lukas Wirth
e528403579 minor: Remove sponsors from readme files 2022-03-22 22:47:48 +01:00