1007 Commits

Author SHA1 Message Date
Laurențiu Nicola
3c394c61b8
Merge pull request #19265 from Shourya742/2025-03-01-add-dangling-dyn-diagnostic
feat: Add diagnostic for dangling dyn and impl
2025-03-05 05:58:31 +00:00
bit-aloo
af959f9031
Add dangling impl
- Adds dangling impl diagnostics
- Rename validation test from dangling_impl to dangling_iml_ref
2025-03-03 15:58:33 +05:30
bit-aloo
0b97ae26bf
add diagnostic for dangling impl 2025-03-02 19:42:42 +05:30
bit-aloo
afe6e5ba0f
add diagnostic for dangling dyn 2025-03-02 19:41:39 +05:30
Lukas Wirth
1ce1f087da
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
internal: Migrate `convert_bool_then` to `SyntaxEditor`
2025-03-02 07:21:04 +00:00
Lukas Wirth
76567ee28d
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Remove syntax editing from parenthesis computation
2025-03-01 17:46:07 +00:00
Lukas Wirth
570c6adcd3 Remove syntax editing from parenthesis computation 2025-03-01 18:32:04 +01:00
Lukas Wirth
8f319240b4 Cleanup string handling in syntax highlighting 2025-03-01 17:44:29 +01:00
Shoyu Vanilla
37822d5917 Migrate convert_bool_then to SyntaxEditor
Update assist docs
2025-03-01 13:12:15 +09:00
Lukas Wirth
e92dc3fd80 Have inline_local_variable use precedence calculation for parentheses 2025-02-28 11:03:33 +01:00
Lukas Wirth
2c4ef382d6
Merge pull request #19249 from Veykril/push-noosrywrsuvn
Fix prefix adjustment hints unnecessarily introducing parens
2025-02-28 09:33:36 +00:00
Lukas Wirth
f655062cb0 Fix prefix adjustment hints unnecessarily introducing parens 2025-02-28 10:18:10 +01:00
BenjaminBrienen
b19ef6b046 fix doc tests 2025-02-27 14:58:46 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Giga Bowser
f155aef64d internal: Migrate remove_unused_param assist to SyntaxEditor 2025-02-25 11:52:13 -05:00
Giga Bowser
93c9f06870 fix: Properly handle removals in SyntaxEditor 2025-02-25 11:52:13 -05:00
Giga Bowser
b4f2d62952 internal: Improve reporting of intersecting changes 2025-02-25 11:46:45 -05:00
Shoyu Vanilla
a0b9931832 Add take() method to SyntaxEditor 2025-02-24 22:42:57 +09:00
Shoyu Vanilla
f06f1b81bb Migrate some leftovers in add_missing_match_arms 2025-02-24 22:41:52 +09:00
Shoyu Vanilla
8b947d7a12 internal: Remove mutable syntax tree usages from add_missing_match_arms assist 2025-02-14 02:36:05 +09:00
Lukas Wirth
7fd6f72007
Merge pull request #19070 from Veykril/push-wpqzmznymtrn
Remove mutable syntax tree shenanigans from adjustment hints
2025-01-29 13:58:18 +00:00
Lukas Wirth
f61d31b144 Remove mutable syntax tree shenanigans from adjustment hints 2025-01-29 14:42:37 +01:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
Shoyu Vanilla
7de0b2e75a feat: Implement default-field-values 2025-01-27 19:38:35 +09:00
Lukas Wirth
ae74cc3b88 Skip redundant path search in resolve_completion_edits 2025-01-25 13:03:01 +01:00
Wilfred Hughes
deda58e8f1 manual: Convert to mdbook
Split manual.adoc into markdown files, one for each chapter.

For the parts of the manual that are generated from source code doc
comments, update the comments to use markdown syntax and update the
code generators to write to `generated.md` files.

For the weekly release, stop copying the .adoc files to the
`rust-analyzer/rust-analyzer.github.io` at release time. Instead,
we'll sync the manual hourly from this repository.

See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226
for the sync. This PR should be merged first, and that PR needs to be
merged before the next weekly release.

