diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-18 15:50:47 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-18 15:50:47 +0000 |
commit | 7614439033bc8b68d3982d93595161ddfda80837 (patch) | |
tree | d829b5cf22dedfb99dc154b48a3576be48dfbbc6 /crates/ra_ide_api/src/syntax_highlighting.rs | |
parent | 9cc4d058d2b0a8741ef67b71986b4c51b4459426 (diff) | |
parent | a22cb1daa76ddc7c5078a7a80b11909dd480f9f2 (diff) |
Merge #2304
2304: Use Source<&ast::Name> in classify_name r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/syntax_highlighting.rs')
-rw-r--r-- | crates/ra_ide_api/src/syntax_highlighting.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 584657ca2..2b653fe8f 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs | |||
@@ -94,7 +94,8 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa | |||
94 | } | 94 | } |
95 | NAME => { | 95 | NAME => { |
96 | let name = node.as_node().cloned().and_then(ast::Name::cast).unwrap(); | 96 | let name = node.as_node().cloned().and_then(ast::Name::cast).unwrap(); |
97 | let name_kind = classify_name(db, file_id, &name).map(|d| d.kind); | 97 | let name_kind = |
98 | classify_name(db, Source::new(file_id.into(), &name)).map(|d| d.kind); | ||
98 | 99 | ||
99 | if let Some(Local(local)) = &name_kind { | 100 | if let Some(Local(local)) = &name_kind { |
100 | if let Some(name) = local.name(db) { | 101 | if let Some(name) = local.name(db) { |