| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
897: Add basic const/static type inference r=flodiebold a=vipentti
This adds basic const/static type inference discussed in #887.
Currently the inference does not work for const/static declared inside a block. In addition the inference does not work inside the bodies of const/static.
Co-authored-by: Ville Penttinen <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This module should remove completion rendering boilerplate from the
"brains" of completion engine.
|
|\
| |
| |
| |
| |
| |
| |
| | |
891: Field completion r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
885: Parse token trees directy r=matklad a=matklad
This takes advantage of the recent macro refactoring to directly parse token stream into a syntax tree.
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It was just getting too big. We now have:
- ty: the `Ty` enum and helpers
- ty::infer: actual type inference
- ty::lower: lowering from HIR to `Ty`
- ty::op: helpers for binary operations, currently
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
879: Fixes to goto definition r=vipentti a=vipentti
Previously goto definition would fail when the cursor was over the name of the definition. Now we should properly resolve to a `NavigationTarget` when on top of the name of a definition.
In addition this adds `name_range` field to `FileSymbol`, this further fixes goto_definition and symbol based navigation by allowing the `NavigationTarget` to actually have a `focus_range`, meaning instead of focusing on the start of the `full_range`, we can have the cursor focus on the name.
e.g. goto definition
```rust
fn bar() {
fn foo() { }
foo<|>();
}
```
Previously this would put the cursor at the start of the FN_DEF:
```rust
fn bar() {
<|>fn foo() { }
foo();
}
```
Now when using the symbol based resolving, we'll have a proper focus range and instead put the cursor at the start of the name.
```rust
fn bar() {
fn <|>foo() { }
foo();
}
```
This fixes #877 but doesn't contain the refactoring of the return type for `goto_definition`
Co-authored-by: Ville Penttinen <[email protected]>
|
| | |
|
| |
| |
| |
| |
| |
| | |
This contains the syntax range of the name itself, allowing NavigationTarget to
properly set the focus_range. This should make it so that when using symbol
based navigation, we should always focus on the name, instead of the full range.
|
| | |
|
| |
| |
| |
| |
| | |
We now allow goto_definition to return the named NavigationTarget if the cursor
is on the name of a definition.
|
|/
|
|
|
|
| |
I think it'll be better to make the path resolution the number of unresolved
segments, not the first unresolved index; then this error could simply not have
happened. But I'll do that separately.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|