]>
git.lizzy.rs Git - rust.git/log
Jonas Schievink [Tue, 11 May 2021 14:45:51 +0000 (16:45 +0200)]
Document viewCrateGraph request
Jonas Schievink [Tue, 11 May 2021 14:42:27 +0000 (16:42 +0200)]
Update crates/ide/src/view_crate_graph.rs
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
Jonas Schievink [Tue, 11 May 2021 14:36:00 +0000 (16:36 +0200)]
Distinguish crates with identical name
Jonas Schievink [Tue, 11 May 2021 14:15:31 +0000 (16:15 +0200)]
Allow viewing the crate graph in a webview
bors[bot] [Tue, 11 May 2021 13:14:55 +0000 (13:14 +0000)]
Merge #8800
8800: feat: Make "pull assignments up" assist work in more cases r=Jesse-Bakker a=Jesse-Bakker
Fixes #8771
Co-authored-by: Jesse Bakker <github@jessebakker.com>
Jesse Bakker [Tue, 11 May 2021 12:22:51 +0000 (14:22 +0200)]
Make "pull assignments up" assist work in more cases
bors[bot] [Tue, 11 May 2021 10:07:25 +0000 (10:07 +0000)]
Merge #8798
8798: internal: use modern resolever r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 11 May 2021 10:06:35 +0000 (13:06 +0300)]
internal: use modern resolever
I don't think this affects us, but better to stick to modern
practicies.
bors[bot] [Mon, 10 May 2021 20:10:59 +0000 (20:10 +0000)]
Merge #8794
8794: Give MergeBehaviour variants better names r=Veykril a=Veykril
I never really liked the variant names I gave this enum from the beginning and then I found out about rustfmt's `imports_granularity` config:
> imports_granularity
>
> How imports should be grouped into use statements. Imports will be merged or split to the configured level of granularity.
>
> Default value: Preserve
> Possible values: Preserve, Crate, Module, Item
> Stable: No
I personally prefer using `crate` over `full` and `module` over last, they seem more descriptive. Keeping these similar between tooling also seems like a good plus point to me.
We might even wanna take over the entire enum at some point if we have a `format/cleanup imports` assists in the future which would probably want to also have the `preserve` and `item` options.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 10 May 2021 19:33:01 +0000 (21:33 +0200)]
Update docs
Lukas Wirth [Mon, 10 May 2021 19:03:50 +0000 (21:03 +0200)]
Give MergeBehaviour variants better names
bors[bot] [Mon, 10 May 2021 18:08:26 +0000 (18:08 +0000)]
Merge #8793
8793: Corrected 2 typos on line 83 r=Veykril a=mixio
Co-authored-by: mixio <38652479+mixio@users.noreply.github.com>
mixio [Mon, 10 May 2021 18:05:32 +0000 (20:05 +0200)]
Corrected 2 typos on line 83
bors[bot] [Mon, 10 May 2021 13:21:33 +0000 (13:21 +0000)]
Merge #8791
8791: feat: auto-indent use tree lists r=jonas-schievink a=jonas-schievink
![Peek 2021-05-10 15-20](https://user-images.githubusercontent.com/
1786438 /
117665627 -
53e16c80 -b1a3-11eb-8906-
1b88b394367b .gif)
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 10 May 2021 13:10:56 +0000 (15:10 +0200)]
feat: auto-indent use tree lists
bors[bot] [Mon, 10 May 2021 12:44:17 +0000 (12:44 +0000)]
Merge #8790
8790: fix: fix manual rendering r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 10 May 2021 12:43:01 +0000 (15:43 +0300)]
fix: fix manual rendering
We add `// see the other repo` comments before headers (==). This one isn't a header, but a closing of the example block.
bors[bot] [Mon, 10 May 2021 12:26:52 +0000 (12:26 +0000)]
Merge #8789
8789: simplify r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 10 May 2021 12:25:56 +0000 (15:25 +0300)]
simplify
bors[bot] [Sun, 9 May 2021 20:17:37 +0000 (20:17 +0000)]
Merge #8784
8784: feat: auto-insert `}` when typing `{` in use item r=jonas-schievink a=jonas-schievink
![Peek 2021-05-09 22-14](https://user-images.githubusercontent.com/
1786438 /
117585742 -
45983f80 -b114-11eb-80fc-
d44f480fd012 .gif)
cc https://github.com/rust-analyzer/rust-analyzer/issues/8636
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Sun, 9 May 2021 20:12:58 +0000 (22:12 +0200)]
feat: auto-insert `}` when typing `{` in use item
bors[bot] [Sun, 9 May 2021 16:56:02 +0000 (16:56 +0000)]
Merge #8783
8783: internal: introduce `ast::make::ext` module with common shortcuts r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 9 May 2021 16:51:06 +0000 (19:51 +0300)]
internal: introduce `ast::make::ext` module with common shortcuts
There's a tension between keeping a well-architectured minimal
orthogonal set of constructs, and providing convenience functions.
Relieve this pressure by introducing an dedicated module for
non-orthogonal shortcuts.
This is inspired by the django.shortcuts module which serves a similar
purpose architecturally.
bors[bot] [Sun, 9 May 2021 16:23:03 +0000 (16:23 +0000)]
Merge #8782
8782: internal: fix make API r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 9 May 2021 16:11:42 +0000 (19:11 +0300)]
internal: fix make API
bors[bot] [Sun, 9 May 2021 15:55:42 +0000 (15:55 +0000)]
Merge #8781
8781: internal: rewrite **Repalce impl Trait** assist to mutable syntax trees r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 9 May 2021 15:20:37 +0000 (18:20 +0300)]
internal: rewrite **Repalce impl Trait** assist to mutable syntax trees
Aleksey Kladov [Sun, 9 May 2021 14:59:52 +0000 (17:59 +0300)]
cleanups
Aleksey Kladov [Sun, 9 May 2021 14:58:03 +0000 (17:58 +0300)]
cleanups
Aleksey Kladov [Sun, 9 May 2021 14:41:25 +0000 (17:41 +0300)]
minor: fix test style
Aleksey Kladov [Sun, 9 May 2021 14:17:28 +0000 (17:17 +0300)]
fix: join lines doesn't add space before closing quote
bors[bot] [Sun, 9 May 2021 14:40:49 +0000 (14:40 +0000)]
Merge #8776
8776: fix: fix unnecessary recomputations due to macros r=jonas-schievink a=jonas-schievink
This computes a macro's fragment kind eagerly (when the calling file is still available in parsed form) and stores it in the `MacroCallLoc`. This means that during expansion we no longer have to reparse the file containing the macro call, avoiding the unnecessary salsa dependencies (https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-
834776349 ).
Marking as draft until I manage to find a test for this problem, since for some reason `typing_inside_a_function_should_not_invalidate_expansions` does not catch this (which might indicate that I misunderstand the problem).
I've manually confirmed that this fixes the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-
834776349 :
```
7ms - parse_query @ FileId(179)
12ms - SourceBinder::to_module_def
12ms - crate_def_map:wait
5ms - item_tree_query (1 calls)
7ms - ???
```
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Sun, 9 May 2021 14:04:34 +0000 (16:04 +0200)]
Test that none of the macros are reparsed
bors[bot] [Sun, 9 May 2021 14:19:39 +0000 (14:19 +0000)]
Merge #8779
8779: fix: join lines doesn't add space before closing quote r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 9 May 2021 14:17:28 +0000 (17:17 +0300)]
fix: join lines doesn't add space before closing quote
bors[bot] [Sun, 9 May 2021 12:01:35 +0000 (12:01 +0000)]
Merge #8777
8777: Escape characters in builtin macros correctly r=edwin0cheng a=edwin0cheng
Fixes #8749
It is the same bug in #8560 but in our `quote!` macro.
Because the "\" are adding exponentially in #8749 case, so the text is eat up all the memory.
bors r+
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Sun, 9 May 2021 11:57:29 +0000 (19:57 +0800)]
Escape characters in builtin macros correctly
bors[bot] [Sun, 9 May 2021 10:33:31 +0000 (10:33 +0000)]
Merge #8774
8774: feat: Honor `.cargo/config.toml` r=matklad a=Veykril
![f1Gup1aiAn](https://user-images.githubusercontent.com/
3757771 /
117545448 -
1dcaae00 -b026-11eb-977a-
0f35a5e3f2e0 .gif)
Implements `cargo/.config` build target and cfg access by using unstable cargo options:
- `cargo config get` to read the target triple out of the config to pass to `cargo metadata` --filter-platform
- `cargo rustc --print` to read out the `rustc_cfgs`, this causes us to honor `rustflags` and the like.
If those commands fail, due to not having a nightly toolchain present for example, they will fall back to invoking rustc directly as we currently do.
I personally think it should be fine to use these unstable options as they are unlikely to change(even if they did it shouldn't be a problem due to the fallback) and don't burden the user if they do not have a nightly toolchain at hand since we fall back to the previous behaviour.
cc #8741
Closes #6604, Closes #5904, Closes #8430, Closes #8480
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Jonas Schievink [Sat, 8 May 2021 23:36:06 +0000 (01:36 +0200)]
Precompute macro fragment kind
bors[bot] [Sat, 8 May 2021 22:09:03 +0000 (22:09 +0000)]
Merge #8773
8773: fix: Correctly support SelfType when searching for usages r=Veykril a=Veykril
Fixes #7443
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 8 May 2021 22:07:04 +0000 (00:07 +0200)]
Use RUSTC_BOOTSTRAP=1 instead of +nightly when discovering rust_cfgs throughs cargo
Lukas Wirth [Sat, 8 May 2021 21:30:19 +0000 (23:30 +0200)]
Don't handle Self as a usage for TraitDefs
bors[bot] [Sat, 8 May 2021 21:14:47 +0000 (21:14 +0000)]
Merge #8775
8775: Add `=` to pattern recovery r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 8 May 2021 21:14:08 +0000 (23:14 +0200)]
Add `=` to pattern recovery
Lukas Wirth [Sat, 8 May 2021 20:43:26 +0000 (22:43 +0200)]
Fix builtintype def_to_ty
Lukas Wirth [Sat, 8 May 2021 20:34:55 +0000 (22:34 +0200)]
Correctly support SelfType when searching for usages
bors[bot] [Sat, 8 May 2021 20:29:03 +0000 (20:29 +0000)]
Merge #8772
8772: minor: remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 20:28:36 +0000 (23:28 +0300)]
minor: remove dead code
bors[bot] [Sat, 8 May 2021 20:20:09 +0000 (20:20 +0000)]
Merge #8770
8770: feat: add "mentoring instructions" test for pull up assist r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 20:19:08 +0000 (23:19 +0300)]
feat: add "mentoring instructions" test for pull up assist
Aleksey Kladov [Sat, 8 May 2021 20:09:36 +0000 (23:09 +0300)]
internal: pull_assignment_up uses mutable trees
Aleksey Kladov [Sat, 8 May 2021 17:40:07 +0000 (20:40 +0300)]
minor: add missing test
bors[bot] [Sat, 8 May 2021 17:03:58 +0000 (17:03 +0000)]
Merge #8769
8769: internal: removed dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 16:54:03 +0000 (19:54 +0300)]
dead code
Aleksey Kladov [Sat, 8 May 2021 16:57:18 +0000 (19:57 +0300)]
Disable more incremental
bors[bot] [Sat, 8 May 2021 16:51:09 +0000 (16:51 +0000)]
Merge #8768
8768: internal: remove one more usage of SyntaxRewriter r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Lukas Wirth [Sat, 8 May 2021 16:17:18 +0000 (18:17 +0200)]
Discover rustc_cfg through unstable cargo options
Aleksey Kladov [Sat, 8 May 2021 12:42:17 +0000 (15:42 +0300)]
internal: remove one more usage of SyntaxRewriter
bors[bot] [Sat, 8 May 2021 11:47:40 +0000 (11:47 +0000)]
Merge #8765
8765: internal: remove one more syntax rewriter r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 11:38:56 +0000 (14:38 +0300)]
internal: remove one more syntax rewriter
bors[bot] [Sat, 8 May 2021 11:14:24 +0000 (11:14 +0000)]
Merge #8764
8764: internal: add rust-analyzer version to panic context r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 11:03:12 +0000 (14:03 +0300)]
internal: add rust-analyzer version to panic context
bors[bot] [Sat, 8 May 2021 10:49:00 +0000 (10:49 +0000)]
Merge #8763
8763: feat: make troubleshooting a top-level section r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 10:48:25 +0000 (13:48 +0300)]
feat: make troubleshooting a top-level section
bors[bot] [Sat, 8 May 2021 10:37:01 +0000 (10:37 +0000)]
Merge #8762
8762: internal: disable broken incremental builds 😿 r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 10:36:06 +0000 (13:36 +0300)]
internal: disable broken incremental builds 😿
bors[bot] [Sat, 8 May 2021 10:19:05 +0000 (10:19 +0000)]
Merge #8761
8761: feat: friendlier trouble shooting guide r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 10:18:25 +0000 (13:18 +0300)]
feat: friendlier trouble shooting guide
bors[bot] [Sat, 8 May 2021 09:20:57 +0000 (09:20 +0000)]
Merge #8760
8760: :arrow_up: package-lock.json r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 8 May 2021 09:20:06 +0000 (12:20 +0300)]
:arrow_up: package-lock.json
bors[bot] [Sat, 8 May 2021 06:04:09 +0000 (06:04 +0000)]
Merge #8759
8759: docs: Add Kate installation section r=matklad a=meven
Replaces https://github.com/rust-analyzer/rust-analyzer.github.io/pull/111#issuecomment-
834797031
Co-authored-by: Méven Car <meven29@gmail.com>
Méven Car [Sat, 8 May 2021 05:33:24 +0000 (07:33 +0200)]
docs: Add Kate installation section
bors[bot] [Fri, 7 May 2021 21:27:20 +0000 (21:27 +0000)]
Merge #8755
8755: fix: direct people to the right repository r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 7 May 2021 21:19:01 +0000 (00:19 +0300)]
fix: direct people to the right repository
bors[bot] [Fri, 7 May 2021 20:50:47 +0000 (20:50 +0000)]
Merge #8753
8753: internal: expose cfg attrs from hir::Crate r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 7 May 2021 20:35:43 +0000 (23:35 +0300)]
internal: expose cfg attrs from hir::Crate
bors[bot] [Fri, 7 May 2021 19:47:09 +0000 (19:47 +0000)]
Merge #8752
8752: Switch from jemalloc to tikv-jemalloc r=matklad a=djrenren
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8252.
No idea if we're still interested in this but it was a simple change so here's the PR.
Co-authored-by: John Renner <john@jrenner.net>
John Renner [Fri, 7 May 2021 19:41:07 +0000 (12:41 -0700)]
Use package renaming so source doesn't say tikv
John Renner [Fri, 7 May 2021 19:17:37 +0000 (12:17 -0700)]
Switch from jemalloc to tikv-jemalloc
bors[bot] [Fri, 7 May 2021 18:47:05 +0000 (18:47 +0000)]
Merge #8751
8751: minor: standard snippet r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 7 May 2021 18:46:25 +0000 (21:46 +0300)]
minor: standard snippet
bors[bot] [Fri, 7 May 2021 15:33:08 +0000 (15:33 +0000)]
Merge #8748
8748: fix: use raw idents in `make::{name, name_ref}` when used with a keyword r=jonas-schievink a=jonas-schievink
fixes https://github.com/rust-analyzer/rust-analyzer/issues/8680
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 7 May 2021 13:35:02 +0000 (15:35 +0200)]
fix: use raw idents in `make::name{_ref}` with keywords
bors[bot] [Thu, 6 May 2021 22:28:35 +0000 (22:28 +0000)]
Merge #8745
8745: Support goto_type_definition for types r=matklad a=Veykril
I'm unsure if the approach of lowering an `ast::Type` to a `hir::Type` is a good idea, it seems fine to me at least.
Fixes #2882
Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
bors[bot] [Thu, 6 May 2021 22:19:52 +0000 (22:19 +0000)]
Merge #8280
8280: Borrow text of immutable syntax node r=iDawer a=iDawer
In https://github.com/rust-analyzer/rowan/pull/101 `rowan::SyntaxNode::green` returns `Cow<'_, GreenNodeData>`. It returns borrow of green node of immutable syntax tree node.
Using this we can return borrowed text from `ast::Name::text`.
~~However now it allocates in case of mutable syntax trees.~~ (see next comment)
The idea comes from https://github.com/rust-analyzer/rowan/pull/100#issuecomment-
809330325
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
bors[bot] [Thu, 6 May 2021 21:53:05 +0000 (21:53 +0000)]
Merge #8746
8746: Don't store call-site text offsets in hygiene info r=matklad a=jonas-schievink
This threads a lot more database references around in order to avoid storing a bare `TextOffset` in the hygiene info. This `TextOffset` made hygiene info and `ItemTree`s more volatile than they should be, leading to excessive recomputation of `ItemTree`s.
The incremental test added in https://github.com/rust-analyzer/rust-analyzer/pull/8721 is now passing with these changes.
closes https://github.com/rust-analyzer/rust-analyzer/pull/8721
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Jonas Schievink [Thu, 6 May 2021 21:23:50 +0000 (23:23 +0200)]
Reuse database in LowerCtx
Aleksey Kladov [Tue, 4 May 2021 14:12:35 +0000 (17:12 +0300)]
Update crates/hir_def/src/nameres/tests/incremental.rs
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Aleksey Kladov [Tue, 4 May 2021 12:31:23 +0000 (15:31 +0300)]
internal: add failing incremental test
Jonas Schievink [Thu, 6 May 2021 17:59:54 +0000 (19:59 +0200)]
Don't store call-site text offsets in hygiene info
bors[bot] [Thu, 6 May 2021 17:29:30 +0000 (17:29 +0000)]
Merge #8718
8718: 1.52.0 r=SomeoneToIgnore a=matklad
A lot of APIs we use in this release!
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Kirill Bulatov [Thu, 6 May 2021 17:12:30 +0000 (20:12 +0300)]
Small macro fix
Aleksey Kladov [Tue, 4 May 2021 11:10:49 +0000 (14:10 +0300)]
internal: use API stabilized in 1.52
Lukas Tobias Wirth [Thu, 6 May 2021 15:05:49 +0000 (17:05 +0200)]
Support goto_type_definition for types
bors[bot] [Thu, 6 May 2021 14:48:16 +0000 (14:48 +0000)]
Merge #8744
8744: minor: simplify r=edwin0cheng a=edwin0cheng
cc #8742
bors r+
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
bors[bot] [Thu, 6 May 2021 14:41:14 +0000 (14:41 +0000)]
Merge #8743
8743: internal: explain why sentence-per-line r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 6 May 2021 14:40:36 +0000 (17:40 +0300)]
internal: explain why sentence-per-line
Edwin Cheng [Thu, 6 May 2021 14:39:51 +0000 (22:39 +0800)]
Simplify
bors[bot] [Thu, 6 May 2021 14:26:26 +0000 (14:26 +0000)]
Merge #8742
8742: fix: Do not overwrite comments and attrs in trait impl completion r=Veykril a=Jesse-Bakker
Fixes #8739
Co-authored-by: Jesse Bakker <github@jessebakker.com>
Jesse Bakker [Thu, 6 May 2021 13:56:48 +0000 (15:56 +0200)]
Fix: Do not overwrite comments and attrs in trait impl completion