diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-06 12:51:15 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-06 12:51:15 +0100 |
commit | 87cb840a4e140a49946235823384694da58c2a5a (patch) | |
tree | 4e6ce0749103bdf8e373b3d12472866bdc10d4c8 /crates/hir | |
parent | af0e54a566ab8c8be9b39a628aaa4992f161695c (diff) | |
parent | 9d19e5b962f77259dd1334b9edb4da4de54f0987 (diff) |
Merge #6124
6124: Better normalized crate name usage r=jonas-schievink a=SomeoneToIgnore
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5343
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5932
Uses normalized name for code snippets (to be able to test the fix), hover messages and documentation rewrite links (are there any tests for those?).
Also renamed the field to better resemble the semantics.
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/code_model.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index a445a97b3..c75d46bff 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -2,7 +2,7 @@ | |||
2 | use std::{iter, sync::Arc}; | 2 | use std::{iter, sync::Arc}; |
3 | 3 | ||
4 | use arrayvec::ArrayVec; | 4 | use arrayvec::ArrayVec; |
5 | use base_db::{CrateId, Edition, FileId}; | 5 | use base_db::{CrateId, CrateName, Edition, FileId}; |
6 | use either::Either; | 6 | use either::Either; |
7 | use hir_def::find_path::PrefixKind; | 7 | use hir_def::find_path::PrefixKind; |
8 | use hir_def::{ | 8 | use hir_def::{ |
@@ -99,8 +99,8 @@ impl Crate { | |||
99 | db.crate_graph()[self.id].edition | 99 | db.crate_graph()[self.id].edition |
100 | } | 100 | } |
101 | 101 | ||
102 | pub fn display_name(self, db: &dyn HirDatabase) -> Option<String> { | 102 | pub fn declaration_name(self, db: &dyn HirDatabase) -> Option<CrateName> { |
103 | db.crate_graph()[self.id].display_name.clone() | 103 | db.crate_graph()[self.id].declaration_name.clone() |
104 | } | 104 | } |
105 | 105 | ||
106 | pub fn query_external_importables( | 106 | pub fn query_external_importables( |