riverbl
3c378b9c70
Add inlay hint for exclusive ranges
...
Adds an inlay hint containing a '<' character to exclusive range expressions and patterns that specify an upper bound.
2024-01-07 09:33:56 +00:00
Johann Hemmann
61b552124a
Move check_expect and check_expect_clear_loc to inlayhints::chaining
2024-01-04 17:32:16 +01:00
Johann Hemmann
594e0a5de6
Only compare range and label
2024-01-04 17:29:20 +01:00
Kirill Bulatov
8ae42b55e7
Search for parent blocks and items when resolving inlay hints
2023-12-11 15:16:55 +02:00
Kirill Bulatov
be6d34b810
Query for nearest parent block around the hint to resolve
...
This way, parameter hints will be found for resolution
2023-12-11 14:53:51 +02: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
hkalbasi
4d55cac466
Initial support for implicit drop inlay hint
2023-12-01 16:16:46 +03:30
Lukas Wirth
d5faad1dae
Fix inlay-hint tests being invalidated by minicore chanes
2023-11-14 18:53:48 +01:00
Kirill Bulatov
7f450da39e
Omit hint resolve data better
...
Omit sending inlay hint resolve data if inlay has no properties that
client resolve capabilities support.
2023-09-02 23:56:48 +03:00
Kirill Bulatov
7b3dba5d77
Provide resolve data only when it can actually be resolved
2023-09-02 22:14:08 +03:00
Kirill Bulatov
10464c7c42
Simplify InlayFieldsToResolve handling
2023-09-02 18:28:36 +03:00
Kirill Bulatov
e07fbabcfe
Resolve inlay hint data
...
Skip every propery set in inlay hint client resolve capabilities,
reducing overall json footprint.
2023-09-02 18:28:35 +03:00
Lukas Wirth
730286b523
Restructure InlayHint, no longer derive properties from its kind
2023-05-13 10:42:26 +02:00
Lukas Wirth
8081a654da
feat: Closure capture inlay hints
2023-05-05 13:38:22 +02:00
Ryo Yoshida
c978d4bf0c
Implement text edits for inlay hints
2023-04-12 19:03:57 +09:00
Ryo Yoshida
fcbc250723
Add field for text edits to InlayHint
2023-04-12 19:03:55 +09:00
hkalbasi
59b6f2d9f2
Compute closure captures
2023-04-10 23:04:34 +03:30
Lukas Wirth
2b4a5374ee
Properly use location links for type hints of impl Future and its assoc type
2023-02-07 22:42:03 +01:00
Lukas Wirth
14f19c73e9
fix: Don't render fieldless discriminant inlay hints for datacarrying enums
2023-02-01 11:38:39 +01:00
Lukas Wirth
3a95864df5
Unconditionally enable location links in inlay hints again
2023-01-16 16:04:38 +01:00
Lukas Wirth
27ba598dfe
Make inlay hint location links work for more types
2023-01-14 13:30:56 +01:00
Lukas Wirth
f2444b2a40
Remove unnecessary Hint suffix on InlayKind variants
2023-01-14 13:08:45 +01:00
Lukas Wirth
60075a6625
Remove hover inlay tooltips, replace them with location links
2023-01-14 12:19:29 +01:00
Lukas Wirth
aafb0f1f8d
Use smallvec for inlay-hint parts
2023-01-13 15:03:37 +01:00
Maybe Waffle
12b7f9f7bf
Add an option to minimize parentheses for adjustment hints
2023-01-09 13:35:17 +00:00
Maybe Waffle
b89c4f0a05
Implement postfix adjustment hints
...
I'd say "First stab at implementing..." but I've been working on this
for a month already lol
2023-01-09 13:27:59 +00:00
bors
f77b68a3cb
Auto merge of #13860 - danieleades:clippy, r=lnicola
...
fix a bunch of clippy lints
fixes a bunch of clippy lints for fun and profit
i'm aware of this repo's position on clippy. The changes are split into separate commits so they can be reviewed separately
2023-01-08 17:29:57 +00:00
Lukas Wirth
506895fa2f
Fix spelling mistake
2023-01-02 23:16:26 +01:00
Daniel Eades
ed128872eb
remove needless borrows
2023-01-02 14:52:32 +00:00
bors
17cc78f169
Auto merge of #13832 - Veykril:discriminant-hints, r=Veykril
...
Enum variant discriminants hints

