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 846c22c

Browse files
fstasiAlberto Iannaccone
and
Alberto Iannaccone
authored
Theia 18 hotfixes (#528)
* Restore monaco suggestion highlights * remove duplicated tabs on startup * fix rename and delete sketch * remove '.only(...)' in tests Co-authored-by: Alberto Iannaccone <a.iannaccone@arduino.cc>
1 parent fc0f674 commit 846c22c

File tree

4 files changed

+44
-10
lines changed

4 files changed

+44
-10
lines changed

‎arduino-ide-extension/src/browser/contributions/sketch-control.ts‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export class SketchControl extends SketchContribution {
8787
currentSketch &&
8888
parentsketch &&
8989
parentsketch.uri === currentSketch.uri &&
90-
(awaitthis.allowRename(parentsketch.uri))
90+
this.allowRename(parentsketch.uri)
9191
) {
9292
this.menuRegistry.registerMenuAction(
9393
ArduinoMenus.SKETCH_CONTROL__CONTEXT__MAIN_GROUP,
@@ -124,7 +124,7 @@ export class SketchControl extends SketchContribution {
124124
currentSketch &&
125125
parentsketch &&
126126
parentsketch.uri === currentSketch.uri &&
127-
(awaitthis.allowDelete(parentsketch.uri))
127+
this.allowDelete(parentsketch.uri)
128128
) {
129129
this.menuRegistry.registerMenuAction(
130130
ArduinoMenus.SKETCH_CONTROL__CONTEXT__MAIN_GROUP,
@@ -249,20 +249,24 @@ export class SketchControl extends SketchContribution {
249249
});
250250
}
251251

252-
protected async isCloudSketch(uri: string) {
253-
const cloudCacheLocation = this.localCacheFsProvider.from(new URI(uri));
252+
protected isCloudSketch(uri: string): boolean {
253+
try {
254+
const cloudCacheLocation = this.localCacheFsProvider.from(new URI(uri));
254255

255-
if (cloudCacheLocation) {
256-
return true;
256+
if (cloudCacheLocation) {
257+
return true;
258+
}
259+
return false;
260+
} catch {
261+
return false;
257262
}
258-
return false;
259263
}
260264

261-
protected asyncallowRename(uri: string) {
265+
protected allowRename(uri: string): boolean {
262266
return !this.isCloudSketch(uri);
263267
}
264268

265-
protected asyncallowDelete(uri: string) {
269+
protected allowDelete(uri: string): boolean {
266270
return !this.isCloudSketch(uri);
267271
}
268272
}

‎arduino-ide-extension/src/browser/style/editor.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
background-size: 13px;
55
background-image: var(--theia-icon-circle);
66
}
7+
8+
.monaco-list-row.show-file-icons.focused {
9+
background-color: #d6ebff;
10+
}

‎arduino-ide-extension/src/browser/theia/core/shell-layout-restorer.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,30 @@ export class ShellLayoutRestorer extends TheiaShellLayoutRestorer {
2222
}
2323
}
2424
}
25+
26+
async restoreLayout(app: FrontendApplication): Promise<boolean> {
27+
this.logger.info('>>> Restoring the layout state...');
28+
const serializedLayoutData = await this.storageService.getData<string>(
29+
this.storageKey
30+
);
31+
if (serializedLayoutData === undefined) {
32+
this.logger.info('<<< Nothing to restore.');
33+
return false;
34+
}
35+
36+
const layoutData = await this.inflate(serializedLayoutData);
37+
// workaround to remove duplicated tabs
38+
if ((layoutData as any)?.mainPanel?.main?.widgets) {
39+
(layoutData as any).mainPanel.main.widgets = (
40+
layoutData as any
41+
).mainPanel.main.widgets.filter(
42+
(widget: any) =>
43+
widget.constructionOptions.factoryId !== 'code-editor-opener'
44+
);
45+
}
46+
47+
await app.shell.setLayoutData(layoutData);
48+
this.logger.info('<<< The layout has been successfully restored.');
49+
return true;
50+
}
2551
}

‎arduino-ide-extension/src/test/browser/monitor-utils.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ testLines.forEach((t) =>
125125
)
126126
);
127127

128-
describe.only('Monitor Utils', () => {
128+
describe('Monitor Utils', () => {
129129
beforeEach(() => {
130130
set(date);
131131
});

0 commit comments

Comments
(0)

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