aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ssr/src/resolving.rs
Commit message (Collapse)AuthorAgeFilesLines
* Rename ra_syntax -> syntaxAleksey Kladov2020-08-121-4/+4
|
* Merge #5637bors[bot]2020-08-121-4/+27
|\ | | | | | | | | | | | | | | | | | | | | | | 5637: SSR: Matching trait associated constants, types and functions r=matklad a=davidlattimore This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`). Same for associated constants and types that are part of a trait implementation. However, we still don't support matching calls to trait methods. Co-authored-by: David Lattimore <[email protected]>
| * SSR: Matching trait associated constants, types and functionsDavid Lattimore2020-08-011-4/+27
| | | | | | | | | | | | | | | | | | | | This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`). Same for associated constants and types that are part of a trait implementation. However, we still don't support matching calls to trait methods.
* | Use SyntaxNode.ancestors instead of a loopDavid Lattimore2020-08-051-7/+1
| |
* | SSR: Allow `self` in patterns.David Lattimore2020-08-011-0/+29
|/ | | | | | | | | It's now consistent with other variables in that if the pattern references self, only the `self` in scope where the rule is invoked will be accepted. Since `self` doesn't work the same as other paths, this is implemented by restricting the search to just the current function. Prior to this change (since path resolution was implemented), having self in a pattern would just result in no matches.
* Rename BindPat -> IdentPatAleksey Kladov2020-07-311-1/+1
|
* Rename TypeArgList -> GenericArgListAleksey Kladov2020-07-311-1/+1
|
* SSR: Rename position and lookup_context to resolve_contextDavid Lattimore2020-07-291-4/+4
|
* SSR: Fix for path resolution of localsDavid Lattimore2020-07-261-0/+28
| | | | | | | | It seems that Semantics::scope, if given a statement node, won't resolve locals that were defined in the current scope, only in parent scopes. Not sure if this is intended / expected behavior, but we work around it for now by finding another nearby node to use as the scope (e.g. the expression inside the EXPR_STMT).
* SSR: Move more resolution-related code into the resolving moduleDavid Lattimore2020-07-261-6/+33
|
* SSR: Allow function calls to match method callsDavid Lattimore2020-07-241-0/+18
| | | | | | | | | | | This differs from how this used to work before I removed it in that: a) It's only one direction. Function calls in the pattern can match method calls in the code, but not the other way around. b) We now check that the function call in the pattern resolves to the same function as the method call in the code. The lack of (b) was the reason I felt the need to remove the feature before.
* SSR: Use Definition::find_usages to speed up matching.David Lattimore2020-07-241-3/+5
| | | | When the search pattern contains a path, this substantially speeds up finding matches, especially if the path references a private item.
* SSR: Match paths based on what they resolve toDavid Lattimore2020-07-241-0/+153
Also render template paths appropriately for their context.