Cross-editor Language Server (aihu-language-server) for .aihu Single File Components — diagnostics, hover, completion, and quick-fix code actions.
buildMigrateFixfunction buildMigrateFix(source: string): MigrateFix | nullRun the macro-simplification codemod over `source` and return the fix payload.
compileWithDiagnosticsasync function compileWithDiagnostics( source: string, filePath: string, ): Promise<CompileResult>Compile a .aihu source string via stdin, returning structured diagnostics.
createAihuLanguagePluginfunction createAihuLanguagePlugin(): LanguagePlugin<URI, AihuVirtualCode>Create the Volar LanguagePlugin for .aihu files.
createAihuLanguageServicePluginfunction createAihuLanguageServicePlugin(): LanguageServicePluginCreate the Volar LanguageServicePlugin for aihu.
createTestServerfunction createTestServer()Create and wire the test seam for integration / unit tests.
getBlockContextfunction getBlockContext( lines: string[], lineIndex: number, ): 'state' | 'template' | 'style' | 'agent' | 'route' | 'unknown'getHoverContentfunction getHoverContent(macro: string): string | nullgetMacroAtPositionfunction getMacroAtPosition(lineText: string, character: number): string | nullmapToOriginalfunction mapToOriginal( virtualOffset: number, map: SourceMap<CodeInformation>, ): AihuSourcePosition | nullMap a virtual-file offset back to the original .aihu source offset.
mapToVirtualfunction mapToVirtual( originalOffset: number, _block: '@state', map: SourceMap<CodeInformation>, ): AihuVirtualPosition | nullMap an original .aihu source offset to the virtual-file offset.
parseMachineErrorsfunction parseMachineErrors(stderr: string, filePath: string): AihuDiagnostic[]Parse the Rust binary's `--machine-errors` stderr stream into structured diagnostics.
startServerfunction startServer(): voidStart the language server on stdio and begin listening.
withAihuDiagnosticParityfunction withAihuDiagnosticParity(plugin: LanguageServicePlugin): LanguageServicePluginWrap a TypeScript LanguageServicePlugin (volar-service-typescript) so its diagnostics apply the SAME implicit-`any` suppression `aihu-tsc` applies to `.aihu` files by default (`IMPLICIT_ANY_CODES`, packages/tsc/src/index.ts).
BLOCK_COMPLETIONSconst BLOCK_COMPLETIONS: LspCompletionItem[]Top-level block completions (triggered by '@' at top level).
MIGRATE_CODESconst MIGRATE_CODESCompiler diagnostic codes whose QuickFix is the v2 macro migration codemod.
SourceMapconst SourceMapSTATE_MACRO_COMPLETIONSconst STATE_MACRO_COMPLETIONS: LspCompletionItem[]v2 macro-kind snippet completions (triggered by '