aboutsummaryrefslogtreecommitdiff
path: root/src/background/controllers/CommandController.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/controllers/CommandController.ts')
-rw-r--r--src/background/controllers/CommandController.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/background/controllers/CommandController.ts b/src/background/controllers/CommandController.ts
index f3a6b7f..2ad1683 100644
--- a/src/background/controllers/CommandController.ts
+++ b/src/background/controllers/CommandController.ts
@@ -1,3 +1,4 @@
+import { injectable } from 'tsyringe';
import CompletionsUseCase from '../usecases/CompletionsUseCase';
import CommandUseCase from '../usecases/CommandUseCase';
import CompletionGroup from '../domains/CompletionGroup';
@@ -7,14 +8,12 @@ const trimStart = (str: string): string => {
return str.replace(/^\s+/, '');
};
+@injectable()
export default class CommandController {
- private completionsUseCase: CompletionsUseCase;
-
- private commandIndicator: CommandUseCase;
-
- constructor() {
- this.completionsUseCase = new CompletionsUseCase();
- this.commandIndicator = new CommandUseCase();
+ constructor(
+ private completionsUseCase: CompletionsUseCase,
+ private commandIndicator: CommandUseCase,
+ ) {
}
getCompletions(line: string): Promise<CompletionGroup[]> {