AstroVirtualCode Class — astro Architecture
Architecture documentation for the AstroVirtualCode class in language.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 10cb8652_17ca_9a93_eb47_e7c594b2481f["AstroVirtualCode"] 6dfcea35_46db_2e95_f1a2_dd2af9c2da08["language.ts"] 10cb8652_17ca_9a93_eb47_e7c594b2481f -->|defined in| 6dfcea35_46db_2e95_f1a2_dd2af9c2da08 2e429449_b5ff_e4f3_f6d3_8d37d16517b9["constructor()"] 10cb8652_17ca_9a93_eb47_e7c594b2481f -->|method| 2e429449_b5ff_e4f3_f6d3_8d37d16517b9
Relationship Graph
Source Code
packages/language-tools/ts-plugin/src/language.ts lines 41–74
export class AstroVirtualCode implements VirtualCode {
id = 'root';
languageId = 'astro';
mappings!: CodeMapping[];
embeddedCodes!: VirtualCode[];
codegenStacks = [];
constructor(
public fileName: string,
public snapshot: ts.IScriptSnapshot,
) {
this.mappings = [
{
sourceOffsets: [0],
generatedOffsets: [0],
lengths: [this.snapshot.getLength()],
data: {
verification: true,
completion: true,
semantic: true,
navigation: true,
structure: true,
format: false,
},
},
];
this.embeddedCodes = [];
const tsx = astro2tsx(this.snapshot.getText(0, this.snapshot.getLength()), this.fileName);
this.embeddedCodes.push(tsx.virtualFile);
}
}
Domain
Source
Frequently Asked Questions
What is the AstroVirtualCode class?
AstroVirtualCode is a class in the astro codebase, defined in packages/language-tools/ts-plugin/src/language.ts.
Where is AstroVirtualCode defined?
AstroVirtualCode is defined in packages/language-tools/ts-plugin/src/language.ts at line 41.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free