Skip to content

feat: detect Apex logs in .log/.txt files with content-based analysis#724

Merged
lcottercertinia merged 2 commits intocertinia:mainfrom
lukecotter:feat-file-lens-apex-logs-only
Feb 11, 2026
Merged

feat: detect Apex logs in .log/.txt files with content-based analysis#724
lcottercertinia merged 2 commits intocertinia:mainfrom
lukecotter:feat-file-lens-apex-logs-only

Conversation

@lukecotter
Copy link
Copy Markdown
Contributor

📝 PR Overview

Adds content-based Apex log detection so that .log and .txt files containing Apex debug logs get full extension support (decorations, CodeLens, context menus) without requiring manual language association.

🛠️ Changes made

  • Add ApexLogLanguageDetector that auto-detects Apex log content in .log/.txt files and sets the apexlog language
  • Set lana.isApexLog context key for detected files, enabling menus/commands on large files (>50MB) where activeTextEditor is unavailable
  • Update ShowAnalysisCodeLens to register on .log/.txt files with runtime isApexLogContent guard
  • Update LogTimingDecoration and RawLogLineDecoration to use content-based detection instead of languageId check
  • Remove .log/.txt from static language extensions in package.json (detection is now dynamic)
  • Add onStartupFinished activation event for early detection
  • Simplify isApexLogFile to use sync openSync/readSync/closeSync for 4KB reads instead of async streams
  • Use extname() from node:path instead of manual string slicing

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

🔗 Related Issues

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed

📚 Docs updated?

  • 🙅 not needed

Anything else we need to know?

  • isApexLogFile (sync disk read) is only used for the tab-API fallback path when files are >50MB and activeTextEditor is undefined. The 4KB sync read completes in <1ms.
  • The pre-existing SalesforceConnection.ts type error is unrelated to this PR.

@lcottercertinia lcottercertinia merged commit fdbaeb3 into certinia:main Feb 11, 2026
5 checks passed
@lukecotter lukecotter deleted the feat-file-lens-apex-logs-only branch February 12, 2026 01:03
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.

2 participants