Commit graph

846 commits

Author SHA1 Message Date
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