mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
clean up file
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
bfc7302fba
commit
dc2d32670b
@ -45,10 +45,10 @@ const COMMANDS = [
|
|||||||
command: '/ddg',
|
command: '/ddg',
|
||||||
args: '<query>',
|
args: '<query>',
|
||||||
description: 'Searches DuckDuckGo for results',
|
description: 'Searches DuckDuckGo for results',
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
let COMMAND_RE = /(^\/\w*)/g;
|
const COMMAND_RE = /(^\/\w*)/g;
|
||||||
|
|
||||||
let instance = null;
|
let instance = null;
|
||||||
|
|
||||||
@ -62,9 +62,9 @@ export default class CommandProvider extends AutocompleteProvider {
|
|||||||
|
|
||||||
async getCompletions(query: string, selection: {start: number, end: number}) {
|
async getCompletions(query: string, selection: {start: number, end: number}) {
|
||||||
let completions = [];
|
let completions = [];
|
||||||
let {command, range} = this.getCurrentCommand(query, selection);
|
const {command, range} = this.getCurrentCommand(query, selection);
|
||||||
if (command) {
|
if (command) {
|
||||||
completions = this.fuse.search(command[0]).map(result => {
|
completions = this.fuse.search(command[0]).map((result) => {
|
||||||
return {
|
return {
|
||||||
completion: result.command + ' ',
|
completion: result.command + ' ',
|
||||||
component: (<TextualCompletion
|
component: (<TextualCompletion
|
||||||
@ -84,8 +84,7 @@ export default class CommandProvider extends AutocompleteProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static getInstance(): CommandProvider {
|
static getInstance(): CommandProvider {
|
||||||
if (instance == null)
|
if (instance === null) instance = new CommandProvider();
|
||||||
{instance = new CommandProvider();}
|
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user