Skip to content

Commit 419f772

Browse files
author
Akos Kitta
committed
feat: use Arduino CLI 0.36.0-rc.1 APIs
Signed-off-by: Akos Kitta <[email protected]>
1 parent ca779e5 commit 419f772

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+5535
-3273
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ on:
4545

4646
env:
4747
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
48-
GO_VERSION: '1.19'
48+
GO_VERSION: '1.21'
4949
# See: https://github.com/actions/setup-node/#readme
5050
NODE_VERSION: '18.17'
5151
JOB_TRANSFER_ARTIFACT: build-artifacts

.github/workflows/check-i18n-task.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Internationalization
22

33
env:
44
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
5-
GO_VERSION: '1.19'
5+
GO_VERSION: '1.21'
66

77
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
88
on:

.github/workflows/i18n-nightly-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: i18n-nightly-push
22

33
env:
44
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
5-
GO_VERSION: '1.19'
5+
GO_VERSION: '1.21'
66

77
on:
88
schedule:

.github/workflows/i18n-weekly-pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: i18n-weekly-pull
22

33
env:
44
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
5-
GO_VERSION: '1.19'
5+
GO_VERSION: '1.21'
66

77
on:
88
schedule:

.github/workflows/themes-weekly-pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
11-
GO_VERSION: '1.19'
11+
GO_VERSION: '1.21'
1212
NODE_VERSION: '18.17'
1313

1414
jobs:

arduino-ide-extension/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,17 @@
169169
],
170170
"arduino": {
171171
"arduino-cli": {
172-
"version": "0.35.2"
172+
"version": "0.36.0-rc.1"
173173
},
174174
"arduino-fwuploader": {
175175
"version": "2.4.1"
176176
},
177177
"arduino-language-server": {
178-
"version": "0.7.6"
178+
"version": {
179+
"owner": "arduino",
180+
"repo": "arduino-language-server",
181+
"commitish": "91c2ba8"
182+
}
179183
},
180184
"clangd": {
181185
"version": "14.0.0"

arduino-ide-extension/scripts/generate-protocol.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
(async () => {
44
const os = require('node:os');
55
const path = require('node:path');
6-
const { mkdirSync, promises: fs } = require('node:fs');
6+
const { mkdirSync, promises: fs, rmSync } = require('node:fs');
77
const { exec } = require('./utils');
88
const glob = require('glob');
99
const { SemVer, gte, valid: validSemVer } = require('semver');
@@ -140,6 +140,10 @@
140140

141141
const rpc = path.join(repository, 'rpc');
142142
const out = path.join(__dirname, '..', 'src', 'node', 'cli-protocol');
143+
// Must wipe the gen output folder. Otherwise, dangling service implementation remain in IDE2 code,
144+
// although it has been removed from the proto file.
145+
// For example, https://github.com/arduino/arduino-cli/commit/50a8bf5c3e61d5b661ccfcd6a055e82eeb510859.
146+
rmSync(out, { recursive: true, maxRetries: 5, force: true });
143147
mkdirSync(out, { recursive: true });
144148

145149
const protos = await new Promise((resolve) =>

arduino-ide-extension/src/browser/contributions/ino-language.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ export class InoLanguage extends SketchContribution {
196196
forceStart = false
197197
): Promise<void> {
198198
const port = await this.daemon.tryGetPort();
199-
if (!port) {
200-
return;
201-
}
202-
const portNumber = Number.parseInt(port, 10); // TODO: IDE2 APIs should provide a number and not string
203-
if (Number.isNaN(portNumber)) {
199+
if (typeof port !== 'number') {
204200
return;
205201
}
206202
const release = await this.languageServerStartMutex.acquire();
@@ -280,7 +276,7 @@ export class InoLanguage extends SketchContribution {
280276
lsPath,
281277
daemonAddress: {
282278
hostname: 'localhost',
283-
port: portNumber,
279+
port,
284280
instance: 1, // TODO: get it from the backend
285281
},
286282
clangdPath,

arduino-ide-extension/src/browser/notification-center.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class NotificationCenter
4646
new Emitter<ProgressMessage>();
4747
private readonly indexUpdateDidFailEmitter =
4848
new Emitter<IndexUpdateDidFailParams>();
49-
private readonly daemonDidStartEmitter = new Emitter<string>();
49+
private readonly daemonDidStartEmitter = new Emitter<number>();
5050
private readonly daemonDidStopEmitter = new Emitter<void>();
5151
private readonly configDidChangeEmitter = new Emitter<ConfigState>();
5252
private readonly platformDidInstallEmitter = new Emitter<{
@@ -136,7 +136,7 @@ export class NotificationCenter
136136
this.indexUpdateDidFailEmitter.fire(params);
137137
}
138138

139-
notifyDaemonDidStart(port: string): void {
139+
notifyDaemonDidStart(port: number): void {
140140
this.daemonDidStartEmitter.fire(port);
141141
}
142142

arduino-ide-extension/src/browser/theia/core/connection-status-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export class DaemonPort implements FrontendApplicationContribution {
7474
@inject(NotificationCenter)
7575
private readonly notificationCenter: NotificationCenter;
7676

77-
private readonly onPortDidChangeEmitter = new Emitter<string | undefined>();
78-
private _port: string | undefined;
77+
private readonly onPortDidChangeEmitter = new Emitter<number | undefined>();
78+
private _port: number | undefined;
7979

8080
onStart(): void {
8181
this.daemon.tryGetPort().then(
@@ -91,15 +91,15 @@ export class DaemonPort implements FrontendApplicationContribution {
9191
this.onPortDidChangeEmitter.dispose();
9292
}
9393

94-
get port(): string | undefined {
94+
get port(): number | undefined {
9595
return this._port;
9696
}
9797

98-
get onDidChangePort(): Event<string | undefined> {
98+
get onDidChangePort(): Event<number | undefined> {
9999
return this.onPortDidChangeEmitter.event;
100100
}
101101

102-
private setPort(port: string | undefined): void {
102+
private setPort(port: number | undefined): void {
103103
const oldPort = this._port;
104104
this._port = port;
105105
if (this._port !== oldPort) {

0 commit comments

Comments
 (0)