]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge #4491
bors[bot] [Tue, 19 May 2020 18:16:20 +0000 (18:16 +0000)]
Merge #4491

4491: fix doctest inside impl block r=matklad a=bnjjj

close #4449

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
4 years agoMerge #4514
bors[bot] [Tue, 19 May 2020 15:03:41 +0000 (15:03 +0000)]
Merge #4514

4514: find_path cleanups r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoCleanup query fn naming
Aleksey Kladov [Tue, 19 May 2020 14:54:45 +0000 (16:54 +0200)]
Cleanup query fn naming

4 years agoMove public API to the top
Aleksey Kladov [Tue, 19 May 2020 14:46:33 +0000 (16:46 +0200)]
Move public API to the top

4 years agoSimplify
Aleksey Kladov [Tue, 19 May 2020 14:45:57 +0000 (16:45 +0200)]
Simplify

4 years agoCleanup imports
Aleksey Kladov [Tue, 19 May 2020 14:43:26 +0000 (16:43 +0200)]
Cleanup imports

4 years agoMerge #4513
bors[bot] [Tue, 19 May 2020 14:35:21 +0000 (14:35 +0000)]
Merge #4513

4513: Update crates r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoUpdate crates
kjeremy [Tue, 19 May 2020 14:11:34 +0000 (10:11 -0400)]
Update crates

4 years agoMerge #4501
bors[bot] [Mon, 18 May 2020 19:43:12 +0000 (19:43 +0000)]
Merge #4501

4501: Querify `importable_locations_in_crate` r=jonas-schievink a=jonas-schievink

This brings the time needed to compute the `add_missing_impl_members` assist down from ~5 minutes to 20 seconds on my test workload (which is editing within an impl of a MIR [`MutVisitor`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/visit/trait.MutVisitor.html))

cc #4498

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
4 years ago Querify `importable_locations_in_crate`
Jonas Schievink [Mon, 18 May 2020 19:42:39 +0000 (21:42 +0200)]
 Querify `importable_locations_in_crate`

 This brings the time needed to compute the `add_missing_impl_members`
assist down from ~5 minutes to 20 seconds

4 years agoMerge #4497
bors[bot] [Mon, 18 May 2020 11:03:44 +0000 (11:03 +0000)]
Merge #4497

4497: Create LowerCtx on the fly r=matklad a=edwin0cheng

Previously we create `LowerCtx` at the beginning of lowering, however, the hygiene content is in fact changing between macro expression expanding.

This PR change it to create the `LowerCtx` on the fly to fix above bug.

However, #4465 is not fixed by this PR, the goto-def is still not work yet. It only fixed the infer part.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoMerge #4493
bors[bot] [Mon, 18 May 2020 07:44:44 +0000 (07:44 +0000)]
Merge #4493

4493: Provide builtin impls of Fn traits for fn-pointers r=flodiebold a=hban

Meant to be, but isn't actually a fix for #2880.

Consider this snippet:

```rust
use std::marker::PhantomData;
use std::ops::Deref;

struct Lazy<T, F/* = fn() -> T*/>(F, PhantomData<T>);

impl<T, F> Lazy<T, F> {
    pub fn new(f: F) -> Lazy<T, F> {
        Lazy(f, PhantomData)
    }
}

impl<T, F: FnOnce() -> T> Deref for Lazy<T, F> {
    type Target = T;

    fn deref(&self) -> &T { todo!() }
}

fn test() {
    let lazy1: Lazy<u32, _> = Lazy::new(|| 0u32);
    let r1 = lazy1.to_string();

    fn make_u32_fn() -> u32 { todo!() }
    let make_u32_fn_ptr: fn() -> u32 = make_u32_fn;
    let lazy2: Lazy<u32, _> = Lazy::new(make_u32_fn_ptr);
    let r2 = lazy2.to_string();
}
```

* On current master:
  * When type default is commented-out, `r1` is correctly inferred, `r2` in _{unknown}_.
  * When type default is not commented-out, both `r1`  and `r2` are _{unknown}_.
