about summary refs log tree commit diff
path: root/crates/hir
AgeCommit message (Collapse)AuthorLines
2022-07-18Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykrilbors-17/+69
feat: Go to implementation of trait methods try goto where the trait method implies, #4558
2022-07-16Auto merge of #12689 - Veykril:macro-rec, r=Veykrilbors-6/+8
internal: Record all macro definitions in ItemScope Fixes https://github.com/rust-lang/rust-analyzer/issues/12100 Doesn't resolve the shadowing issues though, fixing those is gonna be really tricky I believe unless we can come up with a nice scheme to "order" item tree items (using syntax ranges and file ids would be a pain and also a bad idea since that'll require us to potentially reparse files in collection).
2022-07-16Auto merge of #12766 - Veykril:completion-vis, r=Veykrilbors-1/+25
fix: Don't show qualified path completions for private items Fixes https://github.com/rust-lang/rust-analyzer/issues/12703
2022-07-15fix: Don't show qualified path completions for private itemsLukas Wirth-1/+25
2022-07-13fix: Support generics in extract_function assistDorian Scheidt-0/+9
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-07Handle generic args per arg indexHongxu Xu-4/+8
Add more test cases for generic args
2022-07-06Show only assoc type args in the correct arg posHongxu Xu-0/+17
2022-07-05internal: Record all macro definitions in ItemScopeLukas Wirth-6/+8
2022-07-03Bump smallvecLaurențiu Nicola-1/+1
2022-07-03Bump eitherLaurențiu Nicola-1/+1
2022-07-01fix: Simplify macro statement expansion handlingLukas Wirth-16/+19
2022-06-30Auto merge of #12634 - iDawer:match-check.witnesses, r=flodieboldbors-1/+3
feat: Show witnesses of non-exhaustiveness in `missing-match-arm` diagnostic Shamelessly copied from rustc. Thus reporting format is same. This extends public api `hir::diagnostics::MissingMatchArms` with `uncovered_patterns: String` field. It does not expose data for implementing a quick fix yet. ----- Worth to note: current implementation does not give a comprehensive list of missing patterns. Also mentioned in [paper](http://moscova.inria.fr/~maranget/papers/warn/warn.pdf): > One may think that algorithm I should make an additional effort to provide more > non-matching values, by systematically computing recursive calls on specialized > matrices when possible, and by returning a list of all pattern vectors returned by > recursive calls. We can first observe that it is not possible in general to supply the > users with all non-matching values, since the signature of integers is (potentially) > infinite.
2022-06-28fix: Report proc macro errors in expressions correctly as wellFlorian Diebold-3/+3
They didn't have a krate before, resulting in the generic "proc macro not found" error. Also improve error messages a bit more.
2022-06-27fix: Fix completions for locals not working properly inside macro callsLukas Wirth-18/+12
2022-06-25add test for suggest_namebitgaoshu-14/+20
2022-06-24Improve proc macro errors a bitFlorian Diebold-81/+83
Distinguish between - there is no build data (for some reason?) - there is build data, but the cargo package didn't build a proc macro dylib - there is a proc macro dylib, but it didn't contain the proc macro we expected - the name did not resolve to any macro (this is now an unresolved_macro_call even for attributes) I changed the handling of disabled attribute macro expansion to immediately ignore the macro and report an unresolved_proc_macro, because otherwise they would now result in loud unresolved_macro_call errors. I hope this doesn't break anything. Also try to improve error ranges for unresolved_macro_call / macro_error by reusing the code for unresolved_proc_macro. It's not perfect but probably better than before.
2022-06-24functions resolve to implbitgaoshu-58/+48
2022-06-24fix: completes non exhaustive variant within the defining crateyue4u-0/+18
2022-06-23Various cleanupsFlorian Diebold-8/+2
- remove Valid, it serves no purpose and just obscures the diff - rename some things - don't use is_valid_candidate when searching for impl, it's not necessary
2022-06-23goto where trait method implbitgaoshu-3/+65
2022-06-20internal: Simplify some completionsLukas Wirth-1/+9
2022-06-20Display witnesses of non-exhaustive matchiDawer-1/+3
Reporting format follows rustc and shows at most three witnesses.
2022-06-16the offset used for the completion cursor should always be relative to the ↵XFFXFF-2/+8
original file and not to the marco file
2022-06-16the scope of the return type is not the body of the functionXFFXFF-6/+4
2022-06-15Use the correct crates proc-macro loading error messageLukas Wirth-11/+7
2022-06-15Show proc-macro loading errors in unresolved-proc-macro diagnosticsLukas Wirth-2/+13
2022-06-14fix: Check for the correct proc-macro settings in missing proc-macro diagnosticsLukas Wirth-3/+8
2022-06-12More precise proc-macro errorsLukas Wirth-10/+19
2022-06-10internal: Bump DependenciesLukas Wirth-4/+9
2022-05-28fix(ide-db): correct single-file module renameNikita Podoliako-0/+5
2022-05-23fix: When reference searching macro inputs, don't search everything that was ↵Lukas Wirth-7/+7
downmapped
2022-05-19Teach `Callable` about closures properlyJonas Schievink-17/+54
2022-05-16Handle getters and setters in documentation template assistJonas Schievink-0/+1
2022-05-14feat: Add binding mode inlay hintsLukas Wirth-7/+64
2022-05-09Resolve assoc. types of supertraits in the IDE layerJonas Schievink-1/+6
2022-05-06fix: Fix snippets triggering where they shouldn'tLukas Wirth-4/+5
2022-05-05internal: Remove unqualified_path completions moduleLukas Wirth-4/+6
2022-05-05Auto merge of #12150 - rainy-me:feat/fix-doc-url-links, r=rainy-mebors-18/+1
fix: doc url link type fix: #12033 I did some debugging and found the cause looks like to be some doc links' `LinkType` are kept as `Shortcut` which don't make sense for url links. This PR should resolve both problems in the origin issue, but aside this PR, more work are needed for doc_links. about `LinkType`: https://github.com/raphlinus/pulldown-cmark/blob/f29bd1e228913690e5092c9594e4e607423ff0aa/src/lib.rs#L191-L210
2022-05-05fix: doc url link typerainy-me-18/+1
2022-05-04improve the default constructor mode when filling fieldsBenjamin Coenen-0/+4
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-05-02fix: Fix uncorrect use of double braces in HirDisplay implementationsLukas Wirth-5/+5
2022-05-01style: rename crates to kebab casePeh-4/+4
2022-04-27Diagnose unresolved derive macrosJonas Schievink-3/+10
2022-04-24#11973 associated type is unresolvedbitgaoshu-1/+7
2022-04-16Show `impl Trait` in argument positon in completion detailsiDawer-19/+19
`hir`: Use `db.callable_item_signature` query more.
2022-04-16Add `hir::Function::async_ret_type` methodiDawer-0/+17
Adjust completion detail for `async fn` return types
2022-04-16fix: comletion detail shows `{unknown}` for `impl Trait` in return positioniDawer-3/+3
2022-04-15Auto merge of #12003 - Veykril:hir-ty-simplify, r=Veykrilbors-86/+48
internal: Remove duplicated crate id field from hir::Type
2022-04-15Remove duplicated crate id field from hir::TypeLukas Wirth-86/+48
2022-04-15fix: Do reference search on all downmapped tokens with the same kind onlyLukas Wirth-31/+50