Skip to content

Commit 77c0ab8

Browse files
committed
updated language server and vscode-arduino-tools
1 parent 723a942 commit 77c0ab8

File tree

4 files changed

+70
-61
lines changed

4 files changed

+70
-61
lines changed

arduino-ide-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
],
147147
"arduino": {
148148
"cli": {
149-
"version": "0.20.0-rc3"
149+
"version": "0.20.0"
150150
},
151151
"fwuploader": {
152152
"version": "2.0.0"

arduino-ide-extension/scripts/download-ls.js

Lines changed: 67 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,78 @@
44
// - https://downloads.arduino.cc/arduino-language-server/clangd/clangd_${VERSION}_${SUFFIX}
55

66
(() => {
7+
const DEFAULT_ALS_VERSION = '0.5.0-rc1';
8+
const DEFAULT_CLANGD_VERSION = 'snapshot_20210124';
79

8-
const DEFAULT_ALS_VERSION = 'nightly';
9-
const DEFAULT_CLANGD_VERSION = 'snapshot_20210124';
10+
const path = require('path');
11+
const shell = require('shelljs');
12+
const downloader = require('./downloader');
1013

11-
const path = require('path');
12-
const shell = require('shelljs');
13-
const downloader = require('./downloader');
14+
const yargs = require('yargs')
15+
.option('ls-version', {
16+
alias: 'lv',
17+
default: DEFAULT_ALS_VERSION,
18+
describe: `The version of the 'arduino-language-server' to download. Defaults to ${DEFAULT_ALS_VERSION}.`,
19+
})
20+
.option('clangd-version', {
21+
alias: 'cv',
22+
default: DEFAULT_CLANGD_VERSION,
23+
choices: ['snapshot_20210124'],
24+
describe: `The version of 'clangd' to download. Defaults to ${DEFAULT_CLANGD_VERSION}.`,
25+
})
26+
.option('force-download', {
27+
alias: 'fd',
28+
default: false,
29+
describe: `If set, this script force downloads the 'arduino-language-server' even if it already exists on the file system.`,
30+
})
31+
.version(false)
32+
.parse();
1433

15-
const yargs = require('yargs')
16-
.option('ls-version', {
17-
alias: 'lv',
18-
default: DEFAULT_ALS_VERSION,
19-
choices: ['nightly'],
20-
describe: `The version of the 'arduino-language-server' to download. Defaults to ${DEFAULT_ALS_VERSION}.`
21-
})
22-
.option('clangd-version', {
23-
alias: 'cv',
24-
default: DEFAULT_CLANGD_VERSION,
25-
choices: ['snapshot_20210124'],
26-
describe: `The version of 'clangd' to download. Defaults to ${DEFAULT_CLANGD_VERSION}.`
27-
})
28-
.option('force-download', {
29-
alias: 'fd',
30-
default: false,
31-
describe: `If set, this script force downloads the 'arduino-language-server' even if it already exists on the file system.`
32-
})
33-
.version(false).parse();
34+
const alsVersion = yargs['ls-version'];
35+
const clangdVersion = yargs['clangd-version'];
36+
const force = yargs['force-download'];
37+
const { platform, arch } = process;
3438

35-
const alsVersion = yargs['ls-version'];
36-
const clangdVersion = yargs['clangd-version']
37-
const force = yargs['force-download'];
38-
const { platform, arch } = process;
39+
const build = path.join(__dirname, '..', 'build');
40+
const lsExecutablePath = path.join(
41+
build,
42+
`arduino-language-server${platform === 'win32' ? '.exe' : ''}`
43+
);
3944

40-
const build = path.join(__dirname, '..', 'build');
41-
const lsExecutablePath = path.join(build, `arduino-language-server${platform === 'win32' ? '.exe' : ''}`);
45+
let clangdExecutablePath, lsSuffix, clangdPrefix;
46+
switch (platform) {
47+
case 'darwin':
48+
clangdExecutablePath = path.join(build, 'bin', 'clangd');
49+
lsSuffix = 'macOS_64bit.tar.gz';
50+
clangdPrefix = 'mac';
51+
break;
52+
case 'linux':
53+
clangdExecutablePath = path.join(build, 'bin', 'clangd');
54+
lsSuffix = 'Linux_64bit.tar.gz';
55+
clangdPrefix = 'linux';
56+
break;
57+
case 'win32':
58+
clangdExecutablePath = path.join(build, 'bin', 'clangd.exe');
59+
lsSuffix = 'Windows_64bit.zip';
60+
clangdPrefix = 'windows';
61+
break;
62+
}
63+
if (!lsSuffix) {
64+
shell.echo(
65+
`The arduino-language-server is not available for ${platform} ${arch}.`
66+
);
67+
shell.exit(1);
68+
}
4269

43-
let clangdExecutablePath, lsSuffix, clangdPrefix;
44-
switch (platform) {
45-
case 'darwin':
46-
clangdExecutablePath = path.join(build, 'bin', 'clangd')
47-
lsSuffix = 'macOS_amd64.zip';
48-
clangdPrefix = 'mac';
49-
break;
50-
case 'linux':
51-
clangdExecutablePath = path.join(build, 'bin', 'clangd')
52-
lsSuffix = 'Linux_amd64.zip';
53-
clangdPrefix = 'linux'
54-
break;
55-
case 'win32':
56-
clangdExecutablePath = path.join(build, 'bin', 'clangd.exe')
57-
lsSuffix = 'Windows_amd64.zip';
58-
clangdPrefix = 'windows';
59-
break;
60-
}
61-
if (!lsSuffix) {
62-
shell.echo(`The arduino-language-server is not available for ${platform} ${arch}.`);
63-
shell.exit(1);
64-
}
65-
66-
const alsUrl = `https://downloads.arduino.cc/arduino-language-server/${alsVersion === 'nightly' ? 'nightly/arduino-language-server' : 'arduino-language-server_' + alsVersion}_${lsSuffix}`;
67-
downloader.downloadUnzipAll(alsUrl, build, lsExecutablePath, force);
68-
69-
const clangdUrl = `https://downloads.arduino.cc/arduino-language-server/clangd/clangd-${clangdPrefix}-${clangdVersion}.zip`;
70-
downloader.downloadUnzipAll(clangdUrl, build, clangdExecutablePath, force, { strip: 1 }); // `strip`: the new clangd (12.x) is zipped into a folder, so we have to strip the outmost folder.
70+
const alsUrl = `https://downloads.arduino.cc/arduino-language-server/${
71+
alsVersion === 'nightly'
72+
? 'nightly/arduino-language-server'
73+
: 'arduino-language-server_' + alsVersion
74+
}_${lsSuffix}`;
75+
downloader.downloadUnzipAll(alsUrl, build, lsExecutablePath, force);
7176

77+
const clangdUrl = `https://downloads.arduino.cc/arduino-language-server/clangd/clangd-${clangdPrefix}-${clangdVersion}.zip`;
78+
downloader.downloadUnzipAll(clangdUrl, build, clangdExecutablePath, force, {
79+
strip: 1,
80+
}); // `strip`: the new clangd (12.x) is zipped into a folder, so we have to strip the outmost folder.
7281
})();

electron/build/template-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
"theiaPluginsDir": "plugins",
140140
"theiaPlugins": {
141141
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",
142-
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/nightly/vscode-arduino-tools-0.0.1-beta.1.vsix",
142+
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.1.vsix",
143143
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
144144
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
145145
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"theiaPluginsDir": "plugins",
6767
"theiaPlugins": {
6868
"vscode-builtin-cpp": "https://open-vsx.org/api/vscode/cpp/1.52.1/file/vscode.cpp-1.52.1.vsix",
69-
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/nightly/vscode-arduino-tools-0.0.1-beta.1.vsix",
69+
"vscode-arduino-tools": "https://downloads.arduino.cc/vscode-arduino-tools/vscode-arduino-tools-0.0.2-beta.1.vsix",
7070
"vscode-builtin-json": "https://open-vsx.org/api/vscode/json/1.46.1/file/vscode.json-1.46.1.vsix",
7171
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
7272
"cortex-debug": "https://open-vsx.org/api/marus25/cortex-debug/0.3.10/file/marus25.cortex-debug-0.3.10.vsix"

0 commit comments

Comments
 (0)