Commit Graph

896 Commits

Author SHA1 Message Date
Lukas Wirth e47f4597d4 feat: Change VSCode extension publisher to rust-lang 2022-05-13 13:21:52 +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
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
Lukas Wirth e68352a9f5 fix: Fix incorrect config patching for runBuildScripts 2022-05-11 12:38:21 +02:00
Lukas Wirth d6dba1c97c auto update old configurations to newer ones 2022-05-01 19:57:09 +02:00
Will Crichton d607c1b558 Export lc.LanguageClient from VSCode extension 2022-04-21 13:39:53 -07:00
Laurențiu Nicola ad751e08ec Pass the language id when toggling inlay hints 2022-04-20 07:34:00 +03:00
Jonas Schievink c6ffffccbd Allows triggering commands after an assist edit 2022-04-19 18:45:48 +02:00
Laurențiu Nicola f77adb3a23 Remove old inlay hints settings 2022-04-16 08:05:07 +03: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] 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
Jonas Schievink ec2d023383 Add "view file text" command to debug sync issues 2022-03-31 14:50:33 +02:00
Lukas Wirth bd17933c31 feat: Add return type hints for closures with block bodies 2022-03-16 21:25:03 +01:00
Vladimir Serov f7cf3b5503 editors/code: fix crash due to missing ID= field
Assuming ID=linux in isNixOs by default. You can get away with
default "", but why do that if there's a default value in spec?)

Also removed toLowerCase — it really shouldn't be needed.
Fixes #11709
2022-03-15 07:11:24 +03:00
Vladimir Serov ce4b61003d editors/code: fix nixos detection
Problem: NixOS started using quotes around it's id field in /etc/os-release
Solution: Parially parsing os-release, and detecting, whether `nixos` appears anywhere in "ID=" field\
See https://github.com/rust-analyzer/rust-analyzer/issues/11695
Closes #11695
2022-03-13 00:38:41 +03:00
Laurențiu Nicola 97109d73f8 Add missing parameter 2022-03-07 15:42:20 +02:00
Laurențiu Nicola b9d74fe2ed Update LSP docs 2022-03-07 15:09:31 +02:00
Laurențiu Nicola 9d43291533 Drop hint conversion 2022-03-04 08:08:59 +02:00
Laurențiu Nicola 0b69717ab6 Fixes 2022-03-04 07:45:51 +02:00
Laurențiu Nicola 2ae8248cee Add log messages 2022-03-04 07:45:51 +02:00
Kirill Bulatov 55371be807 Add experimental VSCode api 2022-03-04 07:45:51 +02:00
Andrew Onyshchuk a05e09acbe Support <code> blocks from Rust docs 2022-01-27 11:46:04 -08:00
Laurențiu Nicola 0182f74516 Fix server path on NixOS 2021-12-30 14:50:54 +02:00
Laurențiu Nicola af2bbce8d9 Spelling fix 2021-12-23 14:04:46 +02:00
Laurențiu Nicola 5bed9d6188 Simplify conflict check 2021-12-23 14:04:15 +02:00
Laurențiu Nicola f872419847 Drop kalitaalexey.vscode-rust check 2021-12-23 14:04:15 +02:00
Laurențiu Nicola c0d0ceefb2 Don't check for platform details 2021-12-23 14:04:15 +02:00
Laurențiu Nicola 8b304a72f6 Remove ETXTBUSY check, we don't overwrite binaries 2021-12-23 13:10:50 +02:00
Laurențiu Nicola 3835b3790e Improve NixOS handling 2021-12-23 13:10:50 +02:00
Laurențiu Nicola e97569c998 Drop extensionUri copy 2021-12-23 09:36:55 +02:00
Laurențiu Nicola f63690c058 Remove proxy settings 2021-12-23 09:23:56 +02:00
Laurențiu Nicola 650ec14e4f Remove channel and ask before download prefs 2021-12-23 09:23:56 +02:00
Laurențiu Nicola 53c183cc13 Remove network functions 2021-12-23 09:23:56 +02:00
Laurențiu Nicola d5b4aa3037 Remove server download and update checks 2021-12-23 08:24:58 +02:00
Laurențiu Nicola 89cecff2bd Bump vscode in package.json 2021-12-20 20:58:09 +02:00
Laurențiu Nicola 9c74f646f4 Publish platform-specific Code VSIXes 2021-12-18 22:49:11 +02:00
Laurențiu Nicola 262a698875 Prepare Code extension for bundling 2021-12-18 17:44:16 +02:00
Jonas Schievink deb5c1426d internal: add "Shuffle Crate Graph" command 2021-12-07 16:37:19 +01:00
Laurențiu Nicola 725b3fdd65 Fix HttpsProxyAgent creation and avoid deprecated call 2021-12-05 14:11:49 +02:00
Laurențiu Nicola 29682445ac Bump node-fetch 2021-12-04 14:26:37 +02:00
Laurențiu Nicola 157056db22 Fix proxyStrictSSL check 2021-12-02 15:46:23 +02:00
Laurențiu Nicola 7d815b862f Refactor proxy settings 2021-11-28 10:54:35 +02:00
Laurențiu Nicola 2f5149886d Respect http.proxyStrictSSL 2021-11-27 07:29:44 +02:00
Jake Heinz d3d768de0d inlay hints: add the option to always show constructor inlay hints 2021-11-13 23:12:29 +00:00