Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge #1394 | bors[bot] | 2019-06-11 | 1 | -6/+23 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1394: Fix hover for pat that shadows items r=matklad a=sinkuu ```rust fn x() {} fn y() { let x = 0i32; x; // hover on `x` is expected to be `i32`, but the actual result was `fn x()` } ``` This was because: if [`res.is_empty()`](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L205), it fallbacks to "index based approach" and adds `fn x()` to `res`, which makes [`res.extend(type_of)` below](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L260-L266) not happen. Co-authored-by: Shotaro Yamada <[email protected]> | ||||
| * | Fix hover for pat that shadows items | Shotaro Yamada | 2019-06-11 | 1 | -6/+23 |
| | | |||||
* | | remove inherent source impls | Aleksey Kladov | 2019-06-11 | 1 | -2/+2 |
| | | |||||
* | | use Source for module, part 1 | Aleksey Kladov | 2019-06-11 | 1 | -2/+1 |
| | | |||||
* | | use Source for StructField | Aleksey Kladov | 2019-06-11 | 1 | -2/+2 |
| | | |||||
* | | use Source for MacroDef | Aleksey Kladov | 2019-06-11 | 1 | -2/+2 |
| | | |||||
* | | use Source for Trait | Aleksey Kladov | 2019-06-11 | 1 | -8/+2 |
| | | |||||
* | | simplify | Aleksey Kladov | 2019-06-11 | 1 | -5/+5 |
| | | |||||
* | | use Source for TypeAlias | Aleksey Kladov | 2019-06-11 | 1 | -12/+6 |
| | | |||||
* | | reduce duplication in hover | Aleksey Kladov | 2019-06-11 | 1 | -56/+24 |
| | | |||||
* | | use Source for statics and consts | Aleksey Kladov | 2019-06-11 | 1 | -6/+6 |
| | | |||||
* | | use Source for Function | Aleksey Kladov | 2019-06-11 | 1 | -6/+6 |
| | | |||||
* | | use Source more | Aleksey Kladov | 2019-06-11 | 1 | -6/+9 |
| | | |||||
* | | introduce Source struct | Aleksey Kladov | 2019-06-11 | 1 | -4/+7 |
|/ | |||||
* | Simpliy hover on ast::name | Edwin Cheng | 2019-06-10 | 1 | -7/+35 |
| | |||||
* | Use classify_name_ref in hover | Edwin Cheng | 2019-06-10 | 1 | -12/+128 |
| | |||||
* | Remove node function in NavTarget | Edwin Cheng | 2019-06-08 | 1 | -3/+3 |
| | |||||
* | Fix clippy::new_without_default | Alan Du | 2019-06-04 | 1 | -0/+6 |
| | |||||
* | Sort hover results in tests | Laurențiu Nicola | 2019-05-30 | 1 | -2/+8 |
| | |||||
* | fix typos in mbe tests | Aleksey Kladov | 2019-05-28 | 1 | -2/+2 |
| | |||||
* | Fix hover on the beginning of a nested expression | Florian Diebold | 2019-04-28 | 1 | -7/+14 |
| | | | | | | | | | | | | | | | | E.g. in ``` let foo = 1u32; if true { <|>foo; } ``` the hover shows `()`, the type of the whole if expression, instead of the more sensible `u32`. The reason for this was that the search for an expression was slightly left-biased: When on the edge between two tokens, it first looked at all ancestors of the left token and then of the right token. Instead merge the ancestors in ascending order, so that we get the smaller of the two possible expressions. | ||||
* | use really correct resolver for expressions | Aleksey Kladov | 2019-04-12 | 1 | -1/+1 |
| | |||||
* | rename | Aleksey Kladov | 2019-04-11 | 1 | -1/+1 |
| | |||||
* | introduce SourceAnalyzer | Aleksey Kladov | 2019-04-11 | 1 | -10/+8 |
| | |||||
* | Move display related things from hover to display | Ville Penttinen | 2019-04-09 | 1 | -107/+3 |
| | |||||
* | Move completion label functions to display | Ville Penttinen | 2019-04-09 | 1 | -1/+1 |
| | |||||
* | switch to new rowan | Aleksey Kladov | 2019-04-01 | 1 | -6/+8 |
| | |||||
* | replace todo with fixme | Aleksey Kladov | 2019-03-23 | 1 | -1/+1 |
| | |||||
* | Remove the old variants replaced by Ty::Apply | Florian Diebold | 2019-03-21 | 1 | -16/+1 |
| | |||||
* | Replace Display by a pretty printing trait for Ty | Florian Diebold | 2019-03-16 | 1 | -2/+3 |
| | | | | | This allows removing the names from Adt and FnDef (and more later), as a first step towards aligning more with chalk's Ty :) | ||||
* | Remove superfluous semicolons | kjeremy | 2019-03-08 | 1 | -5/+5 |
| | | | | | Doesn't change the result of the test but it does prevent the syntax tree from rendering. | ||||
* | Use ast::Name::text() instead of name().syntax().text() | Ville Penttinen | 2019-03-07 | 1 | -2/+2 |
| | |||||
* | Fix EnumVariants not showing properly when hovering | Ville Penttinen | 2019-03-07 | 1 | -2/+56 |
| | | | | This fixes documentation as well for EnumVariants | ||||
* | Add support for goto definition and hover on Self | Ville Penttinen | 2019-03-07 | 1 | -0/+58 |
| | | | | This fixes #943 | ||||
* | Hover for associated items in patterns | kjeremy | 2019-03-06 | 1 | -0/+23 |
| | |||||
* | Use ImplItems instead of just Function | Jeremy Kolb | 2019-03-04 | 1 | -1/+1 |
| | |||||
* | Make goto definition/hover resolve constructors | kjeremy | 2019-03-04 | 1 | -0/+22 |
| | |||||
* | Represent unknown types as {unknown} instead of [unknown] | Florian Diebold | 2019-03-03 | 1 | -1/+1 |
| | | | | Since the latter could actually be a real type... | ||||
* | Merge #908 | bors[bot] | 2019-03-02 | 1 | -8/+27 |
|\ | | | | | | | | | | | | | | | | | | | | | 908: Enable markup for hover on expressions which resolve using type_of r=matklad a=vipentti This adds highlighting when hovering over items which are resolved using `type_of`. This adds basic highlighting, discussed in #904. Co-authored-by: Ville Penttinen <[email protected]> | ||||
| * | Enable markup for hover on expressions which resolve using type_of | Ville Penttinen | 2019-02-28 | 1 | -8/+27 |
| | | | | | | | | | | This adds highlighting when hovering over items which are resolved using `type_of`. | ||||
* | | rename syntax_mapping as well | Aleksey Kladov | 2019-03-02 | 1 | -3/+3 |
| | | |||||
* | | rename syntax-mapping -> source-map | Aleksey Kladov | 2019-03-02 | 1 | -1/+1 |
| | | |||||
* | | Update hover message since we do support globs | kjeremy | 2019-02-28 | 1 | -1/+1 |
|/ | |||||
* | Enable hover support for NamedFieldDefs | Ville Penttinen | 2019-02-27 | 1 | -3/+79 |
| | | | | Additionally add type ascription for const and statics as well. | ||||
* | Add support for hovering over the name of an item | Ville Penttinen | 2019-02-27 | 1 | -1/+27 |
| | |||||
* | Replace visit_fn with crate::completion::function_label | Ville Penttinen | 2019-02-26 | 1 | -43/+2 |
| | |||||
* | Add new type HoverResult to contain the results of hovering | Ville Penttinen | 2019-02-26 | 1 | -14/+146 |
| | | | | | This makes testing hovers easier as well as allows us to do more things with the results if needed. | ||||
* | Add support for showing fn signature when hovering | Ville Penttinen | 2019-02-26 | 1 | -3/+43 |
| | |||||
* | rename type to type_alias in the AST as well | Aleksey Kladov | 2019-02-25 | 1 | -2/+2 |
| | |||||
* | Merge #866 | bors[bot] | 2019-02-22 | 1 | -0/+20 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]> |