Skip to content

Index phase 4: seal the index module boundary - #84

Merged
rochala merged 2 commits into
mainfrom
index/phase4-seal-boundary
May 26, 2026
Merged

rochala merged 2 commits into
mainfrom
index/phase4-seal-boundary

Conversation

@rochala

@rochala rochala commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ProjectIndex and DependencyIndex are now private[index]. SymbolIndex's project / dependency constructor params become private[index] val so IndexManager keeps write access while everything outside the package only sees the SymbolIndex façade.
  • IndexManager takes a SymbolIndex (not the two raw stores) and exposes updateOpenFile(uri, syms, refs) — the new verb replacing the symbolIndex.project.updateFiles(...) reach-through in ServerImpl.pcDiagnostics.
  • Introspection (projectSymbolCount, dependencySymbolCount, fileCount, jarCount, allReferenceTargets — renamed from the dishonest debugReferenceKeys) lives on SymbolIndex.
  • SimpleLanguageServer builds the façade via SymbolIndex.empty and no longer names ProjectIndex / DependencyIndex.

Phase 4 success criteria

Both greps from ai/architecture-improvements.md return zero hits:

grep -r "ProjectIndex\|DependencyIndex" sls/src   # outside sls/src/org/scala/abusers/sls/index/
grep -r "symbolIndex.project\|symbolIndex.dependency" sls/src

Test plan

  • ./mill __.compile clean
  • ./mill sls.test green (598/598)
  • Both phase-4 grep success criteria are zero hits

🤖 Generated with Claude Code

ProjectIndex and DependencyIndex become `private[index]`. SymbolIndex's
`project` / `dependency` are now `private[index] val` so IndexManager
(same package) keeps write access while everything outside the index
package only sees the SymbolIndex façade.

IndexManager takes a SymbolIndex (not the two raw stores) and owns
`updateOpenFile(uri, syms, refs)` — the new verb replacing the
`symbolIndex.project.updateFiles(...)` reach-through in
ServerImpl.pcDiagnostics. Introspection (`projectSymbolCount`,
`dependencySymbolCount`, `fileCount`, `jarCount`, `allReferenceTargets`
— renamed from the dishonest `debugReferenceKeys`) lives on SymbolIndex.

SimpleLanguageServer builds the façade via `SymbolIndex.empty`; it no
longer names ProjectIndex / DependencyIndex.

Both phase-4 grep success criteria are zero hits:
  grep -r "ProjectIndex\|DependencyIndex" sls/src
    outside sls/src/org/scala/abusers/sls/index/
  grep -r "symbolIndex.project\|symbolIndex.dependency" sls/src

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
`defaultWithAlign` should line up the `=` of the five adjacent
introspection defs at the column of the widest signature
(`allReferenceTargets`).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@rochala
rochala merged commit 20cc4aa into main May 26, 2026
1 check passed
@rochala
rochala deleted the index/phase4-seal-boundary branch May 26, 2026 06:51
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