Commit Graph

7073 Commits

Author SHA1 Message Date
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
Wilco Kusee
6c321d7318
Move error to new file 2020-01-03 14:34:16 +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
Wilco Kusee
2202891221
Split errors into WorkspaceError enum 2020-01-03 14:04:46 +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
bors[bot]
e4d217074d
Merge #2711
2711: Add semicolons r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 17:59:59 +00:00
Aleksey Kladov
ff0ceb30a9 Add semicolons 2019-12-31 18:55:34 +01:00
bors[bot]
c8b98c4667
Merge #2710
2710: Fix NPEs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 17:51:08 +00:00
Aleksey Kladov
cb41ffbbbd Fix NPEs 2019-12-31 18:50:32 +01:00
bors[bot]
6d23140ba0
Merge #2709
2709: Work around synchrnonisation issue r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 17:38:55 +00:00
Aleksey Kladov
6368b40dd9 Work around synchrnonisation issue 2019-12-31 18:38:22 +01:00
Aleksey Kladov
087af54069 Refactor server lifecycle 2019-12-31 18:32:17 +01:00
Aleksey Kladov
0849f7001c Refactor config 2019-12-31 17:34:52 +01:00
Aleksey Kladov
76f283108b Drop needless pubs 2019-12-31 17:28:27 +01:00
Aleksey Kladov
433000be34 Move config to Ctx 2019-12-31 17:28:01 +01:00
Aleksey Kladov
e4b588868f Refactor status activation 2019-12-31 17:22:43 +01:00
bors[bot]
1327aed7f6
Merge #2706
2706: Fix color name r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 14:42:34 +00:00
Aleksey Kladov
0eb254854d Fix color name 2019-12-31 15:42:05 +01:00
bors[bot]
6896ffab60
Merge #2704
2704: Add example of color customization r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 13:52:00 +00:00
Aleksey Kladov
ffa928c3d5 Add example of color customization 2019-12-31 14:51:23 +01:00
bors[bot]
6c74033c60
Merge #2703
2703: Drop obsolete color configurations r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 13:41:08 +00:00
Aleksey Kladov
8662a7dfe5 Drop obsolete color configurations 2019-12-31 14:37:23 +01:00
bors[bot]
46952985a0
Merge #2702
2702: Drop support for legacy colorization r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 13:11:49 +00:00
Aleksey Kladov
26bd7a896b Drop support for legacy colorization 2019-12-31 14:11:25 +01:00
Aleksey Kladov
6c1d92d6c5 Rename file 2019-12-31 14:06:40 +01:00
bors[bot]
7c4d4e113b
Merge #2701
2701: ⬆️ lsp-server r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 10:48:49 +00:00
Aleksey Kladov
54b4b7e317 ⬆️ lsp-server 2019-12-31 11:45:28 +01:00
Aleksey Kladov
519bd0deb5 Fix #2700 2019-12-31 11:44:52 +01:00
bors[bot]
98e20dac4e
Merge #2699
2699: Switch impure functional style to pure imperative r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-31 02:37:27 +00:00
Aleksey Kladov
f984ef2652 Switch impure functional style to pure imperative 2019-12-31 03:33:00 +01:00
Aleksey Kladov
cfb0865929 Reduce scope 2019-12-31 02:30:43 +01:00
Aleksey Kladov
96de8076ff Use optional value shortcut 2019-12-31 02:27:26 +01:00