mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
internal: Remove load-cargo dependency on ide
This commit is contained in:
parent
0ac05c0527
commit
4ee0dbdc04
18 changed files with 70 additions and 61 deletions
|
@ -1,6 +1,8 @@
|
|||
//! This module generates [moniker](https://microsoft.github.io/language-server-protocol/specifications/lsif/0.6.0/specification/#exportsImports)
|
||||
//! for LSIF and LSP.
|
||||
|
||||
use core::fmt;
|
||||
|
||||
use hir::{Adt, AsAssocItem, AssocItemContainer, Crate, DescendPreference, MacroKind, Semantics};
|
||||
use ide_db::{
|
||||
base_db::{CrateOrigin, FilePosition, LangCrateOrigin},
|
||||
|
@ -93,9 +95,10 @@ pub struct MonikerIdentifier {
|
|||
pub description: Vec<MonikerDescriptor>,
|
||||
}
|
||||
|
||||
impl ToString for MonikerIdentifier {
|
||||
fn to_string(&self) -> String {
|
||||
format!("{}::{}", self.crate_name, self.description.iter().map(|x| &x.name).join("::"))
|
||||
impl fmt::Display for MonikerIdentifier {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(&self.crate_name)?;
|
||||
f.write_fmt(format_args!("::{}", self.description.iter().map(|x| &x.name).join("::")))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue