Commit Graph

6800 Commits

Author SHA1 Message Date
Aleksey Kladov
8f1792fde2
Merge pull request #2725 from kiljacken/actions-matrix
Run tests on ubuntu, windows and macos
2020-01-07 10:54:11 +01:00
bors[bot]
7b9df1062d
Merge #2724
2724: Improve const generic parsing r=matklad a=mchesser

Add support for generic arguments in:

`impl` type parameters:

```rust
impl<const N: u32> Bar<N> {}
```

type args:

```rust
type A = B<1, { 2 }>;
test::<10>();
```

Co-authored-by: Michael Chesser <michaelchesser@outlook.com>
2020-01-06 23:43:24 +00:00
Michael Chesser
ce1b34fd59 Improve const generics parsing
- Handle const generics type args
- Fix issue with const generic as first parameter in trait impl
2020-01-07 09:29:03 +10:30
bors[bot]
c92a090f49
Merge #2753
2753: Fix a problem with `Durability` of libraries r=matklad a=michalt

When processing a change with added libraries, we used
`Default::default` for `SourceRoot` which sets `is_library` to false.
Since we use `is_library` to decide whether to use low or high
durability, I believe that this caused us to mark many library
dependencies as having low durability and thus increased the size of the
graph that salsa needed to verify on every change.

Based on my initial tests this speeds up the `CrateDefMapQuery` on
rust-analyzer from about ~64ms to ~14ms and reduces the number of
validations for the query from over 60k to about 7k.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-06 21:25:13 +00:00
Michal Terepeta
be967b94e1 Fix a problem with Durability of libraries
When processing a change with added libraries, we used
`Default::default` for `SourceRoot` which sets `is_library` to false.
Since we use `is_library` to decide whether to use low or high
durability, I believe that this caused us to mark many library
dependencies as having low durability and thus increased the size of the
graph that salsa needed to verify on every change.

Based on my initial tests this speeds up the `CrateDefMapQuery` on
rust-analyzer from about ~64ms to ~14ms and reduces the number of
validations for the query from over 60k to about 7k.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-06 22:21:56 +01:00
bors[bot]
07340a62cc
Merge #2750
2750: add note in vscode instructions for vim plugin users r=matklad a=guswynn

Fixes #2746 

As the issue mentions, this is already mentioned below in the setting docs. However, it ended up taking me a long time to figure this out, so a note in the instructions for Vscode specifically is helpful

Co-authored-by: Gus Wynn <guswynn@gmail.com>
2020-01-06 14:14:58 +00:00
bors[bot]
1953ac17fd
Merge #2714
2714: Sanity check for missing server binary r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-06 11:39:41 +00:00
bors[bot]
010d902021
Merge #2726
2726: Improve profiling output when duration filter is specified r=matklad a=michalt

In particular:

  - Use strict inequality for comparisons, since that's what the filter
    syntax supports.

  - Convert to millis for comparisons, since that's the unit used both
    for the filter and when printing.

Now something like `RA_PROFILE='*>0'` will only print things that took
at least 1ms (when rounded to millis).

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-06 09:41:14 +00:00
bors[bot]
b86ab5257e
Merge #2751
2751: Crates up r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-06 03:13:33 +00:00
Jeremy Kolb
051a2d869e Crates up 2020-01-05 22:12:26 -05:00
Emil Lauridsen
0de029c466 Add missing comma and use double-quotes to bors.toml 2020-01-05 19:58:54 +01:00
Gus Wynn
218d211f48 add note in vscode instructions for vim plugin users 2020-01-05 07:37:58 -08:00
bors[bot]
fe00a34fcc
Merge #2747
2747: BinOp helper to detect assignment r=matklad a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-04 20:59:57 +00:00
Jeremy Kolb
5afb22e2b3 BinOp helper to detect assignment 2020-01-04 15:54:31 -05:00
bors[bot]
c15293e019
Merge #2745
2745: remove unused file r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-04 09:58:37 +00:00
Aleksey Kladov
b5e7186265 remove unused file 2020-01-04 10:58:10 +01:00
bors[bot]
823c15215e
Merge #2743
2743: Switch ast declaration from ron to a macro r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-03 20:54:42 +00:00
Aleksey Kladov
084bd304f3 Switch ast declaration from ron to a macro 2020-01-03 21:54:10 +01:00
Emil Lauridsen
e997749a9c Rename old toolchains on windows to speedup installation 2020-01-03 21:42:17 +01:00
Emil Lauridsen
89a11eb811 Remove rust-docs on Windows before updating to latest stable 2020-01-03 20:42:27 +01:00
bors[bot]
cb160f2a34
Merge #2742
2742: Split `infer` query into two for better profiling r=flodiebold a=michalt

This is the same change as we did with `crate_def_map` and it does seem
that we mostly spend time in salsa, without recomputing much on
rust-analyzer side.

Example output:

