rust/crates
bors[bot] e5fb33a946 Merge #879
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 <villem.penttinen@gmail.com>
2019-02-23 12:17:53 +00:00
..
gen_lsp_server Update lsp-types and backtrace 2019-02-21 10:07:14 -05:00
ra_arena Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_assists Move non_trivia_sibling to ra_syntax::algo 2019-02-21 18:49:03 +02:00
ra_batch switch to crates.io vfs 2019-02-18 16:43:16 +03:00
ra_cli kill utils module 2019-02-21 15:57:40 +03:00
ra_db Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
ra_fmt Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_hir Fix resolution of associated method calls across crates 2019-02-23 12:37:29 +01:00
ra_ide_api Remove unnecessary to_nav_target 2019-02-23 14:08:57 +02:00
ra_ide_api_light Move non_trivia_sibling to ra_syntax::algo 2019-02-21 18:49:03 +02:00
ra_lsp_server Update lsp-types and backtrace 2019-02-21 10:07:14 -05:00
ra_mbe Fix some typos 2019-02-12 15:02:57 +01:00
ra_parser docs 2019-02-21 15:24:42 +03:00
ra_project_model Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
ra_syntax Merge #876 2019-02-21 16:55:26 +00:00
ra_text_edit Fix typo in Cargo.toml authors 2019-02-11 10:20:04 +02:00
ra_tt make token trees eq 2019-02-12 20:57:13 +03:00
test_utils remove ignored macro tests 2019-02-19 20:06:53 +03:00
thread_worker automatically wait for worker threads 2019-02-14 21:11:07 +03:00
tools fix the test 2019-02-21 13:45:10 +03:00