Fix CodeRabbit findings #11

Merged
Snider merged 1 commit from agent/fix-coderabbit-findings--verify-each-aga into dev 2026-03-24 11:33:20 +00:00

1 commit

Author SHA1 Message Date
Snider
1d6d891932 fix(coderabbit): address review findings
Some checks failed
Security Scan / security (pull_request) Successful in 8s
Test / test (pull_request) Failing after 27s
1. core_service.go: Return error when SetLanguage fails instead of
   silently discarding it.
2. grammar.go/service.go: Add MergeGrammarData() and use it in AddLoader
   and loadJSON so multiple loaders merge grammar entries instead of
   replacing the entire struct per language.
3. service.go: Document that package-level AddLoader is superseded when
   NewCoreService replaces the default — by design, not a bug.
4. service.go: Use CompareAndSwap in Init() to prevent TOCTOU race where
   a concurrent SetDefault could be overwritten.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 14:20:29 +00:00