aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge #866bors[bot]2019-02-229-31/+410
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 866: Implement basic support for Associated Methods r=flodiebold a=vipentti This is my attempt at learning to understand how the type inference works by adding basic support for associated methods. Currently it does not resolve associated types or constants. The basic idea is that `Resolver::resolve_path` returns a new `PathResult` type, which has two variants, `FullyResolved` and `PartiallyResolved`, fully resolved matches the previous behavior, where as `PartiallyResolved` contains the `PerNs<Resolution` in addition to a `segment_index` which contains the index of the segment which we failed to resolve. This index can then be used to continue inference in `infer_path_expr` using the `Type` we managed to resolve. This changes some of the previous apis, so looking for feedback and suggestions. This should enable fixing #832 Co-authored-by: Ville Penttinen <[email protected]>
| * Change resolve_path to return the fully resolved path or PerNs::noneVille Penttinen2019-02-223-34/+36
| | | | | | | | | | | | This also adds new pub(crate) resolve_path_segments which returns the PathResult, which may or may not be fully resolved. PathResult is also now pub(crate) since it is an implementation detail.
| * Ignore failing test for nowVille Penttinen2019-02-211-0/+1
| |
| * Make nameres::ResolvePathResult private and refactorVille Penttinen2019-02-211-7/+7
| |
| * Remove Const inference for now, refactor PathResultVille Penttinen2019-02-214-77/+93
| |
| * Implement basic support for Associated Methods and ConstantsVille Penttinen2019-02-2110-48/+408
| | | | | | | | | | | | | | This is done in `infer_path_expr`. When `Resolver::resolve_path` returns `PartiallyResolved`, we use the returned `Resolution` together with the given `segment_index` to check if we can find something matching the segment at segment_index in the impls for that particular type.
* | Add an assert (and fix the other)Florian Diebold2019-02-211-1/+2
| |
* | Fix handling of generics in tuple variants and refactor a bitFlorian Diebold2019-02-205-41/+105
|/ | | | | | Also make them display a tiny bit nicer. Fixes #860.
* remove ignored macro testsAleksey Kladov2019-02-191-30/+0
| | | | | we need to significantly reengineer macros, so the tests as they exist are useless
* Merge #852bors[bot]2019-02-183-34/+40
|\ | | | | | | | | | | | | | | 852: Handle != r=flodiebold a=matklad r? @flodiebold Co-authored-by: Aleksey Kladov <[email protected]>
| * handle != operatorAleksey Kladov2019-02-183-34/+40
| |
* | Handle tuple structs / enum variants properly in type inferenceFlorian Diebold2019-02-175-37/+95
|/
* Make GenericArgs::from_ast pub(crate)Florian Diebold2019-02-171-1/+1
|
* Unify with the autorefed/autoderefed receiver type during method resolutionFlorian Diebold2019-02-174-12/+54
|
* Handle generic args for method callsFlorian Diebold2019-02-164-10/+45
|
* Handle impl generics in method callsFlorian Diebold2019-02-167-77/+122
|
* Resolve impl generic paramsFlorian Diebold2019-02-161-1/+3
|
* Add generic params to impl blocksFlorian Diebold2019-02-162-8/+14
|
* Add a test for impl genericsFlorian Diebold2019-02-162-0/+71
|
* Turn ImplBlock into a copy type just containing IDsFlorian Diebold2019-02-165-66/+48
| | | | | | | This makes it more like the other code model types. Also make Module::definition_source/declaration_source return HirFileIds, to make them more like the other source functions.
* Complete names from preludeFlorian Diebold2019-02-132-4/+10
|
* Handle extern crates better, so they work correctly in 2015 editionFlorian Diebold2019-02-133-15/+55
| | | | (see the removed comment.)
* Make edition handling a bit nicer and allow specifying edition in ↵Florian Diebold2019-02-132-16/+13
| | | | crate_graph macro
* Resolve 2015 style importsFlorian Diebold2019-02-133-8/+114
|
* Keep track of crate editionFlorian Diebold2019-02-131-2/+3
|
* Import the preludeFlorian Diebold2019-02-135-11/+96
|
* Fix another crashFlorian Diebold2019-02-123-2/+33
|
* make token trees eqAleksey Kladov2019-02-121-1/+1
|
* Fix some typosPascal Hertleif2019-02-126-15/+15
|
* Implement completion for associated itemsLaurențiu Nicola2019-02-121-0/+20
|
* replace clone with copyAleksey Kladov2019-02-121-1/+1
|
* fix obsolete commentAleksey Kladov2019-02-121-2/+2
|
* remove hard-coded query-group macroAleksey Kladov2019-02-112-24/+3
|
* remove useless hashAleksey Kladov2019-02-112-2/+2
|
* remove query_definitionsAleksey Kladov2019-02-114-34/+20
|
* rename combine -> orAleksey Kladov2019-02-112-3/+3
| | | | | | This way we match API of Option https://doc.rust-lang.org/std/option/enum.Option.html#method.or
* use extern prelude in ResolverAleksey Kladov2019-02-113-18/+43
| | | | | | | This fixes two bugs: - completion for paths works again - we handle extern prelude shadowing more correctly
* Merge #784bors[bot]2019-02-113-116/+146
|\ | | | | | | | | | | | | | | 784: WIP: improve multi-crate fixtures r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * add graph fixtureAleksey Kladov2019-02-113-71/+81
| |
| * Handle SourceRoots automatically in fixturesAleksey Kladov2019-02-112-55/+75
| |
* | Fix typo in Cargo.toml authorsVille Penttinen2019-02-111-1/+1
| | | | | | | | Fixes typo introduced in #782
* | Update authors field in Cargo.tomls to "rust-analyzer developers"Ville Penttinen2019-02-111-1/+1
|/ | | | This closes #777
* Implement glob imports within the same crateFlorian Diebold2019-02-101-16/+77
| | | | Fixes #231.
* Import glob imports from other cratesFlorian Diebold2019-02-103-2/+17
| | | | This is the easy part since we don't have to consider the fixpoint algorithm.
* Implement glob imports from enumsFlorian Diebold2019-02-102-6/+37
|
* Add some testsFlorian Diebold2019-02-102-0/+120
|
* Spell cases explicitly in Ty::walk{_mut}Florian Diebold2019-02-101-2/+18
|
* Add an ra_cli command that analyses all crates in the current workspaceFlorian Diebold2019-02-103-2/+75
| | | | ... and prints various stats about how many expressions have a type etc.
* Add comment and markFlorian Diebold2019-02-093-2/+10
|
* Fix another crash, and try harder to prevent stack overflowsFlorian Diebold2019-02-093-7/+75
|