aboutsummaryrefslogtreecommitdiff
path: root/src/background/usecases/completions.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/background/usecases/completions.js')
-rw-r--r--src/background/usecases/completions.js32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/background/usecases/completions.js b/src/background/usecases/completions.js
index fc1ff52..21049d2 100644
--- a/src/background/usecases/completions.js
+++ b/src/background/usecases/completions.js
@@ -22,19 +22,39 @@ export default class CompletionsInteractor {
if (items.length === 0) {
return Promise.resolve(Completions.empty());
}
- return Promise.resolve(new Completions(
- [new CompletionGroup('Console Command', items)]
- ));
+ return Promise.resolve(
+ new Completions([new CompletionGroup('Console Command', items)])
+ );
}
- async queryBdeleteCommand(name, force, args) {
- let tabs = await this.completionRepository.queryTabs(args);
+ queryOpen() {
+ return Promise.resolve(Completions.empty());
+ }
+
+ queryBuffer(name, keywords) {
+ return this.queryTabs(name, true, keywords);
+ }
+
+ queryBdelete(name, keywords) {
+ return this.queryTabs(name, true, keywords);
+ }
+
+ queryBdeleteForce(name, keywords) {
+ return this.queryTabs(name, false, keywords);
+ }
+
+ querySet() {
+ return Promise.resolve(Completions.empty());
+ }
+
+ async queryTabs(name, excludePinned, args) {
+ let tabs = await this.completionRepository.queryTabs(args, excludePinned);
let items = tabs.map(tab => new CompletionItem({
caption: tab.title,
content: name + ' ' + tab.title,
url: tab.url,
icon: tab.favIconUrl
}));
- return [new CompletionGroup('Buffers', items)];
+ return new Completions([new CompletionGroup('Buffers', items)]);
}
}