Commit Graph

1174 Commits

Author SHA1 Message Date
bors[bot]
95d85336df
Merge #9595
9595: Show test mod runnable in outline modules r=Veykril a=Veykril

This shows a runnable inside outline test modules at the top of its file:
![image](https://user-images.githubusercontent.com/3757771/125494747-169c9238-3faa-4eed-9700-90bd730b4e3c.png)


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-15 00:20:44 +00:00
Lukas Wirth
d837a5d5a7 Show test mod runnable in outline modules 2021-07-14 11:30:51 +02:00
Lukas Wirth
12fe48c04d Use Type::walk for goto_type_definition 2021-07-14 01:42:30 +02:00
bors[bot]
9bd6836513
Merge #9596
9596: Return type arguments in goto_type_definition result  r=Veykril a=Veykril

Fixes #9586
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-13 17:25:00 +00:00
Lukas Wirth
796988a269 Return type arguments in goto_type_definition result 2021-07-13 19:24:29 +02:00
Lukas Wirth
d1256a3709 Assign mutable semantic token modifier to assignment operators 2021-07-13 18:32:02 +02:00
Lukas Wirth
b3337c26db Split main highlighting function up into a few subfunctions 2021-07-13 18:29:57 +02:00
Lukas Wirth
ab2647769c Return both field and local references for shorthands in goto_def 2021-07-11 16:16:16 +02:00
Lukas Wirth
c41f1279a3 Inline name classification reference calls 2021-07-11 15:39:09 +02:00
Lukas Wirth
c65bb7f8b9 Explicitly check for reference locals or fields in Name classification 2021-07-11 15:04:40 +02:00
bors[bot]
87621de2b9
Merge #9567 #9568
9567: remove unneded special case r=matklad a=matklad

bors r+
🤖

9568: feat: add 'for' postfix completion r=lnicola a=mahdi-frms


![Peek 2021-07-11 16-45](https://user-images.githubusercontent.com/62165556/125194692-a0aaf780-e267-11eb-952a-81de7955d9a1.gif)


adds #9561

used ```ele``` as identifier for each element in the iteration

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
2021-07-11 12:51:33 +00:00
Aleksey Kladov
bbb053532e internal: remove one more needless extern crate 2021-07-11 15:48:49 +03:00
Aleksey Kladov
1171dc74e0 internal: remove unused param 2021-07-11 15:08:00 +03:00
Aleksey Kladov
f42648e305 internal: remove needless distinction between a carte and its root mod 2021-07-11 14:55:24 +03:00
Aleksey Kladov
92059ea438 update tests 2021-07-11 13:55:00 +03:00
Aleksey Kladov
5c26523e94 drop unused fields 2021-07-11 13:51:52 +03:00
Aleksey Kladov
a04775060c simplify 2021-07-11 13:49:38 +03:00
Aleksey Kladov
ddce16a126 drop unused field 2021-07-11 13:48:26 +03:00
Aleksey Kladov
beb81a40eb simplify 2021-07-11 13:45:58 +03:00
Aleksey Kladov
96d85a9efb be explicit about what we *can't* debug 2021-07-11 13:44:28 +03:00
Aleksey Kladov
fa6f78c95b better name 2021-07-11 13:43:43 +03:00
Aleksey Kladov
0dc186f612 Let the client care about presentation 2021-07-11 13:42:19 +03:00
bors[bot]
325140a165
Merge #9449
9449: feat: Emit test names in `Run test` runnables if they come from a macro expansion r=matklad a=Veykril

Fixes #8964
Before:
![Code_D1Tu5Iuh5I](https://user-images.githubusercontent.com/3757771/124174685-f552b380-daac-11eb-9086-c97db014b77c.png)
After:
![image](https://user-images.githubusercontent.com/3757771/124174493-bb81ad00-daac-11eb-96c7-3de6545a62e1.png)

Basically when a macro emits more than one test we name the test functions/modules name in the runnable instead to not emit a bunch of equally named `Run Test` annotations which don't really tell much.

Note that the `Run fibonacci_test Tests` line is below the attributes due to the fact that the function name span is being reused for the generated module in rstest's expansion.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-11 09:37:33 +00:00
Lukas Wirth
f1b3446844 Emit test name in Run test runnables if it comes from a macro expansion 2021-07-09 14:35:42 +02:00
Aleksey Kladov
0db4f3f6a4 internal: ensure consistent passing for config params
We pass "context" parametes first, so configs should be on the left.
"Bigger" context wins, so configs goes after db.
2021-07-06 00:00:39 +03:00
Aleksey Kladov
b8a6ea5ab5 feat: make join lines behavior configurable
closes #9492
2021-07-05 23:47:20 +03:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
Aleksey Kladov
6e9780c005 internal: make CompletionItem and SourceChange consistent
Before this PR, SourceChange used a bool and CompletionItem used an enum
to signify if edit is a snippet. It makes sense to use the same pattern
in both cases. `bool` feels simpler, as there's only one consumer of
this API, and all producers are encapsulated anyway (we check the
capability at the production site).
2021-07-04 15:44:03 +03:00
Aleksey Kladov
f875b91fdb feat: join lines joins two ifs into else if 2021-07-03 18:40:23 +03:00
Lukas Wirth
a7d61ddba4 Add cov_mark 2021-07-02 19:34:49 +02:00
Lukas Wirth
59eec29e1b Fix runnables using wrong file ids for module doctests 2021-07-02 15:43:47 +02:00
Lukas Wirth
0b8e145641 Print runnable kind on assertion failure for better debuggability 2021-07-02 15:34:26 +02:00
Lukas Wirth
f640f2dbb4 Fix incorrect guard for NameRefClass attribute resolution 2021-07-02 15:17:21 +02:00
bors[bot]
334c7eba8d
Merge #9452
9452: feat: Add "View Crate Graph (Full)" r=jonas-schievink a=jonas-schievink

Works like "View Crate Graph", but also includes crates.io and sysroot dependencies. The resulting graph might be enormous.

Closes https://github.com/rust-analyzer/rust-analyzer/issues/8867

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-07-01 22:12:53 +00:00
Jonas Schievink
5f13fb9db9 Add "View Crate Graph (Full)" 2021-07-02 00:10:33 +02:00
bors[bot]
0331d19f42
Merge #9451
9451: minor: Add `goto_type_action` for field hovers r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 19:52:14 +00:00
Lukas Wirth
81762024b5 Add goto_type_action for field hovers 2021-07-01 21:51:26 +02:00
bors[bot]
2f9645501c
Merge #9436
9436: minor: Add test for macro expanded test module in runnables r=Veykril a=Veykril

Expected this to fail as thats behaving incorrectly on current nightly but I think I fixed this accidentally with https://github.com/rust-analyzer/rust-analyzer/pull/9435
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-30 17:37:28 +00:00
Lukas Wirth
8d3a378de9 Add test for macro expanded test module in runnables 2021-06-30 19:35:58 +02:00
bors[bot]
3c42aefceb
Merge #9435
9435: fix: Don't add test runnables for outline modules in the wrong file r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-30 17:11:34 +00:00
Lukas Wirth
b8507ca98d Don't add test runnables for outline modules in the wrong file 2021-06-30 19:08:13 +02:00
bors[bot]
11b9233fc4
Merge #9269
9269: Recreate status page r=lnicola a=Milo123459

I'm working on redesigning the status page.

Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2021-06-29 19:53:19 +00:00
Milo
4d8fe6208e fix 2021-06-29 20:34:52 +01:00
Milo
d85fa40d58
Update crates/ide/src/status.rs
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-06-29 20:32:33 +01:00
Lukas Wirth
9a1b9b3c78 Resolve attribute paths in attribute highlighting 2021-06-28 21:53:17 +02:00
Lukas Wirth
9957220dfe Fix NameRef::classify path resolution inside attributes 2021-06-28 19:07:23 +02:00
Milo
443d2164ef remove unneeded ifs 2021-06-28 17:52:57 +01:00
Milo
2e60908fde check if counts should be a thing 2021-06-28 17:50:24 +01:00
Lukas Wirth
34c28c1bbc Include self in usage search for modules in their definition source 2021-06-28 16:41:35 +02:00
Milo
d1821e4b6e fix all reviews 2021-06-28 07:31:54 +01:00
Lukas Wirth
3ce5c66ca1 Deduplicate ast expression walking logic 2021-06-27 01:11:57 +02:00
bors[bot]
2ac1ffc0f3
Merge #9400
9400: fix: Fix renaming associated trait items with colliding names r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-25 01:48:50 +00:00
Lukas Wirth
942eeb2f55 Fix renaming associated trait items with colliding names 2021-06-25 03:45:41 +02:00
bors[bot]
83fc0db7e2
Merge #9397
9397: fix: Fix break point highlighting not considering outer labels r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24 19:15:59 +00:00
Lukas Wirth
67075b228e Fix break point highlighting not considering outer labels 2021-06-24 21:14:43 +02:00
bors[bot]
0f0dbdc7d1
Merge #9396
9396: feat: Highlight loop break points r=Veykril a=Veykril

![Code_HmWQMlioKr](https://user-images.githubusercontent.com/3757771/123318732-d47be280-d52f-11eb-8a9a-cb3f591d4195.png)
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24 19:05:41 +00:00
Lukas Wirth
42efd211bc Highlight label value block tails 2021-06-24 21:01:37 +02:00
Lukas Wirth
543f925353 Highlight loop break points 2021-06-24 20:57:02 +02:00
bors[bot]
264716e827
Merge #9375
9375: feat: Highlight exit and yield points r=Veykril a=Veykril

![Code_YBHOCF3DbU](https://user-images.githubusercontent.com/3757771/123128986-e1270a80-d44b-11eb-9854-065459a2dd50.png)
![Code_YyMhqES0LX](https://user-images.githubusercontent.com/3757771/123128988-e1bfa100-d44b-11eb-9c81-6a6031aad740.png)

Fixes #4691
Fixes #9365

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24 15:23:25 +00:00
Lukas Wirth
d77655e5c3 Refine tail exit point highlighting to highlight inner tails 2021-06-24 17:19:27 +02:00
Lukas Wirth
d049783b5d Simplify 2021-06-24 16:50:56 +02:00
Lukas Wirth
066bc4f3a4 Simplify 2021-06-24 01:32:56 +02:00
bors[bot]
b656751536
Merge #9380
9380: feat: Implement goto_declaration support r=matklad a=Veykril

This is just a simple implementation that falls back to `goto_definition` for everything but modules where it goes to the actual module declaration if possible.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-23 22:33:05 +00:00
Lukas Wirth
37d417868e move goto_declaration fall back into handlers 2021-06-24 00:26:08 +02:00
Lukas Wirth
511ae17d07 Improve feature docs for highlight_related 2021-06-23 18:11:48 +02:00
Lukas Wirth
f283fce594 Mark (method-)calls with never type as exit points 2021-06-23 17:21:47 +02:00
Lukas Wirth
cc791538d6 Simplify 2021-06-23 17:05:00 +02:00
Lukas Wirth
12266d5e56 Strip leading whitespace from test ouput in references 2021-06-23 16:49:36 +02:00
Lukas Wirth
e406140f38 Implement exit point highlighting 2021-06-23 16:43:53 +02:00
Lukas Wirth
9a53f1033e Implement yield point highlighting 2021-06-23 16:16:32 +02:00
Lukas Wirth
14b66bb458 Rename 'document_highlight' to 'highlight_related' 2021-06-23 15:13:48 +02:00
Lukas Wirth
b26a8ecca1 Move document highlighting computation from rust-analyzer to ide 2021-06-23 15:02:49 +02:00
Aramis Razzaghipour
3e7472f76c
Add public semantic token modifier for public items 2021-06-23 09:40:04 +10:00
Lukas Wirth
5a74e93c33 Implement goto_declaration support 2021-06-22 20:49:07 +02:00
Lukas Wirth
f615efdfc3 Factor out pick_best_token ide pattern into ide_db 2021-06-22 17:50:15 +02:00
bors[bot]
ff92afb4c1
Merge #9368
9368: fix: Prefer identifier tokens in expand_macro r=Veykril a=Veykril

Fixes #9366
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-22 10:06:34 +00:00
Lukas Wirth
b423c61ce6 Prefer identifier tokens in expand_macro 2021-06-22 12:03:51 +02:00
Lukas Wirth
65d683df36 Collapse documentation and markdown config settings into an enum 2021-06-21 21:57:01 +02:00
Lukas Wirth
99c95b8fa1 Split hover actions config into its own config struct 2021-06-21 21:47:54 +02:00
Jamie Cunliffe
ae823aa23f Move features into potential_cfg_options 2021-06-21 17:54:05 +01:00
Jamie Cunliffe
284483b347 Improve completion of cfg attributes
The completion of cfg will look at the enabled cfg keys when
performing completion.

It will also look crate features when completing a feature cfg
option. A fixed list of known values for some cfg options are
provided.

For unknown keys it will look at the enabled values for that cfg key,
which means that completion will only show enabled options for those.
2021-06-21 17:47:00 +01:00
bors[bot]
25bf451c84
Merge #9264
9264: feat: Make documentation on hover configurable r=Veykril a=Veykril

This also implements deprecation support for config options as this renames `hoverActions_linksInHover` to `hover_linksInHover`.

Fixes #9232

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-21 14:15:49 +00:00
Jonas Schievink
8d2a33da05 Don't insert } when typing { in string 2021-06-21 14:54:49 +02:00
bors[bot]
f1097c2d26
Merge #9344
9344: fix: rename works when invoked on a reference r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-20 14:08:19 +00:00
Aleksey Kladov
cbb1979c19 fix: rename works when invoked on a reference 2021-06-20 17:07:55 +03:00
bors[bot]
3843bd02a0
Merge #9328
9328: internal: Update deps r=lnicola a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2021-06-20 03:22:13 +00:00
Milo
044e21ae08 remove num_format 2021-06-19 10:14:15 +01:00
Aleksey Kladov
7df6852b6e minor: use minicore 2021-06-19 12:03:59 +03:00
Milo
673933e2f7 update crate and deps section 2021-06-19 09:44:11 +01:00
Milo
664cc8c754 use num_format 2021-06-19 08:12:46 +01:00
Milo
d2f7e0fea4 clean up some wording 2021-06-19 07:51:44 +01:00
Milo
08ec80c093 remove incorrect double blank new lines 2021-06-18 23:34:00 +01:00
Aleksey Kladov
a9623f3165 minor: use minicore 2021-06-18 23:38:19 +03:00
Aleksey Kladov
cc73abf72c minor: use minicore 2021-06-18 23:33:01 +03:00
Aleksey Kladov
89a0e58393 internal: use minicore deref more 2021-06-18 22:47:02 +03:00
Aleksey Kladov
15c4b3fa7f internal: add Copy to minicore 2021-06-18 22:10:52 +03:00
kjeremy
e0e694620c Update test 2021-06-18 14:36:12 -04:00
Milo
7d502c7f08 Recreate PR. 2021-06-18 19:22:03 +01:00
Laurențiu Nicola
e3ce88f6f2 Minor clippy perf fixes 2021-06-18 14:40:51 +03:00
Aleksey Kladov
66673eae2b internal: retire famous_defs_fixture
This is now done declaratively via `minicore`.
2021-06-18 00:42:32 +03:00
Aleksey Kladov
ebb591a570 internal: add derive and ord support to minicore 2021-06-18 00:30:22 +03:00
Aleksey Kladov
ca99aaa053 internal: add From to minicore 2021-06-17 21:04:12 +03:00
Aleksey Kladov
08c220ab2c internal: add default to minicore 2021-06-17 20:49:49 +03:00
Lukas Wirth
95c8c65139 Nest all the or-patterns! 2021-06-17 17:37:14 +02:00
Aleksey Kladov
c42cdff3d2 internal: minimize minicore
We want to keep minicore small, so let's split out iterator adapters and
sources into a separate `iterators` region, and use them only when
needed.
2021-06-17 11:28:44 +03:00
Aleksey Kladov
9b3aa591cd internal: switch some tests to minicore 2021-06-17 11:18:37 +03:00
Aleksey Kladov
8a4d9bb80a internal: add fn to minicore 2021-06-16 12:15:45 +03:00
bors[bot]
5ba5e6348f
Merge #9293
9293: fix: Show diagnostic fixes before assists r=matklad a=lnicola

Closes #9212

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-06-15 20:38:29 +00:00
bors[bot]
9bddd2af55
Merge #9294
9294: internal: introduce minicore -- a subset of libcore for testing r=matklad a=matklad

Clearly, we need one more fixed point iteration loop!

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-15 20:14:36 +00:00
Aleksey Kladov
7cbcbccc78 internal: switch some tests to minicore 2021-06-15 23:11:53 +03:00
Lukas Wirth
29054e02fb Highlight unsafe trait refs as unsafe only in impl blocks and definitions 2021-06-15 21:49:59 +02:00
Laurențiu Nicola
e58f63dc63 Show diagnostic fixes before assists 2021-06-15 20:55:27 +03:00
Aleksey Kladov
4584868a7a internal: don't #[ignore] tests
See the style.md for motivation
2021-06-15 16:37:58 +03:00
bors[bot]
fa4c851619
Merge #9278
9278: internal: document that we don't #[ignore] tests r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-15 08:48:15 +00:00
Aleksey Kladov
3f4ad44082 internal: document that we don't #[ignore] tests 2021-06-15 11:46:47 +03:00
bors[bot]
447d849c9e
Merge #9277
9277: internal: more natural order of sources for TypeParam r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-06-14 19:44:59 +00:00
Aleksey Kladov
c2015e7d18 internal: more natural order of sources for TypeParam
We usually use first (left) variant of `Either` for "usual" case, and
use right for odd things. For example, pat source is Pat | SelfParam.
2021-06-14 22:42:43 +03:00
bors[bot]
27a70492f7
Merge #9275
9275: feat: Support goto type for field expressions and patterns r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-14 19:08:05 +00:00
Lukas Wirth
2c8e89b6f0 Support goto type for field expressions and patterns 2021-06-14 21:07:07 +02:00
Aleksey Kladov
94f7b63522 minor: less ambiguous name 2021-06-14 19:16:03 +03:00
Aleksey Kladov
da534bdd07 internal: flatten module hierarchy
It seems that any crate can be made better by flattening the modules
down to a single layer?
2021-06-14 19:14:34 +03:00
Aleksey Kladov
9fb67e7477 internal: document rename challenges 2021-06-14 19:08:12 +03:00
Lukas Wirth
c7c2eb8b08 typo 2021-06-14 18:01:38 +02:00
Aleksey Kladov
26c978f258 internal: adapt diagnostics to the new rename API 2021-06-14 18:46:54 +03:00
Aleksey Kladov
2e8dab631b internal: prepare to move assist definitions 2021-06-14 17:45:17 +03:00
Aleksey Kladov
1d2772c2c7 internal: move diagnostics to a new crate 2021-06-14 17:45:17 +03:00
Aleksey Kladov
721feb1832 internal: prepare to move rename to base_db
It's better to handle magical cases upper in the stack, because it
allows for better re-use of the general implementation below. So, we
pull the `self` case up here.

The end goal is to put `Definition::rename` to the `ide_db`, because
it's a generally re-usable functionality useful for different ide
features, alongside with the search which is already there.
2021-06-14 17:28:39 +03:00
Lukas Wirth
9043c5db86 Don't ignore hover documentation setting for keyword hovers 2021-06-14 15:31:14 +02:00
Lukas Wirth
a93d166f0f Make documentation on hover configurable 2021-06-14 15:25:10 +02:00
Aleksey Kladov
e696188672 fix: don't use display-related functionality where semantics matters
NavigationTarget is strictly a UI-level thing -- it describes where the
cursor should be placed when the user presses goto definition. It
doesn't make any semantic guaratees about rage and focus range and, as
such, is not suitable for driving renames.
2021-06-14 15:43:59 +03:00
Aleksey Kladov
500c909c76 internal: diagnostic code is mandatory 2021-06-13 22:17:36 +03:00
Aleksey Kladov
b404b91da6 minor: dead code 2021-06-13 22:11:33 +03:00
Aleksey Kladov
ff52167c9a internal: kill diagnostic sink 2021-06-13 22:05:47 +03:00
Aleksey Kladov
935c53b92e internal: use cov-mark rather than bailing out diagnostic 2021-06-13 21:55:51 +03:00
Aleksey Kladov
b292e1b9da internal: refactor missing match arms diagnostics 2021-06-13 21:44:31 +03:00
Aleksey Kladov
3478897f86 internal: remove DiagnosticWithFix infra 2021-06-13 21:33:54 +03:00
Aleksey Kladov
fc30c5ccbe internal: refactor incorrect case diagnostics 2021-06-13 21:09:03 +03:00
Aleksey Kladov
b66f4bb8d1 minor 2021-06-13 20:33:59 +03:00
Aleksey Kladov
de1fc70ccd internal: refactor find_map diagnostic 2021-06-13 20:32:54 +03:00
Aleksey Kladov
24262f9ff6 minor 2021-06-13 20:20:58 +03:00
Aleksey Kladov
949a6ec469 internal: refactor missing or or some diagnostic 2021-06-13 20:19:11 +03:00
Aleksey Kladov
74f3cca85a internal: refactor remove this semicolon diagnostics 2021-06-13 20:14:12 +03:00
Aleksey Kladov
8d391ec981 internal: refactor mismatched args count diagnostic 2021-06-13 20:06:25 +03:00
Aleksey Kladov
bccf77f26c internal: refactor missing unsafe diagnostic 2021-06-13 20:01:01 +03:00
Aleksey Kladov
886b66cd03 internal: refactor BreakOutsideOfLoop diagnostic 2021-06-13 19:51:19 +03:00
Aleksey Kladov
7166e8549b internal: refactor NoSuchField diagnostic 2021-06-13 19:45:16 +03:00
Aleksey Kladov
d3621eeb02 internal: refactor unimplemented builtin macro diagnostic 2021-06-13 19:35:30 +03:00
Aleksey Kladov
dec207f56a minor: simplify 2021-06-13 19:27:24 +03:00
Aleksey Kladov
a1940d8c75 internal: check diagnostics in all files and not just the first one 2021-06-13 19:23:37 +03:00
Aleksey Kladov
4af7a35197 internal: remove def-level diagnostics tests 2021-06-13 18:45:38 +03:00
Aleksey Kladov
00303284b5 internal: refactor macro error 2021-06-13 18:41:04 +03:00
Aleksey Kladov
1e4aaee7bb internal: refactor unresolved proc macro diagnostic 2021-06-13 17:51:44 +03:00
Aleksey Kladov
f85e383b94 internal: refactor inactive code diagnostics 2021-06-13 17:29:25 +03:00
Aleksey Kladov
fa9ed4e0ce internal: refactor unresolved macro call diagnostic 2021-06-13 17:08:54 +03:00
Aleksey Kladov
6d104de15a internal: refactor unresolved import diagnostic 2021-06-13 16:42:34 +03:00
Aleksey Kladov
39f190b72c internal: refactor unresolved extern crate diagnostic 2021-06-13 16:05:43 +03:00
Aleksey Kladov
6383252cc2 internal: unified missing fields diagnostic 2021-06-13 15:48:54 +03:00
Aleksey Kladov
c6509a4592 internal: move missing_fields diagnostics 2021-06-13 15:27:15 +03:00
Aleksey Kladov
efa069d288 internal: start new diagnostics API
At the moment, this moves only a single diagnostic, but the idea is
reafactor the rest to use the same pattern. We are going to have a
single file per diagnostic. This file will define diagnostics code,
rendering range and fixes, if any. It'll also have all of the tests.
This is similar to how we deal with assists.

After we refactor all diagnostics to follow this pattern, we'll probably
move them to a new `ide_diagnostics` crate.

Not that we intentionally want to test all diagnostics on this layer,
despite the fact that they are generally emitted in the guts on the
compiler. Diagnostics care to much about the end presentation
details/fixes to be worth-while "unit" testing. So, we'll unit-test only
the primary output of compilation process (types and name res tables),
and will use integrated UI tests for diagnostics.
2021-06-13 14:55:45 +03:00
Aleksey Kladov
0eafc88079 minor: put a mark back 2021-06-13 11:49:32 +03:00
Maan2003
5ac6804bb3
cargo fmt 2021-06-13 09:48:15 +05:30
Maan2003
c50b4579ec
clippy::useless_return 2021-06-13 09:35:29 +05:30
Maan2003
75370312fb
clippy::redundant_closure 2021-06-13 09:29:36 +05:30
Maan2003
705f7e6e26
clippy::clone_on_copy 2021-06-13 09:27:19 +05:30
Maan2003
c9b4ac5be4
clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
Aleksey Kladov
0463d76a1f internal: cross-crate cov-marks 2021-06-12 23:40:52 +03:00
Aleksey Kladov
7731714578 internal: move diagnostics infra to hir 2021-06-12 22:05:23 +03:00
Aleksey Kladov
6940cfed1e Move some hir_ty diagnostics to hir 2021-06-12 21:00:22 +03:00
Aleksey Kladov
0413d51317 internal: move missing unsafe diagnostic to hir 2021-06-12 17:39:46 +03:00
Aleksey Kladov
f8009666be internal: move inference diagnostics to hir 2021-06-12 17:17:23 +03:00
Lukas Wirth
e09723f0af Highlight tuple field accesses correctly 2021-06-11 21:19:19 +02:00
bors[bot]
863e23f00f
Merge #9219
9219: minor: Replace some AssocItem::containing_trait calls trait_or_trait_impl r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-11 17:56:00 +00:00
Lukas Wirth
db4a1fcab4 Replace some AssocItem::containing_trait calls trait_or_trait_impl 2021-06-11 19:55:24 +02:00
bors[bot]
21d4416235
Merge #9218
9218: Item search now respects trait impl items r=Veykril a=Veykril

Fixes #2977

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-11 17:33:34 +00:00
Lukas Wirth
48f65b3b15 Item search now respects trait impl items 2021-06-11 19:24:52 +02:00
Jonas Schievink
1d6eef1350 Update ungrammar 2021-06-11 18:34:30 +02:00
Kirill Bulatov
a6cdde0d0b Populate import maps eagerly 2021-06-11 01:27:20 +03:00
Lukas Wirth
26c869ddc0 Don't classify attributes on macro-calls are the macro itself 2021-06-10 00:26:15 +02:00
bors[bot]
5f592f4f58
Merge #9191
9191: fix: Don't descend MacroCall TokenTree delimiters r=jonas-schievink a=Veykril

Fixes #9190

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-09 13:17:38 +00:00
Lukas Wirth
3c40b15d62 Don't descend MacroCall TokenTree delimiters 2021-06-09 15:02:11 +02:00
Jonas Schievink
fcf22d68d4 Prefer attr macros in "expand macro recursively" 2021-06-08 22:26:01 +02:00
bors[bot]
2f376f7475
Merge #9169
9169: internal: steps towards attribute macro token mapping r=jonas-schievink a=jonas-schievink

This doesn't work yet, but we seem to be getting a bit further along (for example, we now stop highlighting `use` items inside item with attribute macros as if they were written verbatim).

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-06-07 17:37:48 +00:00
Jonas Schievink
33be5762e5 Attempt to track attr macros during highlighting 2021-06-07 19:32:28 +02:00
Jonas Schievink
33e747d786 Make "expand macro" command work with attribute macros 2021-06-07 16:05:36 +02:00
Jade
34ce05781f feat: goto def on impl items also goes to the defn in the trait
It was trivial to extend this to associated consts/associated types and
I just didn't think of it.
2021-06-06 21:52:00 -07:00
Jade
8a57c73640 feat: goto definition on an impl fn goes to that fn in the trait
e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.
2021-06-06 21:51:17 -07:00
bors[bot]
d616a6a456
Merge #9149
9149: feat: Support goto-definition for include macros input path r=Veykril a=Veykril

![0l6l9iWPNE](https://user-images.githubusercontent.com/3757771/120891155-3fa85800-c607-11eb-9b20-7ac330dceb4b.gif)
Fixes #5871


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-05 19:26:33 +00:00
Lukas Wirth
5391f9c63c Support goto-definition for include macro paths 2021-06-05 19:04:50 +02:00
Lukas Wirth
d30f2d43db Prevent renaming of aliases on usages 2021-06-05 13:15:07 +02:00
bors[bot]
98395f29a4
Merge #9138
9138: feat: Implement hover for lints r=Veykril a=Veykril

fixes https://github.com/rust-analyzer/rust-analyzer/issues/8857, fixes https://github.com/rust-analyzer/rust-analyzer/issues/3941

![URXBanNxYe](https://user-images.githubusercontent.com/3757771/120830905-4bd8da80-c55f-11eb-9f55-ff5a321726fa.gif)

We also generate the default lints(and lint groups 🎉) instead now by invoking `rustc -W help` and parsing the output from that.


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-04 17:45:37 +00:00
Lukas Wirth
0c89f38378 Replace - with _ in generated lint names 2021-06-04 19:10:52 +02:00
Lukas Wirth
343df88ac7 Generate default lint completions 2021-06-04 18:35:19 +02:00
Lukas Wirth
5d17b6a687 Implement hover for lints 2021-06-04 17:03:18 +02:00
Lukas Wirth
07394316ff Add function references hover action 2021-06-04 15:54:55 +02:00
Lukas Wirth
5f1fac44c5 Cleanup parameter_hint_heuristics inlay hints test 2021-06-04 14:09:20 +02:00
Lukas Wirth
b0f6d8868c Reorganize inlay_hints tests 2021-06-04 13:47:39 +02:00
bors[bot]
7f9c4a59d9
Merge #9130
9130: Prefix/suffix parameter inlay hint hiding heuristic is more strict r=Veykril a=Veykril

Instead of just plainly checking prefix/suffix of the argument string to the parameter name we only check for prefixes and suffixes if they are split apart via an underscore meaning, with the argument `foo`, it will be hidden for the parameter name `foo_bar` but not for `foobar`.

bors r+
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8878

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-03 14:26:07 +00:00
Lukas Wirth
cc762c30df Prefix/suffix parameter inlay hint hiding heuristic is more strict 2021-06-03 16:22:24 +02:00
Lukas Wirth
841feef79e Allow expand-macro to be invoked anywhere inside a macro call 2021-06-02 21:42:49 +02:00
bors[bot]
10b15b27f2
Merge #8952
8952: add support of impl block for doctest into runnables r=matklad a=bnjjj

close #6356 

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-05-31 15:48:41 +00:00