* With this PR:
  * When type default is commented-out, both `r1` and `r2` are correctly inferred.
  * When type default is not commented-out, both `r1`  and `r2` are _{unknown}_.

Well, it's a improvement at least. I guess this thing with type defaults is a different problem.

I also tried add Fn impls for fn items, but wasn't successful. So this PR only adds those impls for fn pointers.

Co-authored-by: Hrvoje Ban <hban@users.noreply.github.com>
4 years agoMerge #4499
bors[bot] [Mon, 18 May 2020 07:37:04 +0000 (07:37 +0000)]
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>
4 years agoAdd "rust-analyzer.lens.enable"
vsrs [Mon, 18 May 2020 07:27:00 +0000 (10:27 +0300)]
Add "rust-analyzer.lens.enable"

4 years agoAdd more tests for Fn traits
Hrvoje Ban [Mon, 18 May 2020 06:07:31 +0000 (08:07 +0200)]
Add more tests for Fn traits

4 years agoMerge #4496
bors[bot] [Sun, 17 May 2020 22:16:57 +0000 (22:16 +0000)]
Merge #4496

4496: Relax VS Code version requirement r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRelax VS Code version requirement
Aleksey Kladov [Sun, 17 May 2020 13:57:30 +0000 (15:57 +0200)]
Relax VS Code version requirement

4 years agocode formatting
vsrs [Sun, 17 May 2020 17:38:50 +0000 (20:38 +0300)]
code formatting

4 years agoRunnable QuickPick with debuggees only
vsrs [Sun, 17 May 2020 17:29:59 +0000 (20:29 +0300)]
Runnable QuickPick with debuggees only

4 years agoCodeLens configuration options.
vsrs [Sun, 17 May 2020 16:51:44 +0000 (19:51 +0300)]
CodeLens configuration options.

4 years agoCreate LowerCtx on the fly
Edwin Cheng [Sun, 17 May 2020 15:37:30 +0000 (23:37 +0800)]
Create LowerCtx on the fly

4 years agoFix doctests in an Impl block
Coenen Benjamin [Sun, 17 May 2020 10:10:35 +0000 (12:10 +0200)]
Fix doctests in an Impl block

4 years agofix doctest inside impl block #4449
Benjamin Coenen [Sun, 17 May 2020 09:09:38 +0000 (11:09 +0200)]
fix doctest inside impl block #4449

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
4 years agoMerge #4473
bors[bot] [Sun, 17 May 2020 09:07:22 +0000 (09:07 +0000)]
Merge #4473

4473: Color macros r=matklad a=georgewfraser

Adds a fallback scope for macros. Before:

<img width="359" alt="Screen Shot 2020-05-15 at 7 31 03 PM" src="https://user-images.githubusercontent.com/1369240/82108339-a304d680-96e2-11ea-9521-e95d5d330c32.png">

After:

<img width="373" alt="Screen Shot 2020-05-15 at 7 29 58 PM" src="https://user-images.githubusercontent.com/1369240/82108308-81a3ea80-96e2-11ea-8660-7f6979df59bf.png">

Note how `hashset` in `maplit::hashset` is now yellow.

Fixes #4462

Co-authored-by: George Fraser <george@fivetran.com>
4 years agoMerge #4489
bors[bot] [Sat, 16 May 2020 23:06:23 +0000 (23:06 +0000)]
Merge #4489

4489: Memory allocation optimization r=matklad a=simonvandel

I did some profiling using DHAT, and this was what I could easily optimize without much knowledge of the codebase.

This speeds up analysis-stats on rust-analyser by ~4% on my local machine.

**Benchmark**
âžœ  rust-analyzer-base git:(master) hyperfine --min-runs=2 '/home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .' '/home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .'
Benchmark #1: /home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .
  Time (mean Â± Ïƒ):     49.621 s Â±  0.317 s    [User: 48.725 s, System: 0.792 s]
  Range (min â€¦ max):   49.397 s â€¦ 49.846 s    2 runs

