Commit graph

963 commits

Author SHA1 Message Date
Laurențiu Nicola
3d872b233b Remove namedExports config 2020-06-24 14:09:12 +03:00
Veetaha
62ebaa822b Don't mess with messy temp dir and just download into extension dir
Temp dirs are messy. Dealing with them requires handling quite a bunch of
edge cases. As proposed by lnicola this seems better to just put the temp files
in the extension dir and not care much about suddenly leaving garbage.
Instead we get shorter and less platform-caveat-y code.
We will also assume users don't try to issue a download in different vscode windows simultaneously
2020-06-24 13:19:14 +03:00
vsrs
2791f37a04 Fix ts lints 2020-06-24 12:30:41 +03:00
vsrs
647b126da5 Switch to ShellExecution instead of full Task 2020-06-24 10:53:49 +03:00
vsrs
a43a9103bc Add custom cargo runners 2020-06-24 10:53:49 +03:00
bors[bot]
45f3a5f9c1
Merge #4992 #4993 #4994 #4997 #4998
4992: Never disable error logging on the frontend r=matklad a=Veetaha



4993: Make bootstrap error message more informative and better-fitting r=matklad a=Veetaha

Now this better fits standard vscode extension activation failure message and suggests enabling verbose logs.

![image](https://user-images.githubusercontent.com/36276403/85321828-ffbb9400-b4cd-11ea-8adf-4032b1f62dfd.png)


4994: Decouple http file stream logic from temp dir logic r=matklad a=Veetaha

Followup for #4989 

4997: Update manual.adoc r=matklad a=gwutz

GNOME Builder (Nightly) supports now rust-analyzer

4998: Disrecommend trace.server: "verbose" for regular users r=matklad a=Veetaha

This option has never been useful for me, I wonder if anyone finds regular users can use this for sending logs

Co-authored-by: Veetaha <veetaha2@gmail.com>
Co-authored-by: Günther Wagner <info@gunibert.de>
2020-06-23 10:09:58 +00:00
Veetaha
426122ffc0 Disrecommend trace.server: "verbose" for regular users 2020-06-22 23:57:36 +03:00
Veetaha
0514d817db Decouple http file stream logic from temp dir logic 2020-06-22 21:43:53 +03:00
Veetaha
c2221ff7e8 Never disable error logging on the frontend 2020-06-22 21:30:32 +03:00
Veetaha
3fd49d8b94 Make bootstrap error message more informative and better-fitting 2020-06-22 21:18:36 +03:00
Veetaha
2d32e97cf9 Hotfix skipping the first chunks of the artifacts 2020-06-22 19:50:57 +03:00
Veetaha
dceb81856e Download artifacts into tmp dir 2020-06-20 15:45:30 +03:00
Veetaha
d6e89244ec Update workaround comment 2020-06-19 20:52:06 +03:00
veetaha
76c1160ffa Migrate flycheck to fully-lsp-compatible progress reports (introduce ra_progress crate) 2020-06-18 14:50:56 +03:00
vsrs
7e986d1504 Add rust-analyzer.gotoLocation command 2020-06-18 10:15:43 +03:00
vsrs
4d6c6a6b1e Fix rust-analyzer.debug.openDebugPane option 2020-06-18 10:15:42 +03:00
Gabriel Valfridsson
656e95211e Warnings as hint or info 2020-06-17 00:00:43 +02:00
Clemens Wasser
fe21fc2d25 checkOnSafe.features and checkOnSafe.allFeatures now work identically. 2020-06-10 09:37:26 +02:00
Clemens Wasser
33b9058838 Most of the checkOnSafe options now default to the cargo equivalent. 2020-06-10 09:27:25 +02:00
Clemens Wasser
47ef544fa5 Added the rust-analyzer.checkOnSave.features option. 2020-06-10 08:51:11 +02:00
bors[bot]
6e4fca5882
Merge #4773
4773: Run|Debug hover actions. r=matklad a=vsrs

![hover_actions_run](https://user-images.githubusercontent.com/62505555/83335644-dfc1f780-a2b6-11ea-820b-ccaa82290e7d.gif)

This hover actions work exactly like corresponding lenses.

Co-authored-by: vsrs <vit@conrlab.com>
2020-06-08 11:29:35 +00:00
Vincent Isambart
3162b9ed8f Fix VSCode settings 2020-06-07 12:07:00 +09:00
vsrs
3434f1dd2c Add Run|Debug hover actions 2020-06-06 18:17:52 +03:00
vsrs
b91fa7494e Fix Run lens. 2020-06-06 15:12:17 +03:00
vsrs
78c9223b7b Remove hover contents marking as trusted.
Hover contents might be extracted from raw
doc comments and need some validation.
2020-06-05 15:25:01 +03:00
vsrs
da7ec4b339 Add hover actions LSP extension documentation. 2020-06-05 15:00:28 +03:00
vsrs
7d0dd17b09 Add hover actions as LSP extension 2020-06-05 14:59:26 +03:00
Mikhail Rakhmanov
6a0083a519 Merge branch 'master' into compute-lazy-assits
# Conflicts:
#	crates/rust-analyzer/src/main_loop/handlers.rs
#	crates/rust-analyzer/src/to_proto.rs
2020-06-03 19:26:01 +02:00
Mikhail Rakhmanov
bacd0428fa Fix review comments 2020-06-03 18:39:01 +02:00
Aleksey Kladov
fa019c8f56 Document rust-project.json 2020-06-03 15:17:26 +02:00
Mikhail Rakhmanov
cb482e6351 Merge remote-tracking branch 'upstream/master' into compute-lazy-assits
# Conflicts:
#	crates/rust-analyzer/src/to_proto.rs
2020-06-02 23:22:45 +02:00
Mikhail Rakhmanov
57cd936c52 Preliminary implementation of lazy CodeAssits 2020-06-02 23:10:53 +02:00
bors[bot]
2f6ab77708
Merge #4710
4710: New runnables r=matklad a=matklad

bors d=@vsrs

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-02 20:44:56 +00:00
bors[bot]
0035dafbfa
Merge #4711
4711: Disable rust-analyzer.{cargo,checkOnSave}.allFeatures by default r=matklad a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-06-02 16:16:38 +00:00
Laurențiu Nicola
7a66d99897 Disable rust-analyzer.{cargo,checkOnSave}.allFeatures by default 2020-06-02 19:14:34 +03:00
Aleksey Kladov
a83ab820a4 Spec better runnables 2020-06-02 17:34:18 +02:00
Aleksey Kladov
0303982119 New runnables API 2020-06-02 17:22:42 +02:00
Aleksey Kladov
0ced18eee0 Move run commands to commands.ts 2020-06-02 14:52:55 +02:00
bors[bot]
131ccd9540
Merge #4580
4580: Fix invoking cargo without consulting CARGO env var or standard installation paths r=matklad a=Veetaha

Followup for #4329

The pr essentially fixes [this bug](https://youtu.be/EzQ7YIIo1rY?t=2189)

cc @lefticus

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-06-02 11:58:28 +00:00
Alin Sinpalean
771457ec5c Always derive from process.env when spawning a child process/shell execution
This is useful when an extension (e.g. Nix Environment Selector) or launch
configuration sets one or more environment variables.

When `env` is not explicitly specified in the options passed to
`child_process.spawn()` or `vscode.ShellExecution()`, then `process.env` gets
applied automatically. But when an explicit `env` is set, it should inherit from
`process.env` rather than replace it completely.
2020-05-31 13:41:55 +02:00
veetaha
d605ec9c32 Change Runnable.bin -> Runnable.kind
As per matklad, we now pass the responsibility for finding the binary to the frontend.
Also, added caching for finding the binary path to reduce
the amount of filesystem interactions.
2020-05-31 05:21:45 +03:00
veetaha
030d78345f Fix invoking cargo without consulting CARGO or standard installation paths 2020-05-31 03:10:23 +03:00
vsrs
f3e04fbbab Add inRustProject when-clause for commands. 2020-05-27 19:46:23 +03:00
bors[bot]
3c5112b079
Merge #4625 #4629
4625: Partially fix displaying inlay hints in Github PR diff views r=matklad a=Veetaha

See the comment in https://github.com/rust-analyzer/rust-analyzer/issues/4608#issuecomment-63424257

It partially fixes the left side of diff view (the one where old code is displayed), but the diff editor with new code changes still has `file` scheme and will proceed displaying inlay hints...

4629: Fix the `should_panic` snippet r=matklad a=eminence

Closes #4628

Co-authored-by: veetaha <veetaha2@gmail.com>
Co-authored-by: Andrew Chin <achin@eminence32.net>
2020-05-27 12:34:03 +00:00
veetaha
3c749b6224 Partially fix displaying inlay hints in Github PR diff views 2020-05-26 22:55:35 +03:00
Yuki Kodama
1e823d6770 Add question mark operator 2020-05-26 02:36:34 +09:00
bors[bot]
30f058dfea
Merge #4602 #4603
4602: Add boolean literal semantic token type to package.json r=matklad a=lnicola

Closes #4583.

CC @GrayJack

4603: Add self keyword semantic token type r=matklad a=lnicola

Not sure if this is warranted a new token type or just a modifier.

---

CC #4583, @GrayJack

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-05-25 14:08:21 +00:00
Aleksey Kladov
0ebb25b29b Document parentModule experimental LSP request 2020-05-25 15:59:49 +02:00
Aleksey Kladov
a30bdd9795 Cleanup lsp extensions on the client side 2020-05-25 14:56:26 +02:00
Aleksey Kladov
76e170c3d0 Less rust-analyzer specific onEnter 2020-05-25 14:28:47 +02:00
Aleksey Kladov
6058b8b0f6 Flatten commands.ts 2020-05-25 12:14:44 +02:00
Aleksey Kladov
021b3da672 Flatten simple commands 2020-05-25 11:10:31 +02:00
Laurențiu Nicola
c2358365ad Add self keyword semantic token type 2020-05-25 12:08:58 +03:00
Aleksey Kladov
4a013ec62d Remove dead code 2020-05-25 10:59:54 +02:00
Laurențiu Nicola
87aa746ed2 Add boolean literals to package.json 2020-05-25 11:39:56 +03:00
veetaha
5dab5e7379 Introduce toggle inlay hints vscode command
Users now can assign a shortcut for this command
via the general vscode
keybindings ui or `keybinding.json file`

Closes: #4599
2020-05-25 03:59:46 +03:00
bors[bot]
fbb8b884a2
Merge #4593
4593: Document some rust-analyzer specific protocol extensions r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-24 15:05:20 +00:00
Aleksey Kladov
9342273616 Document matchingBrace LSP request 2020-05-24 16:53:18 +02:00
Matthew Jasper
e2d36cb692 Highlight true and false as literals 2020-05-24 15:12:17 +01:00
Aleksey Kladov
c1a7f74917
Merge pull request #4574 from lnicola/bump-deps
Bump some dependencies
2020-05-24 16:05:41 +02:00
Aleksey Kladov
ce7144a93d
Merge pull request #4474 from georgewfraser/color_attrs
Color attribute functions
2020-05-24 15:32:31 +02:00
Laurențiu Nicola
6c5888d136 Bump more npm deps 2020-05-24 16:32:00 +03:00
Laurențiu Nicola
d18704ddd2 Bump some npm deps 2020-05-24 16:32:00 +03:00
Aleksey Kladov
f4f5fca101
Merge pull request #4538 from vsrs/vscode_tests
vscode client side tests
2020-05-23 16:39:04 +02:00
bors[bot]
4cc2ff6e39
Merge #4555 #4575
4555: VSCode: added patchelf after download for NixOS support r=matklad a=cab404

This adds Nix support, and fixes #4542 

4575: Use Chalk's built-in representations for fn items and pointers r=matklad a=flodiebold

The `TypeName::FnDef` was just added; the function pointer variant has existed for a while, I just forgot about it because it's special (because fn pointers can be higher-ranked over lifetimes).

We *could* also make `FnPtr` a separate `Ty` variant instead of a `TypeCtor` variant, which would make the conversion code a bit less special-casey, but it doesn't seem worth doing right now.

Co-authored-by: Vladimir Serov <me@cab404.ru>
Co-authored-by: Cabia Rangris <me@cab404.ru>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-05-23 11:32:26 +00:00
Aleksey Kladov
2075e77ee5 CodeAction groups 2020-05-22 17:32:46 +02:00
Aleksey Kladov
5ef4ebff20 Use WorkspaceEdit for ssr 2020-05-22 00:28:49 +02:00
Vladimir Serov
b4ef1afd30
Merge branch 'nix-patchelf' of github.com:cab404/rust-analyzer into nix-patchelf 2020-05-21 21:33:30 +03:00
Vladimir Serov
ec5162fa7f
editors/vscode: forgotten await in os check 2020-05-21 21:32:27 +03:00
Vladimir Serov
757292856b
editors/vscode: patchelf-ing without intermediate files 2020-05-21 21:32:11 +03:00
Aleksey Kladov
5b5ebec440 Formalize JoinLines protocol extension 2020-05-21 20:05:33 +02:00
Cabia Rangris
d7331b2d5d
Update editors/code/src/main.ts
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-05-21 17:50:28 +02:00
Vladimir Serov
8e0d776369
editor/vscode: lint 2020-05-21 18:49:30 +03:00
Vladimir Serov
125e4197d8
editors/vscode: removing original file after patching 2020-05-21 18:45:37 +03:00
Vladimir Serov
3a9aa80502
editors/vscode: added patchelf after download 2020-05-21 18:26:50 +03:00
bors[bot]
3cba0dc26b
Merge #4552
4552: Transition OnEnter to WorkspaceSnippetEdit r=matklad a=matklad

This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-21 13:10:00 +00:00
Aleksey Kladov
4b495da368 Transition OnEnter to WorkspaceSnippetEdit
This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer
2020-05-21 15:08:03 +02:00
Laurențiu Nicola
0f953ddd9e Fix phrasing in inlay hints settings 2020-05-21 12:26:03 +03:00
vsrs
c41a10c293 Apply suggestions from @Veetaha code review 2020-05-21 11:34:34 +03:00
vsrs
8ee40ccbe9 vscode client side tests 2020-05-20 22:31:39 +03:00
vsrs
d264d7b9f2 Debug lens fix for a binary. 2020-05-20 09:42:00 +03:00
Aleksey Kladov
39ec581bf6 Fix client-side snippets 2020-05-20 00:49:44 +02:00
Aleksey Kladov
3dd68c1ba3 Implement client-side of SnippetTextEdit 2020-05-19 20:28:27 +02:00
Aleksey Kladov
a752853350 Add snippetTextEdit protocol extension 2020-05-19 20:28:27 +02:00
George Fraser
47ce5ea581 Color attribute functions 2020-05-18 22:55:46 -07:00
bors[bot]
c6ed089671
Merge #4499
4499: CodeLens configuration options r=vsrs a=vsrs

This PR
- adds an option to granularly enable\disable all CodeLens, just like the TypeScript extension.
- fixes a minor bug for doctests. It makes no sense to show `Debug` lens for them as cargo `Can't skip running doc tests with --no-run`.

Co-authored-by: vsrs <vit@conrlab.com>
2020-05-18 07:37:04 +00:00
vsrs
78817a3194 Add "rust-analyzer.lens.enable" 2020-05-18 10:27:00 +03:00
Aleksey Kladov
19a8c1450c Relax VS Code version requirement 2020-05-18 00:16:35 +02:00
vsrs
3d445256fe code formatting 2020-05-17 20:38:50 +03:00
vsrs
dec2f3fa65 Runnable QuickPick with debuggees only 2020-05-17 20:29:59 +03:00
vsrs
dc217bdf90 CodeLens configuration options. 2020-05-17 19:51:44 +03:00
George Fraser
fd83d0e9ba Color macros (fixes #4462) 2020-05-15 19:27:18 -07:00
bors[bot]
d51c1f6217
Merge #4448
4448: Generate configuration for launch.json r=vsrs a=vsrs

This PR adds two new commands: `"rust-analyzer.debug"` and `"rust-analyzer.newDebugConfig"`. The former is a supplement to the existing `"rust-analyzer.run"` command and works the same way: asks for a runnable and starts new debug session. The latter allows adding a new configuration to **launch.json** (or to update an existing one).

If the new option `"rust-analyzer.debug.useLaunchJson"` is set to true then `"rust-analyzer.debug"` and Debug Lens will first look for existing debug configuration in **launch.json**. That is, it has become possible to specify startup arguments, env variables, etc.

`"rust-analyzer.debug.useLaunchJson"` is false by default, but it might be worth making true the default value. Personally I prefer true, but I'm not sure if it is good for all value.

----
I think that this PR also solves https://github.com/rust-analyzer/rust-analyzer/issues/3441.
Both methods to update launch.json mentioned in the issue do not work:
1. Menu. It is only possible to add a launch.json configuration template via a debug adapter. And anyway it's only a template and it is impossible to specify arguments from an extension.

2. DebugConfigurationProvider. The exact opposite situation: it is possible to specify all debug session settings, but it is impossible to export these settings to launch.json.

Separate `"rust-analyzer.newDebugConfig"` command looks better for me.

----
Fixes #4450
Fixes #3441

Co-authored-by: vsrs <vit@conrlab.com>
Co-authored-by: vsrs <62505555+vsrs@users.noreply.github.com>
2020-05-15 14:29:01 +00:00
vsrs
a4ecaa7096 Fix occasional test run during debug configuration 2020-05-15 15:31:09 +03:00
vsrs
abef76bc87 Fix runnable naming in the client side fallback. 2020-05-14 17:33:49 +03:00
vsrs
20fdd14c62 Multiple binaries support for launch.json.
Generate unique names on the LSP side.
2020-05-14 16:02:01 +03:00
vsrs
5f6cdae18f Mixed "bin" and "test" artifacts workaround. 2020-05-14 14:42:40 +03:00
vsrs
af7c50f8a2 Multiple binaries support for launch.json. 2020-05-14 13:48:02 +03:00
vsrs
a233346a2d Fix "rust-analyzer.debug" for QuickPick binaries. 2020-05-14 13:30:05 +03:00
vsrs
be9b0609d5 Runnable quick pick with buttons 2020-05-14 13:22:52 +03:00
Pavan Kumar Sunkara
9f0a7eb97b Make some stuff public so that they can be reused by other tools 2020-05-14 11:14:46 +02:00
vsrs
3ffc26eaeb Remove "rust-analyzer.debug.useLaunchJson" option 2020-05-14 11:12:10 +03:00
bors[bot]
c07050e275
Merge #4400
4400: Enhanced coloring r=georgewfraser a=georgewfraser

This PR builds on #4397 to enhance the existing syntax coloring. 

## Underline mutable variables

The textmate scope `markup.underline` underlines identifiers, which is a nice way to make mutable vars stand out:

<img width="327" alt="Screen Shot 2020-05-09 at 1 18 55 PM" src="https://user-images.githubusercontent.com/1369240/81484179-8bb47d80-91f8-11ea-997d-1dcffbe44aa7.png">

## Italicize static variables

The textmate scope `markup.italic` italicizes identifiers. Italic = static is a common convention in IDEs like IntelliJ:

<img width="288" alt="Screen Shot 2020-05-09 at 1 19 14 PM" src="https://user-images.githubusercontent.com/1369240/81484236-cd452880-91f8-11ea-8478-505ee49bc8b3.png">


Co-authored-by: George Fraser <george@fivetran.com>
2020-05-13 15:43:32 +00:00
vsrs
9ebb2acdca Use launch.json in Debug Lens sessions.
Add the possibility to use existing configurations via Debug Lens
2020-05-13 15:51:15 +03:00
bors[bot]
d6663b7614
Merge #4440
4440: Update packages r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-05-13 12:40:59 +00:00
kjeremy
7ac88f2cb3 Bump packages 2020-05-13 08:36:23 -04:00
bors[bot]
9594fe33fa
Merge #4083
4083: Smol documentation for ast nodes r=matklad a=Veetaha

There is a tremendous amount of TODOs to clarify the topics I am not certain about.
Please @matklad, @edwin0cheng review carefully, I even left some mentions of your names in todos to put your attention where you most probably can give comments.

In order to simplify the review, I separated the codegen (i.e. changes in `ast/generated/nodes.rs`) from `ast_src` changes (they in fact just duplicate one another) into two commits.

Also, I had to hack a little bit to let the docs be generated as doc comments and not as doc attributes because it's easier to read them this way and IIRC we don't support hints for `#[doc = ""]` attributes for now...

Closes #3682 

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-05-13 09:09:46 +00:00
kjeremy
6826f0083e vscode engine 1.45
latest stable
2020-05-12 17:36:03 -04:00
George Fraser
6222f2b709 Leave statics alone 2020-05-12 09:49:48 -07:00
George Fraser
07721d2ab6 Mark up statics and mutables 2020-05-12 09:49:48 -07:00
George Fraser
57c52bd397 Use .rust suffix on scopes 2020-05-12 08:31:43 -07:00
vsrs
e914d622ec DebugConfiguration simplification.
${workspaceRoot} substitution in generated DebugConfiguration.
2020-05-11 18:49:45 +03:00
vsrs
fee0a9fa5a "rust-analyzer.newDebugConfig" command 2020-05-11 18:04:49 +03:00
vsrs
155f060142 "rust-analyzer.debug" command 2020-05-11 16:06:57 +03:00
George Fraser
97428b6d52 Put sigil back to keyword.operator 2020-05-10 15:36:47 -07:00
George Fraser
2d2b32abe5 Change lifetimes back to keyword-ish, tweak builtins for consistency between TextMate and semantic 2020-05-10 13:32:42 -07:00
George Fraser
46566d7a79 Color as as a keyword 2020-05-10 13:07:28 -07:00
George Fraser
e86379ad15 No longer true 2020-05-10 13:07:28 -07:00
George Fraser
60e8e56dfa Color core types as types, not keywords 2020-05-10 13:07:28 -07:00
George Fraser
0881c889bf Color sigil like keyword 2020-05-10 13:07:28 -07:00
George Fraser
d5d154ba3f Color lifetimes like types 2020-05-10 13:07:28 -07:00
George Fraser
a91d15c80c Import built-in textmate grammar, with no changes 2020-05-10 13:07:28 -07:00
George Fraser
da0c8d96d4 Tweak the textmate fallback scopes to be consistent with builtin TextMate grammar and other languages 2020-05-10 13:04:55 -07:00
veetaha
9a82ee0de2 Fix "show syntax tree" command
@matlkad please don't forget to keep it up-to-date!
2020-05-10 20:43:48 +03:00
Edwin Cheng
31d5c8d487 Word fix 2020-05-10 21:05:09 +08:00
vsrs
0ef17ef1ee Merge remote-tracking branch 'upstream/master' into uniformed_debug_lens
# Conflicts:
#	editors/code/src/commands/runnables.ts
2020-05-08 19:34:34 +03:00
vsrs
1be6320ea6
"rust-analyzer.debug.openDebugPane"
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2020-05-08 19:22:26 +03:00
bors[bot]
8295a9340c
Merge #4329
4329: Look for `cargo`, `rustc`, and `rustup` in standard installation path r=matklad a=cdisselkoen

Discussed in #3118.  This is approximately a 90% fix for the issue described there.

This PR creates a new crate `ra_env` with a function `get_path_for_executable()`; see docs there.  `get_path_for_executable()` improves and generalizes the function `cargo_binary()` which was previously duplicated in the `ra_project_model` and `ra_flycheck` crates.  (Both of those crates now depend on the new `ra_env` crate.)  The new function checks (e.g.) `$CARGO` and `$PATH`, but also falls back on `~/.cargo/bin` manually before erroring out.  This should allow most users to not have to worry about setting the `$CARGO` or `$PATH` variables for VSCode, which can be difficult e.g. on macOS as discussed in #3118.

I've attempted to replace all calls to `cargo`, `rustc`, and `rustup` in rust-analyzer with appropriate invocations of `get_path_for_executable()`; I don't think I've missed any in Rust code, but there is at least one invocation in TypeScript code which I haven't fixed.  (I'm not sure whether it's affected by the same problem or not.) a4778ddb7a/editors/code/src/cargo.ts (L79)

I'm sure this PR could be improved a bunch, so I'm happy to take feedback/suggestions on how to solve this problem better, or just bikeshedding variable/function/crate names etc.

cc @Veetaha 

Fixes #3118.

Co-authored-by: Craig Disselkoen <craigdissel@gmail.com>
Co-authored-by: veetaha <veetaha2@gmail.com>
2020-05-08 10:11:19 +00:00
Aleksey Kladov
3bf5ef02c0 Add master config for inlayHints to make disabling easy 2020-05-08 09:28:15 +02:00
Aleksey Kladov
2904311664 Use the correct color for structs
This works around https://github.com/microsoft/vscode/issues/97162
2020-05-07 18:46:58 +02:00
vsrs
23f4859166 Add CodeLLDB Rust visualization 2020-05-07 18:53:14 +03:00
vsrs
435a17ecd8 Add separate settings for each debug engine. 2020-05-07 18:35:48 +03:00
vsrs
5426e2927e Add additional debug options 2020-05-07 17:07:58 +03:00
Aleksey Kladov
71369f5c59 Better mapping to TextMate scopes for keywords
https://github.com/microsoft/vscode/issues/94367#issuecomment-608629883
2020-05-06 19:03:17 +02:00
Sean Bright
9a4553b833
package.json: Minor configuration spelling fix 2020-05-06 11:22:24 -04:00
vsrs
c4ca6e29c2 Uniformed way to get Debug Lens target executable. 2020-05-06 16:06:21 +03:00
veetaha
c9b395be2b Fix cargo not found on macos bug at vscode extension side 2020-05-05 16:12:56 -07:00
veetaha
a78dd06951 Preliminary refactoring of cargo.ts 2020-05-05 16:12:56 -07:00
veetaha
5eac2d4c55 Drop dead code and a dependency! 2020-05-06 00:39:29 +03:00
guigui64
c22660179c
add the allFeatures flag (true by default) 2020-05-05 22:46:42 +02:00
bors[bot]
8803e748a6
Merge #4166
4166: Defining a default target to support cross-compilation targets  r=matklad a=FuriouZz

Related to #4163 

Co-authored-by: Christophe MASSOLIN <christophe.massolin@gmail.com>
2020-05-05 17:25:52 +00:00
Christophe MASSOLIN
0ab4340cdb Rename defaultTarget to target 2020-05-05 18:01:54 +02:00
szunami
7330b8da63
Fix typo in markdownDescription 2020-05-04 10:27:59 -04:00
Aleksey Kladov
dc19d64f0a Specify cotributed semanticTokenTypes in package.json 2020-05-04 13:10:59 +02:00
Andrew Chin
65234e8828 Remove workspaceLoaded setting
The `workspaceLoaded` notification setting was originally designed to
control the display of a popup message that said:

  "workspace loaded, {} rust packages"

This popup was removed and replaced by a much sleeker message in the
VSCode status bar that provides a real-time status while loading:

  rust-analyzer: {}/{} packages

This was done as part of #3587

The new status-bar indicator is unobtrusive and shouldn't need to be
disabled.  So this setting is removed.
2020-05-01 21:04:41 -04:00
bors[bot]
972afffded
Merge #4222
4222: Introduce C/C++ for Visual Studio Code extension as an alternative debug engine for Debug Code lens. r=matklad a=vsrs

At the moment Debug Code Lens can use only one debug engine: lldb via [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) extension.

This PR adds support of the debug engine from the [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension, as well as the configuration option. If both extensions are installed, `CodeLLDB` will be used by default.

Another new option `rust-analyzer.debug.sourceFileMap` allows, for example, to step into Rust std library during debugging. Works only with `MS C++ tools`.

On Windows: 
```json
"rust-analyzer.debug.sourceFileMap": {
    "/rustc/4fb7144ed159f94491249e86d5bbd033b5d60550": "${env:USERPROFILE}/.rustup/toolchains/stable-x86_64-pc-windows-msvc/lib/rustlib/src/rust"
}
```
On Linux:
```json
"rust-analyzer.debug.sourceFileMap": {
    "/rustc/4fb7144ed159f94491249e86d5bbd033b5d60550": "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust"
}
```

Co-authored-by: vsrs <vit@conrlab.com>
2020-04-30 17:03:26 +00:00
vsrs
06b7175650 fixed lint warning 2020-04-30 18:57:40 +03:00
vsrs
11e9e4b1fb Removed unnecessary extraArgs for cargo invocation 2020-04-30 18:53:34 +03:00
vsrs
10836543d6 Fixed tsfmt and eslint errors. 2020-04-30 18:41:48 +03:00
vsrs
eb6f9c23e1 pass Cargo errors to the Debug output channel 2020-04-30 15:25:04 +03:00