-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextension.js
75 lines (64 loc) · 1.99 KB
/
extension.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const vscode = require('vscode');
const {
createCompletionProvider,
dependencyInjectionCompletionProvider,
createClassCompletionProvider,
eventCompletionProvider
} = require('./features/completionProvider');
const { createClassTemplate } = require('./features/templateGenerator');
const createModule = require('./features/createModuel');
/**
* @param {vscode.ExtensionContext} context
*/
function activate(context) {
// Class importer completion provider.
context.subscriptions.push(
vscode.languages.registerCompletionItemProvider(
{ scheme: 'file', language: 'php' },
createCompletionProvider(),
'wk'
)
);
// Dependency Injection Completion Provider.
context.subscriptions.push(
vscode.languages.registerCompletionItemProvider(
{ language: 'php', scheme: 'file' },
dependencyInjectionCompletionProvider(),
'wkpr' // Trigger on `wkpr`
)
);
context.subscriptions.push(
vscode.languages.registerCompletionItemProvider(
{ language: 'php', scheme: 'file' },
eventCompletionProvider(),
'wkev' // Trigger on `wkev`
)
);
// Provider for generate class.
context.subscriptions.push(
vscode.languages.registerCompletionItemProvider(
{ scheme: 'file', language: 'php' },
createClassCompletionProvider(),
'wk'
)
);
// Register Command Cor Generator Class Template
context.subscriptions.push(
vscode.commands.registerCommand(
'extension.generateClassTemplate',
createClassTemplate
)
);
// Register Command For Create Moduel.
context.subscriptions.push(
vscode.commands.registerCommand(
'extension.createModule', // Command identifier
createModule // Reference to the imported command
)
);
}
function deactivate() { }
module.exports = {
activate,
deactivate,
};