Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd76f91

Browse files
authored
Update Theia, CLI and LS (#610)
* Update Theia to 1.19.0 * update CLI to 0.20.0-rc3 * Add language selector to settings * updated language server and vscode-arduino-tools * update Language Server flags * get cli port from config * force native menu on windows * pinned Language Server to rc2 * fix search icon * update CLI version
1 parent 6e34a27 commit dd76f91

File tree

97 files changed

+1462
-1335
lines changed

Some content is hidden

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

97 files changed

+1462
-1335
lines changed

‎arduino-ide-extension/package.json‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
"dependencies": {
2222
"arduino-serial-plotter-webapp": "0.0.15",
2323
"@grpc/grpc-js": "^1.3.7",
24-
"@theia/application-package": "1.18.0",
25-
"@theia/core": "1.18.0",
26-
"@theia/editor": "1.18.0",
27-
"@theia/editor-preview": "1.18.0",
28-
"@theia/filesystem": "1.18.0",
29-
"@theia/git": "1.18.0",
30-
"@theia/keymaps": "1.18.0",
31-
"@theia/markers": "1.18.0",
32-
"@theia/monaco": "1.18.0",
33-
"@theia/navigator": "1.18.0",
34-
"@theia/outline-view": "1.18.0",
35-
"@theia/output": "1.18.0",
36-
"@theia/preferences": "1.18.0",
37-
"@theia/search-in-workspace": "1.18.0",
38-
"@theia/terminal": "1.18.0",
39-
"@theia/workspace": "1.18.0",
24+
"@theia/application-package": "1.19.0",
25+
"@theia/core": "1.19.0",
26+
"@theia/editor": "1.19.0",
27+
"@theia/editor-preview": "1.19.0",
28+
"@theia/filesystem": "1.19.0",
29+
"@theia/git": "1.19.0",
30+
"@theia/keymaps": "1.19.0",
31+
"@theia/markers": "1.19.0",
32+
"@theia/monaco": "1.19.0",
33+
"@theia/navigator": "1.19.0",
34+
"@theia/outline-view": "1.19.0",
35+
"@theia/output": "1.19.0",
36+
"@theia/preferences": "1.19.0",
37+
"@theia/search-in-workspace": "1.19.0",
38+
"@theia/terminal": "1.19.0",
39+
"@theia/workspace": "1.19.0",
4040
"@tippyjs/react": "^4.2.5",
4141
"@types/atob": "^2.1.2",
4242
"@types/auth0-js": "^9.14.0",
@@ -149,7 +149,7 @@
149149
],
150150
"arduino": {
151151
"cli": {
152-
"version": "0.20.0"
152+
"version": "0.20.1"
153153
},
154154
"fwuploader": {
155155
"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-rc2';
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
})();

‎arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx‎

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
import { inject, injectable, postConstruct } from 'inversify';
2+
import * as React from 'react';
3+
import { remote } from 'electron';
4+
import {
5+
BoardsService,
6+
Port,
7+
SketchesService,
8+
ExecutableService,
9+
Sketch,
10+
} from '../common/protocol';
111
import { Mutex } from 'async-mutex';
212
import {
313
MAIN_MENU_BAR,
@@ -13,7 +23,7 @@ import {
1323
StatusBar,
1424
StatusBarAlignment,
1525
} from '@theia/core/lib/browser';
16-
import { nls } from '@theia/core/lib/browser/nls';
26+
import { nls } from '@theia/core/lib/common';
1727
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
1828
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
1929
import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';
@@ -40,16 +50,10 @@ import { OutputContribution } from '@theia/output/lib/browser/output-contributio
4050
import { ScmContribution } from '@theia/scm/lib/browser/scm-contribution';
4151
import { SearchInWorkspaceFrontendContribution } from '@theia/search-in-workspace/lib/browser/search-in-workspace-frontend-contribution';
4252
import { TerminalMenus } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
43-
import { inject, injectable, postConstruct } from 'inversify';
44-
import * as React from 'react';
45-
import { remote } from 'electron';
46-
import {
47-
BoardsService,
48-
Port,
49-
SketchesService,
50-
ExecutableService,
51-
Sketch,
52-
} from '../common/protocol';
53+
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin';
54+
import { FileService } from '@theia/filesystem/lib/browser/file-service';
55+
import { FileChangeType } from '@theia/filesystem/lib/browser';
56+
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
5357
import { ConfigService } from '../common/protocol/config-service';
5458
import { ArduinoCommands } from './arduino-commands';
5559
import { BoardsConfig } from './boards/boards-config';
@@ -60,13 +64,9 @@ import { EditorMode } from './editor-mode';
6064
import { ArduinoMenus } from './menu/arduino-menus';
6165
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
6266
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
63-
import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin';
64-
import { FileService } from '@theia/filesystem/lib/browser/file-service';
6567
import { ArduinoPreferences } from './arduino-preferences';
6668
import { SketchesServiceClientImpl } from '../common/protocol/sketches-service-client-impl';
6769
import { SaveAsSketch } from './contributions/save-as-sketch';
68-
import { FileChangeType } from '@theia/filesystem/lib/browser';
69-
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
7070
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
7171

7272
const INIT_AVR_PACKAGES = 'initializedAvrPackages';
@@ -340,15 +340,14 @@ export class ArduinoFrontendContribution
340340
);
341341
}
342342
}
343-
const { clangdUri, cliUri,lsUri } = await this.executableService.list();
344-
const [clangdPath, cliPath,lsPath,cliConfigPath] = await Promise.all([
343+
const { clangdUri, lsUri } = await this.executableService.list();
344+
const [clangdPath, lsPath] = await Promise.all([
345345
this.fileService.fsPath(new URI(clangdUri)),
346-
this.fileService.fsPath(new URI(cliUri)),
347346
this.fileService.fsPath(new URI(lsUri)),
348-
this.fileService.fsPath(
349-
new URI(await this.configService.getCliConfigFileUri())
350-
),
351347
]);
348+
349+
const config = await this.configService.getConfiguration();
350+
352351
this.languageServerFqbn = await Promise.race([
353352
new Promise<undefined>((_, reject) =>
354353
setTimeout(
@@ -360,10 +359,10 @@ export class ArduinoFrontendContribution
360359
'arduino.languageserver.start',
361360
{
362361
lsPath,
363-
cliPath,
362+
cliDaemonAddr: `localhost:${config.daemon.port}`,
364363
clangdPath,
365364
log: currentSketchPath ? currentSketchPath : log,
366-
cliConfigPath,
365+
cliDaemonInstance: '1',
367366
board: {
368367
fqbn,
369368
name: name ? `"${name}"` : undefined,

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ import {
154154
} from '../common/protocol/examples-service';
155155
import { BuiltInExamples, LibraryExamples } from './contributions/examples';
156156
import { IncludeLibrary } from './contributions/include-library';
157-
import { OutputChannelManager as TheiaOutputChannelManager } from '@theia/output/lib/common/output-channel';
157+
import { OutputChannelManager as TheiaOutputChannelManager } from '@theia/output/lib/browser/output-channel';
158158
import { OutputChannelManager } from './theia/output/output-channel';
159159
import {
160160
OutputChannelRegistryMainImpl as TheiaOutputChannelRegistryMainImpl,
@@ -190,12 +190,12 @@ import { BoardSelection } from './contributions/board-selection';
190190
import { OpenRecentSketch } from './contributions/open-recent-sketch';
191191
import { Help } from './contributions/help';
192192
import { bindArduinoPreferences } from './arduino-preferences';
193+
import { SettingsService } from './dialogs/settings/settings';
193194
import {
194-
SettingsService,
195195
SettingsDialog,
196196
SettingsWidget,
197197
SettingsDialogProps,
198-
} from './settings';
198+
} from './dialogs/settings/settings-dialog';
199199
import { AddFile } from './contributions/add-file';
200200
import { ArchiveSketch } from './contributions/archive-sketch';
201201
import { OutputToolbarContribution as TheiaOutputToolbarContribution } from '@theia/output/lib/browser/output-toolbar-contribution';
@@ -207,6 +207,8 @@ import { DebugConfigurationManager } from './theia/debug/debug-configuration-man
207207
import { DebugConfigurationManager as TheiaDebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
208208
import { SearchInWorkspaceWidget as TheiaSearchInWorkspaceWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-widget';
209209
import { SearchInWorkspaceWidget } from './theia/search-in-workspace/search-in-workspace-widget';
210+
import { SearchInWorkspaceFactory as TheiaSearchInWorkspaceFactory } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
211+
import { SearchInWorkspaceFactory } from './theia/search-in-workspace/search-in-workspace-factory';
210212
import { SearchInWorkspaceResultTreeWidget as TheiaSearchInWorkspaceResultTreeWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-result-tree-widget';
211213
import { SearchInWorkspaceResultTreeWidget } from './theia/search-in-workspace/search-in-workspace-result-tree-widget';
212214
import { MonacoEditorProvider } from './theia/monaco/monaco-editor-provider';
@@ -259,7 +261,7 @@ import {
259261
UserFieldsDialogProps,
260262
UserFieldsDialogWidget,
261263
} from './dialogs/user-fields/user-fields-dialog';
262-
import { nls } from '@theia/core/lib/browser/nls';
264+
import { nls } from '@theia/core/lib/common';
263265

264266
const ElementQueries = require('css-element-queries/src/ElementQueries');
265267

@@ -492,6 +494,12 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
492494

493495
bind(SearchInWorkspaceWidget).toSelf();
494496
rebind(TheiaSearchInWorkspaceWidget).toService(SearchInWorkspaceWidget);
497+
498+
// replace search icon
499+
rebind(TheiaSearchInWorkspaceFactory)
500+
.to(SearchInWorkspaceFactory)
501+
.inSingletonScope();
502+
495503
rebind(TheiaSearchInWorkspaceResultTreeWidget).toDynamicValue(
496504
({ container }) => {
497505
const childContainer = createTreeContainer(container);
@@ -678,7 +686,10 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
678686
bind(SettingsWidget).toSelf().inSingletonScope();
679687
bind(SettingsDialog).toSelf().inSingletonScope();
680688
bind(SettingsDialogProps).toConstantValue({
681-
title: 'Preferences',
689+
title: nls.localize(
690+
'vscode/preferences.contribution/preferences',
691+
'Preferences'
692+
),
682693
});
683694

684695
bind(StorageWrapper).toSelf().inSingletonScope();

‎arduino-ide-extension/src/browser/arduino-preferences.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
PreferenceContribution,
77
PreferenceSchema,
88
} from '@theia/core/lib/browser/preferences';
9-
import { nls } from '@theia/core/lib/browser/nls';
9+
import { nls } from '@theia/core/lib/common';
1010
import { CompilerWarningLiterals, CompilerWarnings } from '../common/protocol';
1111

1212
export const ArduinoConfigSchema: PreferenceSchema = {

‎arduino-ide-extension/src/browser/boards/boards-auto-installer.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { BoardsServiceProvider } from './boards-service-provider';
1010
import { BoardsConfig } from './boards-config';
1111
import { Installable, ResponseServiceArduino } from '../../common/protocol';
1212
import { BoardsListWidgetFrontendContribution } from './boards-widget-frontend-contribution';
13-
import { nls } from '@theia/core/lib/browser/nls';
13+
import { nls } from '@theia/core/lib/common';
1414

1515
/**
1616
* Listens on `BoardsConfig.Config` changes, if a board is selected which does not

‎arduino-ide-extension/src/browser/boards/boards-config-dialog.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { BoardsConfig } from './boards-config';
66
import { BoardsService } from '../../common/protocol/boards-service';
77
import { BoardsServiceProvider } from './boards-service-provider';
88
import { BoardsConfigDialogWidget } from './boards-config-dialog-widget';
9-
import { nls } from '@theia/core/lib/browser/nls';
9+
import { nls } from '@theia/core/lib/common';
1010

1111
@injectable()
1212
export class BoardsConfigDialogProps extends DialogProps {}

‎arduino-ide-extension/src/browser/boards/boards-config.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {
1414
AvailableBoard,
1515
BoardsServiceProvider,
1616
} from './boards-service-provider';
17-
import { nls } from '@theia/core/lib/browser/nls';
1817
import { naturalCompare } from '../../common/utils';
18+
import { nls } from '@theia/core/lib/common';
1919

2020
export namespace BoardsConfig {
2121
export interface Config {

‎arduino-ide-extension/src/browser/boards/boards-data-menu-updater.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
1212
import { BoardsDataStore } from './boards-data-store';
1313
import { MainMenuManager } from '../../common/main-menu-manager';
1414
import { ArduinoMenus, unregisterSubmenu } from '../menu/arduino-menus';
15-
import { nls } from '@theia/core/lib/browser/nls';
15+
import { nls } from '@theia/core/lib/common';
1616

1717
@injectable()
1818
export class BoardsDataMenuUpdater implements FrontendApplicationContribution {

‎arduino-ide-extension/src/browser/boards/boards-list-widget.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '../../common/protocol/boards-service';
66
import { ListWidget } from '../widgets/component-list/list-widget';
77
import { ListItemRenderer } from '../widgets/component-list/list-item-renderer';
8-
import { nls } from '@theia/core/lib/browser/nls';
8+
import { nls } from '@theia/core/lib/common';
99

1010
@injectable()
1111
export class BoardsListWidget extends ListWidget<BoardsPackage> {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /