importEditorIntegration() — astro Function Reference
Architecture documentation for the importEditorIntegration() function in importPackage.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 03b2c8e8_4089_3932_b6ef_8b977e709ddd["importEditorIntegration()"] e0c225c9_e989_934d_19e8_8e80b7a6857f["importPackage.ts"] 03b2c8e8_4089_3932_b6ef_8b977e709ddd -->|defined in| e0c225c9_e989_934d_19e8_8e80b7a6857f f3e7462c_8189_532c_8f10_1698b2251467["importSvelteIntegration()"] f3e7462c_8189_532c_8f10_1698b2251467 -->|calls| 03b2c8e8_4089_3932_b6ef_8b977e709ddd 80d479e1_14bf_c8a1_058f_a3221a7da169["importVueIntegration()"] 80d479e1_14bf_c8a1_058f_a3221a7da169 -->|calls| 03b2c8e8_4089_3932_b6ef_8b977e709ddd 495034c4_630b_8d19_14b5_3d1a1a8fdcd7["getPackageInfo()"] 03b2c8e8_4089_3932_b6ef_8b977e709ddd -->|calls| 495034c4_630b_8d19_14b5_3d1a1a8fdcd7 style 03b2c8e8_4089_3932_b6ef_8b977e709ddd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/language-tools/language-server/src/importPackage.ts lines 53–75
function importEditorIntegration<T>(packageName: string, fromPath: string): T | undefined {
const pkgPath = getPackageInfo(packageName, [fromPath])?.directory;
if (pkgPath) {
try {
const main = resolve(pkgPath, 'dist', 'editor.cjs');
return require(main) as T;
} catch (e) {
console.error(
`Couldn't load editor module from ${pkgPath}. Make sure you're using at least version v0.2.1 of the corresponding integration. Reason: ${e}`,
);
return undefined;
}
} else {
console.info(
`Couldn't find package ${packageName} (searching from ${fromPath}). Make sure it's installed. If you believe this to be an error, please open an issue.`,
);
}
return undefined;
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does importEditorIntegration() do?
importEditorIntegration() is a function in the astro codebase, defined in packages/language-tools/language-server/src/importPackage.ts.
Where is importEditorIntegration() defined?
importEditorIntegration() is defined in packages/language-tools/language-server/src/importPackage.ts at line 53.
What does importEditorIntegration() call?
importEditorIntegration() calls 1 function(s): getPackageInfo.
What calls importEditorIntegration()?
importEditorIntegration() is called by 2 function(s): importSvelteIntegration, importVueIntegration.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free