This change is based on #15795, but rebased and updated. I've also
manually checked each page for markdown syntax issues and fixed any I
encountered.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
2025-01-24 13:23:22 -08:00
Lukas Wirth
bf669dab84 Re-implement rust string highlighting via tool attribute 2025-01-10 13:49:35 +01:00
Giga Bowser
a5a79f5957 internal: Migrate unwrap_return_type assist to use SyntaxEditor
Also changes `make::expr_empty_block()` to return `ast::BlockExpr` instead of `ast::Expr`
2025-01-08 18:12:06 -06:00
Giga Bowser
651b43e551 internal: Migrate wrap_return_type assist to use SyntaxEditor 2025-01-08 15:19:10 -06:00
Giga Bowser
796041acce internal: Add some pattern constructors to SyntaxFactory 2025-01-06 15:58:39 -06:00
Giga Bowser
ce2398fee8 internal: Add some expr constructors to SyntaxFactory 2025-01-06 15:58:39 -06:00
Giga Bowser
f5ff966dea internal: Add some path constructors to SyntaxFactory 2025-01-06 15:58:39 -06:00
Giga Bowser
551f1d00dd internal: make::expr_match should return ast::MatchExpr 2025-01-06 15:58:39 -06:00
Giga Bowser
32ff06d51c internal: Generally improve make::match_arm
`make::match_arm` should take a single `ast::Pat`, and callers can handle creating an `ast::OrPat` if need be. It should also take a proper `ast::MatchGuard`, instead of making one itself.
2025-01-06 15:58:39 -06:00
Giga Bowser
905e1e1fc0 internal: move make::expr_unit to make::ext::expr_unit
`expr_unit` is just a shortcut for a common expression, so it belongs in `make::ext`
2025-01-06 15:58:39 -06:00
Giga Bowser
f388482119 internal: make::expr_tuple should return ast::TupleExpr 2025-01-06 15:32:08 -06:00
Giga Bowser
c549be9ab6 internal: make::expr_if should return ast::IfExpr 2025-01-06 15:32:08 -06:00
Giga Bowser
913d197a04 internal: make::expr_prefix should return ast::PrefixExpr 2025-01-06 15:32:08 -06:00
Giga Bowser
159731022f internal: Generalize make::expr_from_text to types which implement Into<ast::Expr>
This will help with specializing the various `make::expr_*` functions later
2025-01-06 15:32:08 -06:00
Lukas Wirth
4b6007115a minor: New clippy lints 2025-01-06 17:57:17 +01:00
Chayim Refael Friedman
ce323627c5 Support the new CoercePointee derive 2025-01-04 18:35:53 +02:00
Chayim Refael Friedman
791a63255b Move some more AST makers to the quote macro
And implement addons as necessary.

There are many more makers to be moved, and I'm not completely satisfied with this (due to the ease of making a mistake in the AST structure, and slightly less but also because of the need to remember whitespaces), but this is already enough to see how this will look like.
2024-12-30 05:46:06 +02:00
Chayim Refael Friedman
abd7263179 Create a quote!-like API for crafting AST nodes
Instead of messing with textual `make`.

And port one `make` helper to it, for the sake of testing.
2024-12-30 04:54:39 +02:00
Chayim Refael Friedman
737500137f Generate a method for static retrieval of the SyntaxKind of a node, where possible
This will help for the quote macro for `ast::make`.
2024-12-30 03:13:17 +02:00
Giga Bowser
2b6e7ce896 internal: Standardize how we take iterator parameters in SyntaxFactory 2024-12-20 12:06:27 -05:00
Arthur Baars
cb2829eaa7 Fix AsmOption rule in rust.ungram 2024-12-18 14:56:00 +01:00
Giga Bowser
135e71fcb3 minor: Add item_static constructor to SyntaxFactory 2024-12-11 10:32:32 -05:00
Giga Bowser
27a2f9d594 minor: Add item_const constructor to SyntaxFactory 2024-12-11 09:52:03 -05:00
Lukas Wirth
41f3319173
Merge pull request #18458 from Giga-Bowser/master
feat: Add diagnostic fix to remove unnecessary wrapper in type mismatch
2024-12-11 07:09:15 +00:00
Giga Bowser
547f75a2ce minor: Migrate generate_enum_variant to SyntaxEditor 2024-12-10 13:11:33 -05:00