Is your feature request related to a problem? Please describe.
The code-index manager constructs its service factory internally, and the service factory constructs its own embedder factory. This hides dependencies and spreads responsibility for their creation across consumers, making isolated testing and future changes harder.
Describe the solution you'd like
Use dependency injection to supply the code-index service factory and its embedder factory rather than constructing them inside their consumers.
Build on the workspace scope introduced in #1766:
- Assemble the factory dependencies outside the manager and retain them in the workspace scope.
- Pass the service factory from the scope into the manager, and supply the embedder factory to the service factory through its existing interface.
- Keep workspace-specific configuration and cache dependencies isolated between workspaces.
- Preserve current initialization, settings-change handling, service recreation, and cleanup behavior. Reusing factories must not reuse stale configuration or embedder instances.
- Allow tests to provide substitute factories without mocking concrete constructors.
Describe alternatives you've considered
Keeping internal factory construction preserves the current coupling. A shared global factory would not make workspace ownership explicit. Prefer explicit dependency passing through the workspace scope.
Additional context
Depends on #1766, which introduces the workspace scope behind the manager registry. Extend that scope rather than adding a parallel ownership mechanism.
This also builds on the embedder-factory refactoring in the current working branch. Keep this follow-up focused on dependency wiring, not provider redesign or a new DI framework.
Verify factory injection, reuse within a workspace scope, isolation between workspaces, fresh configuration on service recreation, and cleanup/reinitialization. Existing indexing and search behavior, including Semble, must remain unchanged.
Is your feature request related to a problem? Please describe.
The code-index manager constructs its service factory internally, and the service factory constructs its own embedder factory. This hides dependencies and spreads responsibility for their creation across consumers, making isolated testing and future changes harder.
Describe the solution you'd like
Use dependency injection to supply the code-index service factory and its embedder factory rather than constructing them inside their consumers.
Build on the workspace scope introduced in #1766:
Describe alternatives you've considered
Keeping internal factory construction preserves the current coupling. A shared global factory would not make workspace ownership explicit. Prefer explicit dependency passing through the workspace scope.
Additional context
Depends on #1766, which introduces the workspace scope behind the manager registry. Extend that scope rather than adding a parallel ownership mechanism.
This also builds on the embedder-factory refactoring in the current working branch. Keep this follow-up focused on dependency wiring, not provider redesign or a new DI framework.
Verify factory injection, reuse within a workspace scope, isolation between workspaces, fresh configuration on service recreation, and cleanup/reinitialization. Existing indexing and search behavior, including Semble, must remain unchanged.