```
 233ms - handle_inlay_hints
      163ms - get_inlay_hints
          163ms - SourceAnalyzer::new
               67ms - def_with_body_from_child_node
                   67ms - analyze_container
                       67ms - analyze_container
                           67ms - Module::from_definition
                               67ms - Module::from_file
                                   67ms - crate_def_map
                                        0ms - parse_macro_query (6 calls)
                                        0ms - raw_items_query (1 calls)
                                       66ms - ???
                            0ms - crate_def_map (1 calls)
                        0ms - crate_def_map (1 calls)
               96ms - infer
                    2ms - trait_solve_query (2 calls)
                   94ms - ???
                0ms - body_with_source_map_query (1 calls)
                0ms - crate_def_map (1 calls)
      [...]
```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 19:08:32 +00:00
Michal Terepeta
d6c2a59538 Split infer query into two for better profiling
This is the same change as we did with `crate_def_map` and it does seem
that we mostly spend time in salsa, without recomputing much on
rust-analyzer side.

Example output:

```
 233ms - handle_inlay_hints
      163ms - get_inlay_hints
          163ms - SourceAnalyzer::new
               67ms - def_with_body_from_child_node
                   67ms - analyze_container
                       67ms - analyze_container
                           67ms - Module::from_definition
                               67ms - Module::from_file
                                   67ms - crate_def_map
                                        0ms - parse_macro_query (6 calls)
                                        0ms - raw_items_query (1 calls)
                                       66ms - ???
                            0ms - crate_def_map (1 calls)
                        0ms - crate_def_map (1 calls)
               96ms - infer
                    2ms - trait_solve_query (2 calls)
                   94ms - ???
                0ms - body_with_source_map_query (1 calls)
                0ms - crate_def_map (1 calls)
      [...]
```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 19:58:11 +01:00
Emil Lauridsen
980f4fb79d Update bors.toml 2020-01-03 19:37:13 +01:00
Emil Lauridsen
0f912c72cc Blindfolded PowerShell coding 2020-01-03 19:37:13 +01:00
Emil Lauridsen
d1848a11a2 Run tests on ubuntu, windows and macos 2020-01-03 19:37:13 +01:00
bors[bot]
1a18fe2ec0
Merge #2740
2740: Fix unused import for windows in cargo_watch test r=matklad a=edwin0cheng

This PR fixed some unused import in ra_cargo_watch test which are not used in Windows. 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-01-03 18:25:14 +00:00
Edwin Cheng
ff5883637c Fix unused import for windows in cargo_watch test 2020-01-04 01:18:46 +08:00
bors[bot]
dfe3824eb0
Merge #2735
2735: Update quick-error r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2020-01-03 14:42:24 +00:00
kjeremy
f2a7a33c25 Update quick-error 2020-01-03 09:41:22 -05:00
bors[bot]
906d4dee3e
Merge #2734
2734: Fix #2705 r=flodiebold a=flodiebold

The `-` turned into a `+` during a refactoring.

The original issue was caused by `Read` resolving wrongly to a trait without
type parameters instead of a struct with one parameter; this only fixes the
crash, not the wrong resolution.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-01-03 13:59:35 +00:00
Florian Diebold
67240c8d91 Fix #2705
The `-` turned into a `+` during a refactoring.

The original issue was caused by `Read` resolving wrongly to a trait without
type parameters instead of a struct with one parameter; this only fixes the
crash, not the wrong resolution.
2020-01-03 14:57:11 +01:00
bors[bot]
15d94cbffc
Merge #2731
2731: Split `crate_def_map` into two methods r=matklad a=michalt

This change:

  - introduces `compute_crate_def_map` query and renames
    `CrateDefMap::crate_def_map_query` for consistency,

  - annotates `crate_def_map` as `salsa::transparent` and adds a
    top-level `crate_def_map` wrapper function around that starts the
    profiler and immediately calls into `compute_crate_def_map` query.

This allows us to better understand where we spent the time, in
particular, how much is spent in the recomputaiton and how much in
salsa.

Example output (where we don't actually re-compute anything, but the
query still takes a non-trivial amount of time):

```
  211ms - handle_inlay_hints
      150ms - get_inlay_hints
          150ms - SourceAnalyzer::new
               65ms - def_with_body_from_child_node
                   65ms - analyze_container
                       65ms - analyze_container
                           65ms - Module::from_definition
                               65ms - Module::from_file
                                   65ms - crate_def_map
                                        1ms - parse_macro_query (6 calls)
                                        0ms - raw_items_query (1 calls)
                                       64ms - ???
```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 13:25:37 +00:00
Michal Terepeta
2e2e443560 Add _query suffix to compute_crate_def_map for consistency
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 14:20:24 +01:00
Michal Terepeta
7cd6f12926 Split crate_def_map into two methods
This change:

  - introduces `compute_crate_def_map` query and renames
    `CrateDefMap::crate_def_map_query` for consistency,

  - annotates `crate_def_map` as `salsa::transparent` and adds a
    top-level `crate_def_map` wrapper function around that starts the
    profiler and immediately calls into `compute_crate_def_map` query.

