Lukas Wirth
cf083fefc4
fix: Fix completion failing in format_args! with invalid template
2023-12-08 20:35:33 +01:00
Lukas Wirth
35fbc0210c
Fallback to method resolution on unresolved field access with matching method name
2023-12-08 16:36:41 +01:00
bors
bc9c952b6d
Auto merge of #16028 - Young-Flash:fix-issue-16012, r=HKalbasi
...
fix: make drop inlay hint more readable
![drop_inlay_hint](https://github.com/rust-lang/rust-analyzer/assets/71162630/bb18707f-3278-435d-a938-ccff4c685586 )
follow up https://github.com/rust-lang/rust-analyzer/pull/16000 , close https://github.com/rust-lang/rust-analyzer/issues/16012
2023-12-07 21:45:24 +00:00
Lukas Wirth
80dc20f7d8
fix: Don't print proc-macro panic backtraces in the logs
2023-12-06 17:49:48 +01:00
Lukas Wirth
634d588fd7
Simplify
2023-12-06 14:36:39 +01:00
Lukas Wirth
9cb13b6efb
Allow navigation targets to be duplicated when the focus range lies in the macro definition site
2023-12-06 12:38:19 +01:00
Lukas Wirth
9b7ec5e31b
Ignore strings in token trees in syntax highlighting
2023-12-05 17:07:00 +01:00
Lukas Wirth
4525787ed5
Add test for implicit format args support through nested macro call
2023-12-05 17:07:00 +01:00
Lukas Wirth
fe0a85ca29
Resolve implicit format args in syntax highlighting
2023-12-05 17:07:00 +01:00
Lukas Wirth
d2cd30007c
Implicit format args support
2023-12-05 17:07:00 +01:00
Lukas Wirth
5b8e386bae
Improve macro descension API
2023-12-05 17:06:57 +01:00
Young-Flash
afc4075c7c
fix: make drop inlay hint more readable
2023-12-05 22:56:51 +08:00
Igor Matuszewski
a7224c998d
Don't explicitly warn against semicolon_in_expressions_from_macros
...
This has been warn-by-default for two years now and has already been
added to the future-incompat lints in 1.68.
2023-12-05 11:35:09 +01:00
bors
e91fdf7860
Auto merge of #15959 - Veykril:macro-shower3, r=lnicola
...
TokenMap -> SpanMap rewrite
Opening early so I can have an overview over the full diff more easily, still very unfinished and lots of work to be done.
The gist of what this PR does is move away from assigning IDs to tokens in arguments and expansions and instead gives the subtrees the text ranges they are sourced from (made relative to some item for incrementality). This means we now only have a single map per expension, opposed to map for expansion and arguments.
A few of the things that are not done yet (in arbitrary order):
- [x] generally clean up the current mess
- [x] proc-macros, have been completely ignored so far
- [x] syntax fixups, has been commented out for the time being needs to be rewritten on top of some marker SyntaxContextId
- [x] macro invocation syntax contexts are not properly passed around yet, so $crate hygiene does not work in all cases (but most)
- [x] builtin macros do not set spans properly, $crate basically does not work with them rn (which we use)
~~- [ ] remove all uses of dummy spans (or if that does not work, change the dummy entries for dummy spans so that tests will not silently pass due to havin a file id for the dummy file)~~
- [x] de-queryfy `macro_expand`, the sole caller of it is `parse_macro_expansion`, and both of these are lru-cached with the same limit so having it be a query is pointless
- [x] docs and more docs
- [x] fix eager macro spans and other stuff
- [x] simplify include! handling
- [x] Figure out how to undo the sudden `()` expression wrapping in expansions / alternatively prioritize getting invisible delimiters working again
- [x] Simplify InFile stuff and HirFIleId extensions
~~- [ ] span crate containing all the file ids, span stuff, ast ids. Then remove the dependency injection generics from tt and mbe~~
Fixes https://github.com/rust-lang/rust-analyzer/issues/10300
Fixes https://github.com/rust-lang/rust-analyzer/issues/15685
2023-12-04 19:59:53 +00:00
Lukas Wirth
81410ab500
Cleanup FileId stuff
2023-12-02 19:32:53 +01:00
Lukas Wirth
02a3a9438a
Some more minor cleanups
2023-12-02 17:04:13 +01:00
hkalbasi
4d55cac466
Initial support for implicit drop inlay hint
2023-12-01 16:16:46 +03:30
Lukas Wirth
92d447f976
🧹
2023-11-28 10:55:40 +01:00
Lukas Wirth
c43078f99d
Re-implement InFile wrappers as type aliases over generic InFileWrapper
2023-11-28 10:55:40 +01:00
Lukas Wirth
30093a6d81
spans always come from real file
2023-11-28 10:55:39 +01:00
Lukas Wirth
890eb17b4e
Replace ID based TokenMap with proper relative text-ranges / spans
2023-11-28 10:55:39 +01:00
David Tolnay
b68f5311b5
Replace option.map(cond) == Some(true)
with option.is_some_and(cond)
2023-11-24 09:06:44 -08:00
bors
375142902c
Auto merge of #15885 - RunDevelopment:patch-1, r=lnicola
...
Fix typo in highlight_related.rs
While reading the user manual, I noticed a random tick, so I went ahead and fixed it. The `await` keyword should be properly rendered as inline code.
![image](https://github.com/rust-lang/rust-analyzer/assets/20878432/f134a4c9-e539-4635-97ac-506790893869 )
2023-11-20 17:37:59 +00:00
Laurențiu Nicola
cb8434e594
Bump either
2023-11-15 13:07:36 +02:00
Laurențiu Nicola
f53368dd3f
Bump tracing
2023-11-15 13:00:32 +02:00
Laurențiu Nicola
f66df10f87
Bump itertools
2023-11-15 12:53:56 +02:00
Laurențiu Nicola
6b53c09ef5
Merge branch 'master' into sync-from-rust
2023-11-15 09:46:27 +02:00
Laurențiu Nicola
610eafe009
Merge commit '76633199f4316b9c659d4ec0c102774d693cd940' into sync-from-rust
2023-11-15 09:45:17 +02:00
Lukas Wirth
d5faad1dae
Fix inlay-hint tests being invalidated by minicore chanes
2023-11-14 18:53:48 +01:00
Laurențiu Nicola
b6951defa6
Add missing rustc_private features
2023-11-13 21:38:57 +02:00
Michael Schmidt
67058605d8
FIxed typo in highlight_related.rs
2023-11-13 13:13:39 +01:00
Laurențiu Nicola
cace36cade
Make Expand macro command title more explicit
2023-11-12 11:43:46 +02:00
bors
5afaf680b8
Auto merge of #15864 - Young-Flash:find_self, r=lnicola
...
fix: find `Self` reference
took a lot of time to debug to find the problem, here should compare the actual `Adt` type
close https://github.com/rust-lang/rust-analyzer/issues/12693
2023-11-10 13:13:14 +00:00
Young-Flash
e0276dc5dd
fix: find Self
reference
2023-11-10 19:54:43 +08:00
YangzeLuo
41bcd542e2
feat: preview adt field when hover
2023-11-08 21:45:32 +08:00
Laurențiu Nicola
d1d111d09e
Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-ra
2023-11-08 08:15:03 +02:00
Laurențiu Nicola
19bf0da9d7
Fix docs path for derive macros
2023-11-04 13:33:19 +02:00
Lukas Wirth
40acc5250f
Update rustc_abi dependency
2023-10-15 18:57:40 +02:00
cui fliter
58239f2990
Remove repetitive words
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-05 19:40:41 +08:00
Lukas Wirth
fe398163b6
Recognize custom main function as binary entrypoint for runnables
2023-10-04 12:07:41 +02:00
DaniPopes
53f5c1c13f
internal: re-generate lints.rs
2023-09-29 14:20:17 +02:00
bors
972a19f4cb
Auto merge of #15659 - HKalbasi:unused-var, r=HKalbasi
...
Add `unused_variables` native diagnostic
2023-09-25 06:38:14 +00:00
DaniPopes
588c7d9182
minor: hover_simple refactor
2023-09-24 22:47:29 +02:00
hkalbasi
ab52ba2de7
Fix unused_variables in tests
2023-09-24 23:45:36 +03:30
Tom Alexander
91b012f91d
Documentation: Add parenthesis to the list of on-typing assists.
2023-09-21 14:58:24 -04:00
Laurențiu Nicola
bcfc997eac
Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-ra
2023-09-18 12:33:49 +03:00
bors
089ae47ebe
Auto merge of #15606 - Veykril:annotation-above-item-fi, r=Veykril
...
fix: Fix lens location "above_whole_item" breaking lenses
Fixes https://github.com/rust-lang/rust-analyzer/issues/15602
2023-09-13 20:02:06 +00:00
Lukas Wirth
712e67cf11
fix: Fix lens location "above_whole_item" breaking lenses
2023-09-13 22:01:04 +02:00
Ali Bektas
6dc7fa9423
v3
2023-09-10 23:19:58 +02:00
Ali Bektas
43edb51b21
Generalize disallowing of definition renaming
2023-09-10 23:19:58 +02:00