Fix command and property completions

jh-changes
Shin'ya Ueoka 6 years ago
parent 1e39fed618
commit f555e1348c
  1. 7
      src/background/shared/completions/index.js

@ -113,6 +113,9 @@ const getSetCompletions = (command, keywords) => {
} }
]; ];
}).flat(); }).flat();
if (items.length === 0) {
return Promise.resolve([]);
}
return Promise.resolve([ return Promise.resolve([
{ {
name: 'Properties', name: 'Properties',
@ -126,6 +129,10 @@ const complete = (line, settings) => {
let words = trimmed.split(/ +/); let words = trimmed.split(/ +/);
let name = words[0]; let name = words[0];
if (words.length === 1) { if (words.length === 1) {
let items = completeCommands(name);
if (items.length === 0) {
return Promise.resolve([]);
}
return Promise.resolve([ return Promise.resolve([
{ {
name: 'Console Command', name: 'Console Command',