-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathphpcs.wpcs.js
56 lines (41 loc) · 1.53 KB
/
phpcs.wpcs.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
// @see https://cloud9-sdk.readme.io/docs/language-handlers
define(function(require, exports, module) {
main.consumes = ["Plugin", "language", "ui"];
main.provides = ["phpcs.wpcs"];
return main;
function main(options, imports, register) {
var Plugin = imports.Plugin;
/***** Initialization *****/
var plugin = new Plugin("EP4.com", main.consumes);
var language = imports.language;
var emit = plugin.getEmitter();
var ui = imports.ui;
function load() {
var path = options.packagePath.substr(0, options.packagePath.lastIndexOf("/"));
// Load PHPCS
language.registerLanguageHandler(
path + "/worker/phpcs_handler",
function(err, handler) {
if (err) return err;
// send/receive events using handler.emit/on
},
plugin
);
// Load custom CSS stylesheet.
ui.insertCss(require("text!./style.css"), options.staticPrefix, plugin);
}
/***** Methods *****/
/***** Lifecycle *****/
plugin.on("load", function() {
load();
});
plugin.on("unload", function() {
});
/***** Register and define API *****/
plugin.freezePublicAPI({
});
register(null, {
"phpcs.wpcs": plugin
});
}
});