-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patharray.ts
35 lines (32 loc) · 1.54 KB
/
array.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { languages, CompletionItem, CompletionItemKind } from 'vscode';
import { createCompletionItemKindMethod } from '../misc/createCompletionItemKindFn';
export default languages.registerCompletionItemProvider('aiscript', {
provideCompletionItems(document, position) {
const linePrefix = document.lineAt(position).text.slice(0, position.character);
if (!(/\]\.$/).test(linePrefix)) {
return undefined;
}
return [
new CompletionItem('len', CompletionItemKind.Variable),
createCompletionItemKindMethod('push'),
createCompletionItemKindMethod('unshift'),
createCompletionItemKindMethod('pop'),
createCompletionItemKindMethod('shift'),
createCompletionItemKindMethod('concat'),
createCompletionItemKindMethod('join'),
createCompletionItemKindMethod('slice'),
createCompletionItemKindMethod('incl'),
createCompletionItemKindMethod('map'),
createCompletionItemKindMethod('reduce'),
createCompletionItemKindMethod('find'),
createCompletionItemKindMethod('reverse'),
createCompletionItemKindMethod('copy'),
createCompletionItemKindMethod('sort'),
createCompletionItemKindMethod('fill'),
createCompletionItemKindMethod('repeat'),
createCompletionItemKindMethod('index_of'),
createCompletionItemKindMethod('every'),
createCompletionItemKindMethod('some'),
];
}
}, '.');