Skip to content

Commit 11e3581

Browse files
fix(language-server): invalidate caches + project graph on scanWorkspace
The manual `scanWorkspace` audit now drops the persistent lint cache and project metadata before re-scanning (mirroring the config-change / restart reset), so a user-triggered re-audit runs fresh instead of reusing stale per-file cache entries or project data. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 21fc393 commit 11e3581

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/language-server/src/server.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,13 @@ export const createServer = (connection: Connection): void => {
626626
const [firstArgument] = params.arguments ?? [];
627627
switch (params.command) {
628628
case COMMAND_SCAN_WORKSPACE: {
629-
// Drop in-flight background lint chunks so they can't apply stale
630-
// results after the full audit reconciles each project.
629+
// Manual re-audit: drop in-flight scans, cached per-file lint
630+
// results, and project metadata so the audit runs fresh against
631+
// current config / ignore / package data rather than reusing stale
632+
// cache entries on the old fingerprint.
631633
cancelAllProjectScans();
634+
scanRunner?.invalidateCaches();
635+
projectGraph?.invalidate();
632636
projectGraph?.refresh();
633637
scanWorkspaceFull();
634638
// The audit runs at background priority and so skips open buffers;

0 commit comments

Comments
 (0)