Benchmark #2: /home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .
  Time (mean Â± Ïƒ):     51.764 s Â±  0.045 s    [User: 50.882 s, System: 0.756 s]
  Range (min â€¦ max):   51.733 s â€¦ 51.796 s    2 runs

Summary
  '/home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .' ran
    1.04 Â± 0.01 times faster than '/home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .'

Co-authored-by: Simon Vandel Sillesen <simon.vandel@gmail.com>
4 years agofix doctest inside impl block #4449
Benjamin Coenen [Sat, 16 May 2020 22:43:42 +0000 (00:43 +0200)]
fix doctest inside impl block #4449

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
4 years agoMerge #4484
bors[bot] [Sat, 16 May 2020 21:59:26 +0000 (21:59 +0000)]
Merge #4484

4484: Allow calling dyn trait super trait methods without the super trait in scope r=flodiebold a=flodiebold

This also removes some vestiges of the old impl trait support which I think aren't currently in use.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoReuse Vec allocations
Simon Vandel Sillesen [Sat, 16 May 2020 19:56:08 +0000 (21:56 +0200)]
Reuse Vec allocations

4 years agoReduce reallocations in ra_tt::buffer::TokenBuffer::new_inner
Simon Vandel Sillesen [Sat, 16 May 2020 16:24:17 +0000 (18:24 +0200)]
Reduce reallocations in ra_tt::buffer::TokenBuffer::new_inner

4 years agoShrink ra_parser::Event from 32 bytes to 16 bytes
Simon Vandel Sillesen [Sat, 16 May 2020 16:06:23 +0000 (18:06 +0200)]
Shrink ra_parser::Event from 32 bytes to 16 bytes

This boxes the Error variant with the assumption that it is rarely constructed

4 years agoMerge #4472
bors[bot] [Sat, 16 May 2020 19:49:01 +0000 (19:49 +0000)]
Merge #4472

4472: Fix path resolution for module and function with same name r=hasali19 a=hasali19

This fixes #3970 and also fixes completion for the same issue.

Co-authored-by: Hasan Ali <git@hasali.co.uk>
4 years agoAdd doc comment for resolve_hir_path_qualifier
Hasan Ali [Sat, 16 May 2020 19:40:58 +0000 (20:40 +0100)]
Add doc comment for resolve_hir_path_qualifier

4 years agoAllow calling dyn trait super trait methods without the super trait in scope
Florian Diebold [Sat, 16 May 2020 16:32:15 +0000 (18:32 +0200)]
Allow calling dyn trait super trait methods without the super trait in scope

This also removes some vestiges of the old impl trait support which I think
aren't currently in use.

4 years agoMerge #4479
bors[bot] [Sat, 16 May 2020 09:50:19 +0000 (09:50 +0000)]
Merge #4479

4479: Chalk upgrade r=matklad a=flodiebold

