feat: replace diag_group id with project_id (#1224)

This commit is contained in:
Myriad-Dreamin 2025-01-29 19:40:31 +08:00 committed by GitHub
parent 0f588c99d7
commit 7647d807ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 88 additions and 87 deletions

View file

@ -33,6 +33,17 @@ pub type LspInterrupt = Interrupt<LspCompilerFeat>;
#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
pub struct ProjectInsId(EcoString);
impl fmt::Display for ProjectInsId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl ProjectInsId {
/// The primary project id.
pub const PRIMARY: ProjectInsId = ProjectInsId(EcoString::inline("primary"));
}
/// A signal that possibly triggers an export.
///
/// Whether to export depends on the current state of the document and the user
@ -142,6 +153,13 @@ pub struct CompiledArtifact<F: CompilerFeat> {
pub deps: OnceLock<EcoVec<FileId>>,
}
impl fmt::Display for CompiledArtifact<LspCompilerFeat> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let rev = self.world.revision();
write!(f, "CompiledArtifact({:?}, rev={rev:?})", self.id)
}
}
impl<F: CompilerFeat> std::ops::Deref for CompiledArtifact<F> {
type Target = CompileSnapshot<F>;