@github/copilot-language-server 1.394.0 → 1.396.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/language-server.js +20 -11
- package/dist/main.js +813 -720
- package/dist/main.js.map +3 -3
- package/dist/tfidfWorker.js +20 -20
- package/dist/tfidfWorker.js.map +2 -2
- package/package.json +7 -7
package/dist/language-server.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const minMajor = 22;
|
|
4
|
+
const minMinor = 0;
|
|
4
5
|
|
|
5
|
-
function
|
|
6
|
+
function main() {
|
|
7
|
+
const argv = process.argv.slice(2);
|
|
6
8
|
const version = process.versions.node;
|
|
7
|
-
const [major] = version.split('.').map(v => parseInt(v, 10));
|
|
8
|
-
if (major
|
|
9
|
-
return
|
|
9
|
+
const [major, minor] = version.split('.').map(v => parseInt(v, 10));
|
|
10
|
+
if (major > minMajor || (major === minMajor && minor >= minMinor)) {
|
|
11
|
+
return require('./main').main();
|
|
10
12
|
}
|
|
11
|
-
}
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
if (!argv.includes('--node-ipc')) {
|
|
15
|
+
const path = require('node:path');
|
|
16
|
+
const root = path.join(__dirname, '..', '..', `copilot-language-server-${process.platform}-${process.arch}`);
|
|
17
|
+
const exe = path.join(root, `copilot-language-server${process.platform === 'win32' ? '.exe' : ''}`);
|
|
18
|
+
const cp = require('node:child_process');
|
|
19
|
+
const result = cp.spawnSync(exe, argv, {stdio: 'inherit'});
|
|
20
|
+
if (typeof result.status === 'number') {
|
|
21
|
+
process.exit(result.status);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
console.error(`Node.js ${minMajor}.${minMinor} is required to run GitHub Copilot but found ${version}`);
|
|
16
25
|
// An exit code of X indicates a recommended minimum Node.js version of X.0.
|
|
17
26
|
// Providing a recommended major version via exit code is an affordance for
|
|
18
27
|
// implementations like Copilot.vim, where Neovim buries stderr in a log
|
|
19
28
|
// file the user is unlikely to see.
|
|
20
|
-
process.exit(
|
|
29
|
+
process.exit(minMajor + (minMinor ? 2 : 0));
|
|
21
30
|
}
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
main();
|