This allows us to better understand where we spent the time, in
particular, how much is spent in the recomputaiton and how much in
salsa.

Example output (where we don't actually re-compute anything, but the
query still takes a non-trivial amount of time):

```
  211ms - handle_inlay_hints
      150ms - get_inlay_hints
          150ms - SourceAnalyzer::new
               65ms - def_with_body_from_child_node
                   65ms - analyze_container
                       65ms - analyze_container
                           65ms - Module::from_definition
                               65ms - Module::from_file
                                   65ms - crate_def_map
                                        1ms - parse_macro_query (6 calls)
                                        0ms - raw_items_query (1 calls)
                                       64ms - ???
```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 13:59:46 +01:00
bors[bot]
e423cfe383
Merge #2730
2730: Add `profile` calls to {Module,Function}::diagnostics r=matklad a=michalt

With this change the output `ra_prof` gives a better indication where
the time is spent. Example output:

```
  213ms - publish_diagnostics
      213ms - diagnostics
           70ms - Module::from_definition
               70ms - Module::from_file
          132ms - Module::diagnostics
               78ms - Function::diagnostics
                    0ms - body_with_source_map_query (1 calls)
                    2ms - trait_solve_query (1 calls)
                   76ms - ???
               15ms - Function::diagnostics
                    0ms - body_with_source_map_query (1 calls)
                   15ms - trait_solve_query (5 calls)
               38ms - Function::diagnostics (51 calls)
            8ms - parse_query (1 calls)
 ```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 11:57:11 +00:00
Michal Terepeta
100c2d0127 Add profile calls to {Module,Function}::diagnostics
With this change the output `ra_prof` gives a better indication where
the time is spent. Example output:

```
  213ms - publish_diagnostics
      213ms - diagnostics
           70ms - Module::from_definition
               70ms - Module::from_file
          132ms - Module::diagnostics
               78ms - Function::diagnostics
                    0ms - body_with_source_map_query (1 calls)
                    2ms - trait_solve_query (1 calls)
                   76ms - ???
               15ms - Function::diagnostics
                    0ms - body_with_source_map_query (1 calls)
                   15ms - trait_solve_query (5 calls)
               38ms - Function::diagnostics (51 calls)
            8ms - parse_query (1 calls)
 ```

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 12:50:35 +01:00
bors[bot]
1cb8aa1311
Merge #2729
2729: Remove a duplicate line in `collect_defs` r=matklad a=michalt



Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 11:43:41 +00:00
Michal Terepeta
84e2e173ee Remove a duplicate line in collect_defs
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-03 12:40:50 +01:00
Michal Terepeta
bc91120b7c Improve profiling output when duration filter is specified
In particular:

  - Use strict inequality for comparisons, since that's what the filter
    syntax supports.

  - Convert to millis for comparisons, since that's the unit used both
    for the filter and when printing.

Now something like `RA_PROFILE='*>0'` will only print things that took
at least 1ms (when rounded to millis).

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-02 17:26:02 +01:00
Aleksey Kladov
67922a029a kill unused file 2020-01-02 15:32:36 +01:00
bors[bot]
4516c4c144
Merge #2723
2723: Update dependencies r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-01-01 22:53:02 +00:00
Jeremy Kolb
35d72e40e2 Update dependencies 2020-01-01 17:51:48 -05:00
bors[bot]
cf67c74213
Merge #2722
2722: Fix ra_cargo_watch test on windows. r=matklad a=kiljacken

Due to difference in path parsing on platforms, the current input to the snapshot tests in ra_cargo_watch cause a panic when running on Windows. This PR disables the tests when running on Windows until a better solution is found.

If somebody running on Windows could test this that would be great, as I'm working in the blind here :) 

Fixes #2720 (probably).

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-01-01 22:25:37 +00:00
Emil Lauridsen
167cbb7c4d Disable cargo_watch snapshot tests on windows 2020-01-01 23:21:35 +01:00
bors[bot]
d0a59164d5
Merge #2718
2718: Allow disabling inlay hints r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-01-01 16:06:21 +00:00
Aleksey Kladov
8327049fae Allow disabling inlay hints 2020-01-01 17:04:37 +01:00
bors[bot]
d5a1a5e614
Merge #2715
2715: Fixes to progress display r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 20:14:02 +00:00
Aleksey Kladov
ef24721640 Fixes to progress display 2019-12-31 21:13:30 +01:00
Aleksey Kladov
c3a86325da
Merge pull request #2672 from Speedy37/master
fix #2520: change expand_repeat loop stop condition
2019-12-31 20:57:26 +01:00
Aleksey Kladov
695b8ba0f0 Sanity check for missing server binary 2019-12-31 20:54:31 +01:00