perf(comment-checker): add LSP-style background language warming

- Warmup common languages (python, typescript, javascript, tsx, go, rust, java) on plugin init
- Non-blocking background initialization using Promise.then() pattern
- First parse call uses pre-cached language - zero user wait time
- Refactor parser manager with ManagedLanguage interface for better state tracking
This commit is contained in:
YeonGyu-Kim
2025-12-05 11:02:35 +09:00
parent 50ea492065
commit fd6e230889
4 changed files with 313 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
import type { PendingCall, FileComments } from "./types"
import { detectComments, isSupportedFile } from "./detector"
import { detectComments, isSupportedFile, warmupCommonLanguages } from "./detector"
import { applyFilters } from "./filters"
import { formatHookMessage } from "./output"
@@ -32,6 +32,9 @@ setInterval(cleanupOldPendingCalls, 10_000)
export function createCommentCheckerHooks() {
debugLog("createCommentCheckerHooks called")
// Background warmup - LSP style (non-blocking)
warmupCommonLanguages()
return {
"tool.execute.before": async (
input: { tool: string; sessionID: string; callID: string },