about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-12-06feat: Migrate `flip_binexpr` assist to `SyntaxEditor`Giga Bowser-26/+29
2024-12-06minor: Add `expr_bin` constructor to `SyntaxFactory`Giga Bowser-0/+17
2024-12-06minor: Add `token` constructor to `SyntaxFactory`Giga Bowser-1/+5
2024-12-06fix: Don't produce `ChangedAncestor` for `SyntaxToken`sGiga Bowser-10/+52
2024-12-06fix: Properly determine `SyntaxEditor` replacement intersectionGiga Bowser-1/+1
Bordering replacements should not be considered intersecting
2024-12-06Add typing handler for param list pipeLukas Wirth-29/+69
2024-12-06Merge pull request #18627 from Veykril/push-tzvnrnytrksrLukas Wirth-2/+25
Improve heuristics for on typing semicolon insertion
2024-12-06Improve heuristics for on typing semicolon insertionLukas Wirth-2/+25
2024-12-06Merge pull request #18551 from ShoyuVanilla/migrate-turbofish-assistLukas Wirth-24/+77
Migrate `add_turbo_fish` to `SyntaxEditor`
2024-12-06Merge pull request #18563 from alibektas/workspace_key_high_precedenceLukas Wirth-3/+1
minor: run `FlycheckHandle::restart_workspace` when `check_workspace` true
2024-12-06Merge pull request #18594 from ChayimFriedman2/async-closuresLukas Wirth-68/+291
feat: Support `AsyncFnX` traits
2024-12-06Merge pull request #18474 from Veykril/push-nvtxykxkwnvsLukas Wirth-130/+199
Make bracket typing handler work on more things
2024-12-06Merge pull request #18610 from Veykril/push-kynytqktmnxqLukas Wirth-2/+157
Add implict unsafety inlay hints for extern blocks
2024-12-06Add implict unsafety inlay hints for extern blocksLukas Wirth-2/+157
2024-12-06Make bracket typing handler work on more thingsLukas Wirth-130/+199
2024-12-06Merge pull request #18625 from Veykril/push-npnxwpxuzlqzLukas Wirth-4/+71
fix: Fix parser getting stuck for bad asm expressions
2024-12-06fix: Fix parser getting stuck for bad asm expressionsLukas Wirth-4/+71
2024-12-05Merge pull request #18622 from Veykril/push-wlzptrukvyupLukas Wirth-3/+68
fix: Fix parsing of dyn T in generic arg on 2015 edition
2024-12-05fix: Fix parsing of dyn T in generic arg on 2015 editionLukas Wirth-3/+68
2024-12-05Merge pull request #18538 from tareknaser/syntax_factory_sort_itemsDavid Barsky-23/+21
Migrate `sort_items` Assist to Use `SyntaxFactory`
2024-12-05Merge pull request #18483 from tareknaser/syntax_factory_introduce_named_genericDavid Barsky-27/+123
Migrate `introduce_named_generic` Assist to Use `SyntaxFactory`
2024-12-05fix: Resolve generic parameters within use capturesLukas Wirth-2/+90
2024-12-05Merge pull request #18620 from Veykril/push-pyulxnouvxkqLukas Wirth-85/+125
fix: Parse lifetime bounds in lifetime param into TypeBoundList
2024-12-05Parse lifetime bounds in lifetime param into TypeBoundListLukas Wirth-85/+125
This mainly aids in error recovery but also makes it a bit easier to handle lifetime resolution. While doing so it also came apparent that we were not actually lowering lifetime outlives relationships within lifetime parameter declaration bounds, so this fixes that.
2024-12-05Merge pull request #18619 from ShoyuVanilla/issue-18613Lukas Wirth-1/+55
fix: Panic when displaying generic params with defaults
2024-12-06fix: Panic when displaying generic params with defaultsShoyu Vanilla-1/+55
2024-12-05Merge pull request #18618 from Veykril/push-ysklqzomkyvpLukas Wirth-133/+351
fix: Fix parsing of integer/keyword name refs in various places
2024-12-05fix: Fix parsing of integer/keyword name refs in various placesLukas Wirth-133/+351
2024-12-05fix: rename `syntax_editor_add_generic_param` to `add_generic_param`Tarek-2/+2
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-05Merge pull request #18616 from Veykril/push-pkumxswtxspoLukas Wirth-3/+3
fix: Disable `<` typing handler again
2024-12-05Disable `<` typing handler againLukas Wirth-3/+3
2024-12-04Merge pull request #18611 from ChayimFriedman2/proc-macro-warnLukas Wirth-0/+13
fix: Do not report warnings from proc macros, ever
2024-12-04Rename `core_pattern_type` and `core_pattern_types` lib feature gates to ↵Oli Scherer-11/+2
`pattern_type_macro` That's what the gates are actually gating, and the single char difference in naming was not helpful either
2024-12-04fix: update `introduce_named_generic` to use `type_param` directlyTarek-3/+2
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04Do not report warnings from proc macros, everChayim Refael Friedman-0/+13
2024-12-04refactor: move editing for ast using `SyntaxEditor` to a separate fileTarek-74/+74
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `introduce_named_generic` assistTarek-42/+31
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: correct token type for closing angle bracketTarek-1/+1
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `syntax_editor_add_generic_param`Tarek-19/+41
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `syntax_editor_add_generic_param` to handle adding new generic ↵Tarek-47/+43
parameters Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor syntax_editor_add_generic_param to handle new generic parametersTarek-12/+11
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: implement `syntax_editor_create_generic_param_list`Tarek-5/+35
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04define syntax_editor_add_generic_paramTarek-7/+34
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: remove make_mut from introduce_named_generic assistTarek-2/+0
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04feat: migrate introduce_named_generic assist to use SyntaxFactoryTarek-5/+41
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04Complete diagnostics in ty lowering groundworkChayim Refael Friedman-103/+621
Implement diagnostics in all places left: generics (predicates, defaults, const params' types), fields, and type aliases. Unfortunately this results in a 20mb addition in `analysis-stats .` due to many type methods returning an addition diagnostics result now (even if it's `None` in most cases). I'm not sure if this can be improved. An alternative strategy that can prevent the memory usage growth is to never produce diagnostics in hir-ty methods. Instead, lower all types in the hir crate when computing diagnostics from scratch (with diagnostics this time). But this has two serious disadvantages: 1. This can cause code duplication (although it can probably be not that bad, it will still mean a lot more code). 2. I believe we eventually want to compute diagnostics for the *entire* workspace (either on-type or on-save or something alike), so users can know when they have diagnostics even in inactive files. Choosing this approach will mean we lose all precomputed salsa queries. For one file this is fine, for the whole workspace this will be very slow.
2024-12-04Lay the foundation for diagnostics in ty lowering, and implement a first ↵Chayim Refael Friedman-80/+811
diagnostic The diagnostic implemented is a simple one (E0109). It serves as a test for the new foundation. This commit only implements diagnostics for type in bodies and body-carrying signatures; the next commit will include diagnostics in the rest of the things. Also fix one weird bug that was detected when implementing this that caused `Fn::(A, B) -> C` (which is a valid, if bizarre, alternative syntax to `Fn(A, B) -> C` to lower incorrectly. And also fix a maybe-bug where parentheses were sneaked into a code string needlessly; this was not detected until now because the parentheses were removed (by the make-AST family API), but with a change in this commit they are now inserted. So fix that too.
2024-12-04Store some hir_def Paths in the type ref source mapsChayim Refael Friedman-77/+144
Most paths are types and therefore already are in the source map, but the trait in impl trait and in bounds are not. We do this by storing them basically as `TypeRef`s. For convenience, I created a wrapper around `TypeRefId` called `PathId` that always stores a path, and implemented indexing from the types map to it. Fortunately, this change impacts memory usage negligibly (adds 2mb to `analysis-stats .`, but that could be just fluff). Probably because there aren't that many trait bounds and impl traits, and this also shrinks `TypeBound` by 8 bytes. I also added an accessor to `TypesSourceMap` to get the source code, which will be needed for diagnostics.
2024-12-04Fix parsing of parenthesized type args and RTNLukas Wirth-698/+1020
2024-12-04refactor: change target parameter to a reference in add_rewrite methodTarek-12/+6
Signed-off-by: Tarek <tareknaser360@gmail.com>