aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/display/navigation_target.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-19 14:10:10 +0100
committerbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-07-19 14:10:10 +0100
commit8718a47088585bdb411f37d1b7cd1244d7528eaa (patch)
tree254e13d1f0fb3072d02ba58f918de043a5cfcded /crates/ra_ide_api/src/display/navigation_target.rs
parentc0e36ab0c33a7c721c0919b4285e0b23e10ce9d5 (diff)
parentf9d9e0a1f75b48813fe816a1e2a6c30146a36503 (diff)
Merge #1551
1551: several highlighting cleanups r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/display/navigation_target.rs')
-rw-r--r--crates/ra_ide_api/src/display/navigation_target.rs19
1 files changed, 3 insertions, 16 deletions
diff --git a/crates/ra_ide_api/src/display/navigation_target.rs b/crates/ra_ide_api/src/display/navigation_target.rs
index 8cc853dd1..8aff5f2cd 100644
--- a/crates/ra_ide_api/src/display/navigation_target.rs
+++ b/crates/ra_ide_api/src/display/navigation_target.rs
@@ -91,24 +91,11 @@ impl NavigationTarget {
91 pub(crate) fn from_pat( 91 pub(crate) fn from_pat(
92 db: &RootDatabase, 92 db: &RootDatabase,
93 file_id: FileId, 93 file_id: FileId,
94 pat: AstPtr<ast::Pat>, 94 pat: AstPtr<ast::BindPat>,
95 ) -> NavigationTarget { 95 ) -> NavigationTarget {
96 let parse = db.parse(file_id); 96 let parse = db.parse(file_id);
97 let (name, full_range) = match pat.to_node(parse.tree().syntax()).kind() { 97 let pat = pat.to_node(parse.tree().syntax());
98 ast::PatKind::BindPat(pat) => return NavigationTarget::from_bind_pat(file_id, &pat), 98 NavigationTarget::from_bind_pat(file_id, &pat)
99 _ => ("_".into(), pat.syntax_node_ptr().range()),
100 };
101
102 NavigationTarget {
103 file_id,
104 name,
105 full_range,
106 focus_range: None,
107 kind: NAME,
108 container_name: None,
109 description: None, //< No documentation for Description
110 docs: None, //< No documentation for Pattern
111 }
112 } 99 }
113 100
114 pub(crate) fn from_self_param( 101 pub(crate) fn from_self_param(