MCPcopy
hub / github.com/ternjs/tern / loadPlugins

Function loadPlugins

lib/bootstrap.js:86–107  ·  view source on GitHub ↗
(projectDir, config, options)

Source from the content-addressed store, hash-verified

84}
85
86function loadPlugins(projectDir, config, options) {
87 var plugins = config.plugins, options = {};
88 for (var plugin in plugins) {
89 var val = plugins[plugin];
90 if (!val) continue;
91 var found = findFile(plugin + ".js", projectDir, path.resolve(distDir, "plugin"), options)
92 || resolveFrom(projectDir, "tern-" + plugin);
93 if (!found) {
94 try {
95 found = require.resolve("tern-" + plugin);
96 } catch (e) {
97 process.stderr.write("Failed to find plugin " + plugin + ".\n");
98 continue;
99 }
100 }
101 var mod = require(found);
102 if (mod.hasOwnProperty("initialize")) mod.initialize(distDir);
103 options[path.basename(plugin)] = val;
104 }
105
106 return options;
107}
108
109function startServer(dir, config, options) {
110 var defs = findDefs(dir, config, options);

Callers 1

startServerFunction · 0.85

Calls 1

findFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…