Home / Function/ getVueLanguagePlugin() — astro Function Reference

getVueLanguagePlugin() — astro Function Reference

Architecture documentation for the getVueLanguagePlugin() function in vue.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  a9b0bd2b_8023_9028_409c_392c9639016c["getVueLanguagePlugin()"]
  f69c8565_2601_d4c4_6da0_cfd184766eed["vue.ts"]
  a9b0bd2b_8023_9028_409c_392c9639016c -->|defined in| f69c8565_2601_d4c4_6da0_cfd184766eed
  style a9b0bd2b_8023_9028_409c_392c9639016c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/language-tools/language-server/src/core/vue.ts lines 12–40

export function getVueLanguagePlugin(): LanguagePlugin<URI, VueVirtualCode> {
	return {
		getLanguageId(uri) {
			if (uri.path.endsWith('.vue')) {
				return 'vue';
			}
		},
		createVirtualCode(uri, languageId, snapshot) {
			if (languageId === 'vue') {
				const fileName = uri.fsPath.replace(/\\/g, '/');
				return new VueVirtualCode(fileName, snapshot);
			}
		},
		typescript: {
			extraFileExtensions: [{ extension: 'vue', isMixedContent: true, scriptKind: 7 }],
			getServiceScript(vueCode) {
				for (const code of forEachEmbeddedCode(vueCode)) {
					if (code.id === 'tsx') {
						return {
							code,
							extension: '.tsx',
							scriptKind: 4 satisfies ts.ScriptKind.TSX,
						};
					}
				}
			},
		},
	};
}

Domain

Subdomains

Frequently Asked Questions

What does getVueLanguagePlugin() do?
getVueLanguagePlugin() is a function in the astro codebase, defined in packages/language-tools/language-server/src/core/vue.ts.
Where is getVueLanguagePlugin() defined?
getVueLanguagePlugin() is defined in packages/language-tools/language-server/src/core/vue.ts at line 12.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free