mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
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 <mail4score@gmail.com>
This commit is contained in:
commit
87cb840a4e
10 changed files with 64 additions and 31 deletions
|
@ -2,7 +2,7 @@
|
|||
use std::{iter, sync::Arc};
|
||||
|
||||
use arrayvec::ArrayVec;
|
||||
use base_db::{CrateId, Edition, FileId};
|
||||
use base_db::{CrateId, CrateName, Edition, FileId};
|
||||
use either::Either;
|
||||
use hir_def::find_path::PrefixKind;
|
||||
use hir_def::{
|
||||
|
@ -99,8 +99,8 @@ impl Crate {
|
|||
db.crate_graph()[self.id].edition
|
||||
}
|
||||
|
||||
pub fn display_name(self, db: &dyn HirDatabase) -> Option<String> {
|
||||
db.crate_graph()[self.id].display_name.clone()
|
||||
pub fn declaration_name(self, db: &dyn HirDatabase) -> Option<CrateName> {
|
||||
db.crate_graph()[self.id].declaration_name.clone()
|
||||
}
|
||||
|
||||
pub fn query_external_importables(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue