Commit Graph

781 Commits

Author SHA1 Message Date
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
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.) https://github.com/rust-analyzer/rust-analyzer/blob/a4778ddb7a00f552a8e653bbf56ae9fd69cfe1d3/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