2023-01-02 13:20:33 +00:00
Yuri Astrakhan
e16c76e3c3
Inline all format arguments where possible
...
This makes code more readale and concise,
moving all format arguments like `format!("{}", foo)`
into the more compact `format!("{foo}")` form.
The change was automatically created with, so there are far less change
of an accidental typo.
```
cargo clippy --fix -- -A clippy::all -W clippy::uninlined_format_args
```
2022-12-24 14:36:10 -05:00
Lukas Wirth
df8fc78ece
Enum variant discriminants hints
2022-12-23 11:37:42 +01:00
Yuri Astrakhan
e341e996f7
Clippy-fix explicit auto-deref
...
Seems like these can be safely fixed. With one, I was particularly
surprised -- `Some(pats) => &**pats,` in body.rs?
```
cargo clippy --fix -- -A clippy::all -D clippy::explicit_auto_deref
```
2022-12-23 02:52:14 -05:00
Maybe Waffle
ef4c8167e8
Pass FamousDefs
around in inlay hints
2022-12-22 11:00:25 +00:00
bors
eb3963b22e
Auto merge of #13817 - WaffleLapkin:hide_adjustment_hints_outside_of_unsafe, r=Veykril
...
feat: Add an option to hide adjustment hints outside of `unsafe` blocks and functions
As the title suggests: this PR adds an option (namely `rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe`) that allows to hide adjustment hints outside of `unsafe` blocks and functions:

Requested by `@BoxyUwU` <3
2022-12-22 09:37:00 +00:00
Maybe Waffle
3bfe7040e8
Add an option to hide adjustment hints outside of unsafe blocks
2022-12-21 19:20:42 +00:00
hkalbasi
e1aa73ef40
Disable inlay hint location links on vscode < 1.76
2022-12-21 18:54:49 +03:30
hkalbasi
801a2231bf
Implement location link for type inlay hints
2022-12-21 02:18:02 +03:30
Maybe Waffle
1c8bcf0d4e
Move inlay hints tests into implementation modules
2022-12-20 13:05:18 +00:00
Maybe Waffle
191cfba9d2
Split inlay hints into modules
2022-12-20 12:58:57 +00:00
Lukas Wirth
ba3e3282da
Deduplicate inserted parentheses in binding mode hints
2022-12-16 21:17:10 +01:00
Lukas Wirth
b6c2bb21ab
Add parentheses for binding mode hints when they attach to an Or-pattern
2022-12-16 20:52:31 +01:00
Maybe Waffle
7c9a85bc43
fix: Don't show duplicated adjustment hints for blocks, ifs and matches
2022-12-09 18:45:01 +00:00
bors
0aa0da9dda
Auto merge of #13572 - Veykril:cancellable, r=Veykril
...
internal: Use Cancellable in favor of Result for clarity
2022-11-07 16:22:33 +00:00
Lukas Wirth
fa70b0a86e
internal: Use Cancellable in favor of Result for clarity
2022-11-07 17:21:37 +01:00
Lukas Wirth
ee2dd934ca
Don't trigger adjustment hints in all inlay hint tests
2022-11-07 12:49:52 +01:00
Lukas Wirth
d841ad116a
Fix up adjustment hints configurations
2022-11-04 22:59:07 +01:00
Lukas Wirth
95d20fccd7
Add adjustment hint tests
2022-11-04 22:40:06 +01:00
Lukas Wirth
c98fc537e6
Generalize reborrow hints as adjustment hints
2022-11-04 21:53:23 +01:00
Ryo Yoshida
6d8903ae5f
fix: infer for-loop item type with IntoIterator
and Iterator
2022-09-29 19:48:08 +09:00