This includes the fix for `dyn Trait` super traits, but I noticed that still a lot of `db.super_trait_method()` calls don't work because the super trait isn't in scope (because it doesn't actually need to be). Somehow, I thought we handled that already, but I'll fix it in a separate PR. Also I'll see what happens if we use more of Chalk's new built-in types and traits in a separate PR.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoChalk upgrade
Florian Diebold [Sat, 16 May 2020 08:49:43 +0000 (10:49 +0200)]
Chalk upgrade

4 years agoColor macros (fixes #4462)
George Fraser [Sat, 16 May 2020 02:27:18 +0000 (19:27 -0700)]
Color macros (fixes #4462)

4 years agoMerge #4288
bors[bot] [Sat, 16 May 2020 02:15:44 +0000 (02:15 +0000)]
Merge #4288

4288: Add rename self to parameter and back. r=zbsz a=zbsz

This is a first stab at #3439
I liked the idea to do this as a rename instead of separate assist, so I tried implementing that.
It mostly works, but I'm sure there are some cases that I missed, especially in regards to parameter type.

Note: I'm playing with this this as a way to learn Rust and this project. So I'm sure it could be cleaner and put in better places`. Any suggestions?

Co-authored-by: zbsz <zbigniewo@gmail.com>
4 years agoAdd 'self to parameter' renaming.
zbsz [Mon, 4 May 2020 05:12:18 +0000 (22:12 -0700)]
Add 'self to parameter' renaming.

4 years agoFix completion and hover for module and function of same name
Hasan Ali [Fri, 15 May 2020 21:23:49 +0000 (22:23 +0100)]
Fix completion and hover for module and function of same name

4 years agoMerge #4470
bors[bot] [Fri, 15 May 2020 20:25:42 +0000 (20:25 +0000)]
Merge #4470

4470: Handle `Self` in values and patterns r=matklad a=flodiebold

I.e.
 - `Self(x)` or `Self` in tuple/unit struct impls
 - `Self::Variant(x)` or `Self::Variant` in enum impls
 - the same in patterns

Fixes #4454.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoHandle `Self` in values and patterns
Florian Diebold [Fri, 15 May 2020 15:15:40 +0000 (17:15 +0200)]
Handle `Self` in values and patterns

I.e.
 - `Self(x)` or `Self` in tuple/unit struct impls
 - `Self::Variant(x)` or `Self::Variant` in enum impls
 - the same in patterns

Fixes #4454.

4 years agoMerge #4448
bors[bot] [Fri, 15 May 2020 14:29:01 +0000 (14:29 +0000)]
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>
4 years agoFix occasional test run during debug configuration
vsrs [Fri, 15 May 2020 12:31:09 +0000 (15:31 +0300)]
Fix occasional test run during debug configuration

4 years agoMerge #4431
bors[bot] [Fri, 15 May 2020 10:17:42 +0000 (10:17 +0000)]
Merge #4431

4431: Store proc-macro result in salsa db r=matklad a=edwin0cheng

Fixed #4315

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoMerge #4460
bors[bot] [Fri, 15 May 2020 00:10:58 +0000 (00:10 +0000)]
Merge #4460

4460: Remove flycheck -> LSP dependency r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoCleanups
Aleksey Kladov [Fri, 15 May 2020 00:08:50 +0000 (02:08 +0200)]
Cleanups

4 years agoBetter structure
Aleksey Kladov [Thu, 14 May 2020 23:58:39 +0000 (01:58 +0200)]
Better structure

4 years agoMove LSP bits from flycheck to rust-analyzer
Aleksey Kladov [Thu, 14 May 2020 23:51:48 +0000 (01:51 +0200)]
Move LSP bits from flycheck to rust-analyzer

There should be only one place that knows about LSP, and that place is
right before we spit JSON on stdout.

4 years agoFix runnable naming in the client side fallback.
vsrs [Thu, 14 May 2020 14:32:24 +0000 (17:32 +0300)]
Fix runnable naming in the client side fallback.

4 years agoMerge #4273
bors[bot] [Thu, 14 May 2020 14:29:22 +0000 (14:29 +0000)]
Merge #4273

4273: Trigger add_vis assist on paths/record fields as well r=flodiebold a=TimoFreiberg

Resolves #4037.

- [x] Function defs
- [x] ADT defs
- [x] Enum variants
- [x] Consts
- [x] Statics
- [x] Traits
- [x] Type aliases
- [x] Modules
- [x] Record fields (using different implementation)
    - [x] struct fields
    - [x] enum variant fields
    - :x:  union fields (`Semantics::resolve_record_field` seems to not work for union fields, so I think this can be handled in a future PR)
- [x] More tests?
- [x] Improve test fixture code and documentation a bit (see [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/resolve_path.20between.20fixture.20files))

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
4 years agoMerge #4456
bors[bot] [Thu, 14 May 2020 13:36:56 +0000 (13:36 +0000)]
Merge #4456

4456: Sort preselect items on top r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMinor
Aleksey Kladov [Thu, 14 May 2020 13:36:15 +0000 (15:36 +0200)]
Minor

4 years agoPut preselect items on top
Aleksey Kladov [Thu, 14 May 2020 13:29:40 +0000 (15:29 +0200)]
Put preselect items on top

4 years agoBetter label for a runnable.
vsrs [Thu, 14 May 2020 13:28:18 +0000 (16:28 +0300)]
Better label for a runnable.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMerge #4455
bors[bot] [Thu, 14 May 2020 13:18:22 +0000 (13:18 +0000)]
Merge #4455

4455: Prioritize locals with correct types r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoPrioritize locals with correct types
Aleksey Kladov [Thu, 14 May 2020 13:15:52 +0000 (15:15 +0200)]
Prioritize locals with correct types

4 years agoMultiple binaries support for launch.json.
vsrs [Thu, 14 May 2020 13:02:01 +0000 (16:02 +0300)]
Multiple binaries support for launch.json.

Generate unique names on the LSP side.

4 years agoMixed "bin" and "test" artifacts workaround.
vsrs [Thu, 14 May 2020 11:42:40 +0000 (14:42 +0300)]
Mixed "bin" and "test" artifacts workaround.

4 years agoMerge #4445
bors[bot] [Thu, 14 May 2020 11:20:42 +0000 (11:20 +0000)]
Merge #4445

4445: Correctly fill default type parameters r=flodiebold a=montekki

Fixes #3877

So, basically even if the parameters are omitted from the `impl` block, check the parameters in `trait` if they have a default type, and if they do go from `hir` to `ast::TypeArg`. I've added a helper for that but I am not sure that it's a proper way to go from `hir` to `ast` here.

Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
4 years agoTy -> Type
Fedor Sakharov [Thu, 14 May 2020 10:53:45 +0000 (13:53 +0300)]
Ty -> Type

4 years agoMultiple binaries support for launch.json.
vsrs [Thu, 14 May 2020 10:48:02 +0000 (13:48 +0300)]
Multiple binaries support for launch.json.

4 years agoAdds a param_idx helper
Fedor Sakharov [Thu, 14 May 2020 10:47:36 +0000 (13:47 +0300)]
Adds a param_idx helper

4 years agoFix "rust-analyzer.debug" for QuickPick binaries.
vsrs [Thu, 14 May 2020 10:30:05 +0000 (13:30 +0300)]
Fix "rust-analyzer.debug" for  QuickPick binaries.

4 years agoRunnable quick pick with buttons
vsrs [Thu, 14 May 2020 10:22:52 +0000 (13:22 +0300)]
Runnable quick pick with buttons

4 years agoStore proc-macro result in salsa db
Edwin Cheng [Thu, 14 May 2020 09:57:37 +0000 (17:57 +0800)]
Store proc-macro result in salsa db

4 years agoMerge #4405
bors[bot] [Thu, 14 May 2020 09:23:34 +0000 (09:23 +0000)]
Merge #4405

4405: Make some stuff public so that they can be reused by other tools r=pksunkara a=pksunkara

So, my little experiment of building a code analysis tool using rust-analyzer is successful. I am going to proceed to build the tool now. This PR makes the needed things public.

I know there were some things about trying to change stuff regarding loading workspaces, which would make it more easier for other tools to reuse. But, until then, it should be okay using this `load_cargo` fn.

Btw, if I were publish my tool, I would need the `ra` crates to be released. Since @matklad told me that he doesn't want to care about breaking stuff, I would propose the following.

Every monday, during the weekly release, we release a new pre v1 minor version of all the crates. That way, we don't need to care about breaking stuff but still have rust-analyzer on crates.io.

I made https://github.com/pksunkara/cargo-workspaces to help release workspace crates easily.

So, coming week, we start with `0.1.0`, then week after that, we release `0.2.0` and then `0.3.0` etc.. until we decide on `1.0.0` which is probably when the compiler team also starts using the crates. There is no limit to the minor versions (we can even have `0.150.0` or `0.1500.0`), so I don't see anything wrong with this strategy.

Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
4 years agoMake some stuff public so that they can be reused by other tools
Pavan Kumar Sunkara [Fri, 24 Apr 2020 19:57:10 +0000 (21:57 +0200)]
Make some stuff public so that they can be reused by other tools

4 years agoMerge #4432
bors[bot] [Thu, 14 May 2020 08:28:32 +0000 (08:28 +0000)]
Merge #4432

4432: Update features.md r=matklad a=bnjjj

Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
4 years agoRemove "rust-analyzer.debug.useLaunchJson" option
vsrs [Thu, 14 May 2020 08:12:10 +0000 (11:12 +0300)]
Remove "rust-analyzer.debug.useLaunchJson" option

4 years agoFix formatting
Fedor Sakharov [Thu, 14 May 2020 07:31:34 +0000 (10:31 +0300)]
Fix formatting

4 years agoChange type_arg to type_ref func
Fedor Sakharov [Thu, 14 May 2020 07:14:04 +0000 (10:14 +0300)]
Change type_arg to type_ref func

4 years agoUse generic_defaults and display_source_code
Fedor Sakharov [Thu, 14 May 2020 06:56:20 +0000 (09:56 +0300)]
Use generic_defaults and display_source_code

4 years agoMerge #4452
bors[bot] [Wed, 13 May 2020 23:10:05 +0000 (23:10 +0000)]
Merge #4452

4452: Use back ticks instead of single quotes around code r=matklad a=tspiteri

Also, use back ticks instead of single quotes in `rustc_unescape_error_to_string` for `EE:UnclosedUnicodeEscape`.

Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
4 years agoUse back ticks instead of single quotes around code
Trevor Spiteri [Wed, 13 May 2020 23:06:07 +0000 (01:06 +0200)]
Use back ticks instead of single quotes around code

4 years agoMerge #4447
bors[bot] [Wed, 13 May 2020 17:15:31 +0000 (17:15 +0000)]
Merge #4447

4447: Remove VARIATION SELECTOR-16 in Run arrow r=matklad a=lnicola

Closes #4446, cc @Veetaha.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
4 years agoMerge #4400
bors[bot] [Wed, 13 May 2020 15:43:32 +0000 (15:43 +0000)]
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>
4 years agoRemove hidden VARIATION SELECTOR-16
Laurențiu Nicola [Wed, 13 May 2020 13:59:28 +0000 (16:59 +0300)]
Remove hidden VARIATION SELECTOR-16

4 years agoCorrectly fill default type parameters
Fedor Sakharov [Wed, 13 May 2020 13:06:42 +0000 (16:06 +0300)]
Correctly fill default type parameters

4 years agoUse launch.json in Debug Lens sessions.
vsrs [Wed, 13 May 2020 12:51:15 +0000 (15:51 +0300)]
Use launch.json in Debug Lens sessions.

Add the possibility to use existing configurations via Debug Lens

4 years agoMerge #4444
bors[bot] [Wed, 13 May 2020 12:49:23 +0000 (12:49 +0000)]
Merge #4444

4444: Update crates r=kjeremy a=kjeremy

Documentation improvements

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoUpdate crates
kjeremy [Wed, 13 May 2020 12:44:15 +0000 (08:44 -0400)]
Update crates

Documentation improvements

4 years agoMerge #4440
bors[bot] [Wed, 13 May 2020 12:40:59 +0000 (12:40 +0000)]
Merge #4440

4440: Update packages r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoBump packages
kjeremy [Tue, 12 May 2020 21:43:47 +0000 (17:43 -0400)]
Bump packages

4 years agoMerge #4434
bors[bot] [Wed, 13 May 2020 09:25:01 +0000 (09:25 +0000)]
Merge #4434

4434: add more specific match postfix for Result and Option r=matklad a=bnjjj

In order to have the same behavior than `if let` and `while let`

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
4 years agoMerge #4083
bors[bot] [Wed, 13 May 2020 09:09:46 +0000 (09:09 +0000)]
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>
4 years agoMerge #4441
bors[bot] [Wed, 13 May 2020 05:20:02 +0000 (05:20 +0000)]
Merge #4441

4441: fix typo unimplementated -> unimplemented r=edwin0cheng a=tspiteri

Pretty harmless typo, but it does get exposed in lsp-rust-analyzer-expand-macro.

Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
4 years agofix typo unimplementated -> unimplemented
Trevor Spiteri [Tue, 12 May 2020 21:51:38 +0000 (23:51 +0200)]
fix typo unimplementated -> unimplemented

Pretty harmless typo, but it does get exposed in
lsp-rust-analyzer-expand-macro.

4 years agovscode engine 1.45
kjeremy [Tue, 12 May 2020 21:36:03 +0000 (17:36 -0400)]
vscode engine 1.45

latest stable

4 years agoMerge #4439
bors[bot] [Tue, 12 May 2020 21:01:09 +0000 (21:01 +0000)]
Merge #4439

4439: Update crates r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoConvert TODO about ParamList used in closures to a FIXME
veetaha [Tue, 12 May 2020 20:58:51 +0000 (23:58 +0300)]
Convert TODO about ParamList used in closures to a FIXME

cc @matklad (you didn't comment on this one)

4 years agoRemove an equals sign from `ConstArg` (this probably pertains only to ConstParam)
veetaha [Tue, 12 May 2020 20:57:04 +0000 (23:57 +0300)]
Remove an equals sign from `ConstArg` (this probably pertains only to ConstParam)

(As per matklad)

4 years agoRemove a comment on NameRefToken as per matklad
veetaha [Tue, 12 May 2020 20:55:46 +0000 (23:55 +0300)]
Remove a comment on NameRefToken as per matklad

4 years agoConvert TODO to a FIXME as per matklad
veetaha [Tue, 12 May 2020 20:54:40 +0000 (23:54 +0300)]
Convert TODO to a FIXME as per matklad

4 years agoConvert TODO to a Note(matklad)
veetaha [Tue, 12 May 2020 20:50:52 +0000 (23:50 +0300)]
Convert TODO to a Note(matklad)

4 years agoUpdate crates
kjeremy [Tue, 12 May 2020 20:49:42 +0000 (16:49 -0400)]
Update crates

4 years agoConvert to TODOs to FIXMEs as per matklad
veetaha [Tue, 12 May 2020 20:47:45 +0000 (23:47 +0300)]
Convert to TODOs to FIXMEs as per matklad

4 years agoRevert "Remove MacroStmts as per edwin0cheng" (cc @edwin0cheng) and add a fixme to...
veetaha [Tue, 12 May 2020 20:33:56 +0000 (23:33 +0300)]
Revert "Remove MacroStmts as per edwin0cheng" (cc @edwin0cheng) and add a fixme to document it.

This reverts commit 7a49165f5d5c8186edd04f874eae8a98e39d3df6.
MacroStmts ast node is not used by itself, but it pertains
to SyntaxNodeKind MACRO_STMTS that is used by ra_paser, so
even tho the node itself is not used, it is better to keep it
with a FIXME to actually add a doc comment when it becomes useful.

4 years agoAdd a doc comment on the difference between Name and NameRef ast nodes
veetaha [Tue, 12 May 2020 20:31:37 +0000 (23:31 +0300)]
Add a doc comment on the difference between Name and NameRef ast nodes

4 years agoLeave statics alone
George Fraser [Tue, 12 May 2020 15:36:37 +0000 (08:36 -0700)]
Leave statics alone

4 years agoMark up statics and mutables
George Fraser [Sat, 9 May 2020 20:19:29 +0000 (13:19 -0700)]
Mark up statics and mutables