Files
paseo/packages/highlight/src/index.ts
T
Mohamed Boudra 6077bc6219 Keep daemon diff highlighting responsive and bounded (#7945)
* fix(server): keep diff highlighting responsive and bounded

Tiny patches previously parsed both full source versions synchronously. Yield between parser work units and admit source by UTF-8 bytes, keeping large patches renderable without tokens. Cancel obsolete highlighting when a newer diff supersedes it.

* fix(server): keep diff cancellation with its requester

Independent commit viewers must not cancel each other. Use request-source cancellation for commit highlighting and cache invalidation for checkout highlighting. Oversized source versions use the existing budgeted hunk reconstruction so large lockfiles retain useful syntax tokens.
2026-10-27 09:56:36 +07:00

19 lines
714 B
TypeScript

export type { HighlightStyle, HighlightToken } from "./types.js";
export {
getLanguageForFile,
getParserForFile,
isLanguageSupported,
getSupportedExtensions,
} from "./parsers.js";
export { createCodeMirrorHighlightStyle } from "./syntax-roles.js";
export { highlightCode, highlightCodeInSteps, highlightLine } from "./highlighter.js";
export { darkHighlightColors, lightHighlightColors } from "./colors.js";
export type { SyntaxThemeId, SyntaxThemeOption, SyntaxColors } from "./themes.js";
export {
SYNTAX_THEME_IDS,
SYNTAX_THEME_OPTIONS,
isSyntaxThemeId,
resolveSyntaxColors,
} from "./themes.js";
export { highlightCodeWithBudget, HIGHLIGHT_MAX_SOURCE_BYTES } from "./budgeted-highlighter.js";