Skip to content

Conversation

@nirajkvinit
Copy link

@nirajkvinit nirajkvinit commented Feb 7, 2026

Summary

This PR modularizes the extension codebase and adds reliability/security hardening for file decoration updates in large or high-churn workspaces. Read CHANGELOG.md for more detailed information about the fixes

What Changed

  • Split monolithic logic into focused modules:
    • LineSight/src/cache.ts
    • LineSight/src/concurrency.ts
    • LineSight/src/config.ts
    • LineSight/src/constants.ts
    • LineSight/src/decorationProvider.ts
    • LineSight/src/fileFilter.ts
    • LineSight/src/fileWatcher.ts
    • LineSight/src/initialization.ts
    • LineSight/src/lineCounter.ts
    • LineSight/src/state.ts
    • LineSight/src/timer.ts
    • LineSight/src/types.ts
  • Kept LineSight/src/extension.ts as a thin entrypoint.
  • Added bounded LRU caches for metadata/count/decoration storage.
  • Added concurrency limiter with queue bounds and sync-throw safety.
  • Added stale-result protections around in-flight decoration counting.
  • Added queue caps + coalescing behavior for update storms.
  • Added workspace trust-aware startup behavior.
  • Added config normalization/hardening for folder/extension settings.
  • Added unit test setup with Mocha and VS Code mocking.
  • Added tests for cache, concurrency, config, filtering, line counting, and timer logic.
  • Updated package scripts and changelog.

Why

  • Improve maintainability and testability.
  • Prevent extension-host pressure in large repositories.
  • Reduce race-condition/stale-cache issues in async decoration flows.
  • Strengthen secure-by-default behavior in untrusted workspaces.

Validation

  • npm test passes (compile + lint + unit tests).
  • Unit coverage added across core pure/utility modules.
    screenshot

Notes / Follow-ups

  • Potential follow-up: guard refresh command behavior in untrusted workspaces.
  • Potential follow-up: add targeted tests for provider/watcher race/overflow paths.

…t settings

- replace shared debounce behavior with queued URI-set flushing to prevent dropped updates
- listen to file change/edit/save events so badges update reliably on content edits
- switch cache invalidation from size-only to {size, mtimeMs} to avoid stale same-size edits
- fix empty-file stream counting edge case
- normalize skip-path matching for cross-platform folder patterns
- track and dispose timers/watchers/provider state cleanly across refresh/deactivate
- remove intrusive startup popups and use status bar updates
- add linesight.* configuration schema (size limit, debounce, batch, excludes, include extensions, etc.)
- fix broken test script by making test run compile+lint
- update README settings section
- upgrade eslint/typescript-eslint/typescript dev toolchain to remove TS version warning
…ore extension modules, comprehensive test suite, and changelog.
…e counts in the hundreds, along with updated tests and documentation.
…ions for CI/CD and publishing, and rewrite the README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant