aboutsummaryrefslogtreecommitdiff
path: root/src/background/controllers
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-07-20 23:36:03 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-07-21 16:15:07 +0900
commitbf7c125fb214b52d67527bdd292a4b5bb81b1d32 (patch)
treea491d7b17a6cee685f134c019a0d624d32e13a3a /src/background/controllers
parent4d4aaa2c4ba9f09e23882287ce868c820aa900ee (diff)
My First Clean Architecture
Diffstat (limited to 'src/background/controllers')
-rw-r--r--src/background/controllers/completions.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/background/controllers/completions.js b/src/background/controllers/completions.js
new file mode 100644
index 0000000..613940f
--- /dev/null
+++ b/src/background/controllers/completions.js
@@ -0,0 +1,42 @@
+import CompletionsInteractor from '../usecases/completions';
+import Completions from '../domains/completions';
+
+export default class ContentMessageController {
+ constructor() {
+ this.completionsInteractor = new CompletionsInteractor();
+ }
+
+ getCompletions(line) {
+ let trimmed = line.trimStart();
+ let words = trimmed.split(/ +/);
+ let name = words[0];
+ if (words.length === 1) {
+ return this.completionsInteractor.queryConsoleCommand(name);
+ }
+ switch (words[0]) {
+ case 'o':
+ case 'open':
+ case 't':
+ case 'tabopen':
+ case 'w':
+ case 'winopen':
+ break;
+ case 'b':
+ case 'buffer':
+ break;
+ case 'bd!':
+ case 'bdel!':
+ case 'bdelete!':
+ case 'bdeletes!':
+ break;
+ case 'bd':
+ case 'bdel':
+ case 'bdelete':
+ case 'bdeletes':
+ break;
+ case 'set':
+ break;
+ }
+ return Promise.resolve(Completions.empty());
+ }
+}