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:
bors[bot] 2020-10-06 11:51:15 +00:00 committed by GitHub
commit 87cb840a4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 64 additions and 31 deletions

View file

@ -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(