about summary refs log tree commit diff
path: root/crates
AgeCommit message (Collapse)AuthorLines
2022-07-14Auto merge of #12735 - feniljain:fix-completions, r=feniljainbors-112/+140
fix(completion): `super::` completion at crate root and module depth aware - should close #12439 - Suggest super according to the depth in tree
2022-07-14fix(completion): `super::` completion at crate root and module depthfeniljain-112/+140
aware
2022-07-13Make search for applicable generics more preciseDorian Scheidt-18/+49
2022-07-13fix: Support generics in extract_function assistDorian Scheidt-7/+436
This change attempts to resolve issue #7636: Extract into Function does not create a generic function with constraints when extracting generic code. In `FunctionBody::analyze_container`, we now traverse the `ancestors` in search of `AnyHasGenericParams`, and attach any `GenericParamList`s and `WhereClause`s we find to the `ContainerInfo`. Later, in `format_function`, we collect all the `GenericParam`s and `WherePred`s from the container, and filter them to keep only types matching `TypeParam`s used within the newly extracted function body or param list. We can then include the new `GenericParamList` and `WhereClause` in the new function definition. This change only impacts `TypeParam`s. `LifetimeParam`s and `ConstParam`s are out of scope for this change.
2022-07-13add testssoruh-0/+177
2022-07-13Auto merge of #12696 - hi-rustin:rustin-patch-fix, r=Veykrilbors-0/+47
Add str_ref_to_string fix close https://github.com/rust-lang/rust-analyzer/issues/11383 When type mismatch is `&str` -> `String` try to fix it.
2022-07-13Auto merge of #12742 - TonalidadeHidrica:fix-obsolete-config-keys, r=Veykrilbors-10/+10
Fix obsolete config keys The config keys were drastically reorganized by #12010, but the docs don't reflect the updates, causing inconsistency and confusion. I checked for such obsolete configuration keys and updated to the new one. For reproducibility, I attach a small shell script that I used to examine the old keys. Now the script only detects `cargoExtraArgs` and `overrideCargo`, which originates from other type definition in the code but not from the configuration. <details><summary>script</summary> ```bash echo "allowMergingIntoGlobImports exprFillDefault importEnforceGranularity importGranularity importMergeBehavior importMergeBehaviour importGroup importPrefix warmup loadOutDirsFromCheck runBuildScripts runBuildScriptsCommand useRustcWrapperForBuildScripts enableExperimental procAttrMacros breakPoints exitPoints yieldPoints linksInHover linksInHover gotoTypeDef chainingHints closureReturnTypeHints hideNamedConstructorHints parameterHints reborrowHints typeHints lruCapacity cargoExtraArgs overrideCargo rustcSource enableRangeFormatting assist\.allowMergingIntoGlobImports assist\.exprFillDefault assist\.importEnforceGranularity assist\.importGranularity assist\.importMergeBehavior assist\.importMergeBehaviour assist\.importGroup assist\.importPrefix primeCaches\.enable cache\.warmup cargo\.loadOutDirsFromCheck cargo\.runBuildScripts cargo\.runBuildScriptsCommand cargo\.useRustcWrapperForBuildScripts completion\.snippets diagnostics\.enableExperimental experimental\.procAttrMacros highlighting\.strings highlightRelated\.breakPoints highlightRelated\.exitPoints highlightRelated\.yieldPoints highlightRelated\.references hover\.documentation hover\.linksInHover hoverActions\.linksInHover hoverActions\.debug hoverActions\.enable hoverActions\.gotoTypeDef hoverActions\.implementations hoverActions\.references hoverActions\.run inlayHints\.chainingHints inlayHints\.closureReturnTypeHints inlayHints\.hideNamedConstructorHints inlayHints\.parameterHints inlayHints\.reborrowHints inlayHints\.typeHints lruCapacity runnables\.cargoExtraArgs runnables\.overrideCargo rustcSource rustfmt\.enableRangeFormatting allFeatures addCallArgumentSnippets addCallParenthesis callInfo\.full cargo\.allFeatures checkOnSave\.allFeatures completion\.addCallArgumentSnippets completion\.addCallParenthesis" | while read -r pattern do rg '\b'$pattern'\b([^.]|$)' . -g "!crates/rust-analyzer/src/config/patch_old_style.rs" -g "!editors/code/src/config.ts" -g "!a.sh" --no-heading --color=always --line-number done exit excluded # debug # enable # run # implementations # references # documentation # references # snippets # strings # full ``` </details>
2022-07-12Update 1.63 proc macro ABI to match rustcJonas Schievink-160/+264
2022-07-11Implement `ignore` and `index` metavar expressionJonas Schievink-5/+108
2022-07-11Fix typoshi-rustin-2/+2
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-11Fix obsolete `completion.snippets` configTonalidadeHidrica-2/+2
2022-07-11Fix obsolete `enableRangeFormatting` configTonalidadeHidrica-1/+1
2022-07-11Fix `rustcSource` -> `rustc_source`TonalidadeHidrica-2/+2
This only fixes the comments in the internal source, which is not mandatory at all
2022-07-11Fix config keys regarding imports in docsTonalidadeHidrica-5/+5
2022-07-10fix: ignore renames for crate rootharpsword-0/+33
2022-07-09Fix testhi-rustin-1/+5
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-08fix: Improve suggested names for extracted variablesDorian Scheidt-5/+28
When extracting a field expression, if RA was unable to resolve the type of the field, we would previously fall back to using "var_name" as the variable name. Now, when the `Expr` being extracted matches a `FieldExpr`, we can use the `NameRef`'s ident token as a fallback option. fixes #10035
2022-07-08fix: Extract Function misses locals used in closuresDorian Scheidt-0/+30
This change fixes #12705. In `FunctionBody::analyze`, we need to search any `ClosureExpr`s we encounter for any `NameRef`s, to ensure they aren't missed.
2022-07-08Auto merge of #12719 - davidlattimore:format-args-no-unsafe, r=jonas-schievinkbors-16/+4
Remove unnecessary unsafe from format_args expansion
2022-07-08Auto merge of #12676 - DorianListens:dscheidt/extract-fun-trait-impl, ↵bors-10/+75
r=jonas-schievink fix: Extract function from trait impl This change fixes #10036, "Extract to function assist implements nonexistent trait methods". When we detect that the extraction is coming from within a trait impl, and that a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`, and create a new empty `impl` block for the newly extracted function.
2022-07-08Update remaining GitHub URLsJonas Schievink-52/+52
2022-07-08Remove unnecessary unsafe from format_args expansionDavid Lattimore-16/+4
2022-07-06Auto merge of #12695 - xuhongxu96:fix-12140, r=jonas-schievinkbors-50/+347
Complete type param/associated type in trait generic arg per arg index - Fix #12140 - Also fix tidy check does not work for marks in multiline
2022-07-07fix default type param value positionHongxu Xu-3/+3
2022-07-06Use `SmallVec` to slightly shrink `ModPath` sizeJonas Schievink-3/+5
2022-07-07check arg_idx >= n_params only if arg_idx >= n_required_paramsHongxu Xu-5/+5
2022-07-07Handle generic args per arg indexHongxu Xu-45/+220
Add more test cases for generic args
2022-07-06Show only assoc type args in the correct arg posHongxu Xu-3/+69
2022-07-05Add str_ref_to_string fixhi-rustin-0/+43
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-05Complete associated type only in trait generic argHongxu Xu-63/+119
Fix tidy check does not work for marks in multiline
2022-07-05Fix project root asserthi-rustin-1/+1
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-05fix: Fix unresolved proc macro diagnostics pointing to macro expansionsLukas Wirth-41/+63
2022-07-05Auto merge of #12690 - Veykril:inert-attrs, r=Veykrilbors-174/+319
internal: Update inert attribute list
2022-07-05internal: Update inert attribute listLukas Wirth-174/+319
2022-07-05internal: Record all macro definitions in ItemScopeLukas Wirth-27/+57
2022-07-04Improve documentation for buildScripts.overrideCommand / ↵Florian Diebold-8/+11
checkOnSave.overrideCommand
2022-07-03Auto merge of #12681 - lnicola:bump-deps, r=lnicolabors-91/+96
Bump deps
2022-07-03Bump chalkLaurențiu Nicola-59/+59
2022-07-03Bump objectLaurențiu Nicola-2/+2
2022-07-03Bump tracing-subscriberLaurențiu Nicola-2/+2
2022-07-03Bump cargo_metadataLaurențiu Nicola-7/+12
2022-07-03Bump indexmapLaurențiu Nicola-4/+4
2022-07-03Bump smallvecLaurențiu Nicola-5/+5
2022-07-03Bump eitherLaurențiu Nicola-7/+7
2022-07-03Bump quoteLaurențiu Nicola-1/+1
2022-07-03Bump crossbeam-channelLaurențiu Nicola-4/+4
2022-07-02fix: Extract function from trait implDorian Scheidt-10/+75
This change fixes #10036, "Extract to function assist implements nonexistent trait methods". When we detect that the extraction is coming from within a trait impl, and that a `self` param will be necessary, we adjust which `SyntaxNode` to `insert_after`, and create a new empty `impl` block for the newly extracted function.
2022-07-02fix: Extract Function produces duplicate fn namesDorian Scheidt-2/+70
This change fixes issue #10037, in more or less the most naive fashion possible. We continue to start with the hardcoded default of "fun_name", and now append a counter to the end of it if that name is already in scope. In the future, we can probably apply more heuristics here to wind up with more useful names by default, but for now this resolves the immediate problem.
2022-07-03fix: report type mismatch on identifier in destructuring assignmentsRyo Yoshida-1/+36
2022-07-03fix: infer lhs first on ordinary assignment expressionsRyo Yoshida-2/+66