Lukas Wirth
3741b863a6
Do not render meta info when hovering usages
2024-10-29 15:34:17 +01:00
Lukas Wirth
20ac30fb75
Invert token iteration order in macro mapping
2024-10-27 11:32:12 +01:00
Lukas Wirth
ca3699bd50
Factor out token ranking
2024-10-25 12:03:12 +02:00
Lukas Wirth
f854e19ef0
Fix sorting order for tokens in hover
2024-08-22 18:08:36 +02:00
Lukas Wirth
46feeb3f05
Consider interleaving hover kinds
2024-08-22 17:29:32 +02:00
Lukas Wirth
01fc1e57d2
Sort hover results by relevance
2024-08-22 17:01:51 +02:00
Lukas Wirth
354ab7a9e8
Rename macro descension functions
2024-08-22 16:24:01 +02:00
Lukas Wirth
495118015e
Remove DescendPreference::SameKind
2024-08-22 16:00:57 +02:00
Lukas Wirth
ce8f32022b
Drop MacroInputKind
2024-08-22 12:39:53 +02:00
Lukas Wirth
f979667fb5
Remove DescendPreference::SameText
2024-08-22 12:34:20 +02:00
Chayim Refael Friedman
9d3368f2c2
Properly account for editions in names
...
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896 , but the FIXMEs were fixed here).
It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.
The rules of thumb are:
- If we show the identifier to the user, its rawness should be determined
by the edition of the edited crate. This is nice for IDE features,
but really important for changes we insert to the source code.
- For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
tests when an edition becomes stable, to avoid churn).
- For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03:00
Lukas Wirth
f90bdfc13d
internal: Properly check the edition for edition dependent syntax kinds
2024-08-15 15:57:47 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
roife
4a4b13cbda
fix: incorrect formatting of hover actions
2024-06-06 21:07:59 +08:00
Lukas Wirth
a39c0493a1
Render literal escaping errors in hovers
2024-05-13 12:51:57 +02:00
Lukas Wirth
253929f6ae
Fix literal hovers being confusing and wrong for floats
2024-05-13 12:26:45 +02:00
bors
65eda41e65
Auto merge of #17021 - roife:add-hover-limits-for-adts, r=Veykril
...
Support hovering limits for adts
Fix #17009
1. Currently, r-a supports limiting the number of struct fields displayed when hovering. This PR extends it to support enum variants and union fields. Since the display of these three (ADTs) is similar, this PR extends 'hover_show_structFields' to 'hover_show_adtFieldsOrVariants'.
2. This PR also resolved the problem that the layout of ADT was not restricted by display limitations when hovering on the Self type.
3. Additionally, this PR changes the default value of display limitations to `10` (instead of the original `null`), which helps users discover this feature.
2024-04-25 07:23:27 +00:00
roife
43576989a1
Add hovering limitations support for variants
2024-04-20 09:14:00 +08:00
roife
e0e28ec856
fix: add a separate setting for enum variants
2024-04-19 21:45:56 +08:00
Lukas Wirth
6bfdd38c69
Render matched macro arm on hover of macro calls
2024-04-18 10:51:58 +02:00
roife
21da6c6164
Add config hover_show_adtFieldsOrVariants to handle hovering limitation for ADTs
2024-04-16 16:26:23 +08:00
Young-Flash
1c85234bcd
limit struct field hover display nums
2024-03-25 19:55:19 +08:00
Lukas Wirth
b20e467373
internal: Adjust a few things for trait assoc item hovers
2024-03-05 11:06:36 +01:00
Young-Flash
dba67b46a1
update for review
2024-03-02 10:01:04 +08:00
Young-Flash
2e87f31fe9
add HoverDisplayConfig
2024-02-22 17:37:40 +08:00
Young-Flash
35ec5955eb
add config item for hover display
2024-02-21 11:08:45 +08:00
Lukas Wirth
a822291a02
Infallible definition hovers
2024-02-19 18:16:02 +01:00
Johann Hemmann
04ccef80cb
field_reassign_with_default
2024-01-31 19:06:18 +01:00
Lukas Wirth
0a75a8c061
Notable traits for type info hovers
2024-01-16 20:15:31 +01:00
Lukas Wirth
ffeaee84af
Goto type actions for notable trait hovers
2024-01-16 19:59:55 +01:00
Lukas Wirth
384488c157
feat: Hover for literals showing additional value information
2024-01-16 14:28:47 +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
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
DaniPopes
588c7d9182
minor: hover_simple refactor
2023-09-24 22:47:29 +02:00
Lukas Wirth
53b292478d
internal: Add offset param to token descending API
2023-08-16 10:07:18 +02:00
Lukas Wirth
bcff166b3a
Add ExternCrateDecl to HIR
2023-08-02 11:52:55 +02:00
Lukas Wirth
3c862507b9
Add render configs for memory layout hovers
2023-05-30 18:36:06 +02:00
Lukas Wirth
c7ef6c25b7
internal: Replace Display impl for Name
2023-05-24 20:55:12 +02:00
Yury Ivanou
8e1ba7fdab
Fix memory layout config not working for closures
2023-05-07 19:10:01 +03:00
Yury Ivanou
4ed0fa8414
Add config for disabling hover memory layout data
2023-05-07 18:21:07 +03:00
Jake Heinz
3132a9e7fc
fix: ide: exclude sized in go-to actions
2023-05-02 08:19:59 +00:00
hkalbasi
6312fbf521
MIR episode 4
2023-05-01 23:23:10 +03:30
hkalbasi
5df545b3f0
Add hover for closure
2023-04-30 14:31:43 +03:30
hkalbasi
cd67589f63
beginning of MIR
2023-02-27 23:45:54 +03:30
Lukas Wirth
e550e553e0
fix: Bring back hovering call parens for return type info
2023-02-15 18:58:59 +01:00
Lukas Wirth
4685b97f74
Remove hover fallback in favor of ranged hover
2023-01-20 21:52:05 +01:00
Lukas Wirth
a542bd46bf
Split out some hover functions
2023-01-20 16:30:08 +01:00
Lukas Wirth
c5b1e3f2ae
Fix markdown removal in hover handling whitespace weirdly
2023-01-20 14:29:12 +01:00
Maybe Waffle
a7787533af
Use the fact that Either
: AstNode
2023-01-14 15:20:32 +00:00