Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c3eaca0

Browse files
author
Akos Kitta
committedJan 31, 2023
fix: different validation rule for cached sketches
Signed-off-by: Akos Kitta <[email protected]>
1 parent 23d5bea commit c3eaca0

32 files changed

+108
-65
lines changed
 

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
SketchesService,
2424
SketchesServicePath,
2525
} from '../common/protocol/sketches-service';
26-
import { SketchesServiceClientImpl } from '../common/protocol/sketches-service-client-impl';
26+
import { SketchesServiceClientImpl } from './sketches-service-client-impl';
2727
import { CoreService, CoreServicePath } from '../common/protocol/core-service';
2828
import { BoardsListWidget } from './boards/boards-list-widget';
2929
import { BoardsListWidgetFrontendContribution } from './boards/boards-widget-frontend-contribution';

‎arduino-ide-extension/src/browser/contributions/add-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from './contribution';
1212
import { FileDialogService } from '@theia/filesystem/lib/browser';
1313
import { nls } from '@theia/core/lib/common';
14-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
14+
import { CurrentSketch } from '../sketches-service-client-impl';
1515

1616
@injectable()
1717
export class AddFile extends SketchContribution {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
MenuModelRegistry,
1010
} from './contribution';
1111
import { nls } from '@theia/core/lib/common';
12-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
12+
import { CurrentSketch } from '../sketches-service-client-impl';
1313

1414
@injectable()
1515
export class ArchiveSketch extends SketchContribution {

‎arduino-ide-extension/src/browser/contributions/close.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
URI,
2121
} from './contribution';
2222
import { Dialog } from '@theia/core/lib/browser/dialogs';
23-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
23+
import { CurrentSketch } from '../sketches-service-client-impl';
2424
import { SaveAsSketch } from './save-as-sketch';
2525

2626
/**

‎arduino-ide-extension/src/browser/contributions/contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { SettingsService } from '../dialogs/settings/settings';
4141
import {
4242
CurrentSketch,
4343
SketchesServiceClientImpl,
44-
} from '../../common/protocol/sketches-service-client-impl';
44+
} from '../sketches-service-client-impl';
4545
import {
4646
SketchesService,
4747
FileSystemExt,

‎arduino-ide-extension/src/browser/contributions/create-contribution.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import { CompositeTreeNode } from '@theia/core/lib/browser';
22
import { nls } from '@theia/core/lib/common/nls';
3-
import URI from '@theia/core/lib/common/uri';
43
import { inject, injectable } from '@theia/core/shared/inversify';
5-
import { Sketch } from '../../common/protocol';
64
import { CreateApi } from '../create/create-api';
75
import { CreateFeatures } from '../create/create-features';
86
import { CreateUri } from '../create/create-uri';
97
import { Create, isNotFound } from '../create/typings';
10-
import { LocalCacheFsProvider } from '../local-cache/local-cache-fs-provider';
118
import { CloudSketchbookTree } from '../widgets/cloud-sketchbook/cloud-sketchbook-tree';
129
import { CloudSketchbookTreeModel } from '../widgets/cloud-sketchbook/cloud-sketchbook-tree-model';
1310
import { CloudSketchbookTreeWidget } from '../widgets/cloud-sketchbook/cloud-sketchbook-tree-widget';
@@ -51,28 +48,13 @@ export function pushingSketch(input: string): string {
5148

5249
@injectable()
5350
export abstract class CloudSketchContribution extends SketchContribution {
54-
@inject(LocalCacheFsProvider)
55-
private readonly localCacheFsProvider: LocalCacheFsProvider;
5651
@inject(SketchbookWidgetContribution)
5752
private readonly widgetContribution: SketchbookWidgetContribution;
5853
@inject(CreateApi)
5954
protected readonly createApi: CreateApi;
6055
@inject(CreateFeatures)
6156
protected readonly createFeatures: CreateFeatures;
6257

63-
protected cloudUri(sketch: Sketch): URI | undefined {
64-
return this.localCacheFsProvider.from(new URI(sketch.uri));
65-
}
66-
67-
protected localCacheUri(cloudUri: URI): URI | undefined {
68-
if (cloudUri.scheme !== CreateUri.scheme) {
69-
throw new Error(
70-
`Expected '${CreateUri.scheme}'. Got ${cloudUri.toString()}`
71-
);
72-
}
73-
return this.localCacheFsProvider.to(cloudUri);
74-
}
75-
7658
protected async treeModel(): Promise<
7759
(CloudSketchbookTreeModel & { root: CompositeTreeNode }) | undefined
7860
> {

‎arduino-ide-extension/src/browser/contributions/debug.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
TabBarToolbarRegistry,
1919
} from './contribution';
2020
import { MaybePromise, MenuModelRegistry, nls } from '@theia/core/lib/common';
21-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
21+
import { CurrentSketch } from '../sketches-service-client-impl';
2222
import { ArduinoMenus } from '../menu/arduino-menus';
2323

2424
const COMPILE_FOR_DEBUG_KEY = 'arduino-compile-for-debug';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class DeleteSketch extends CloudSketchContribution {
5959
if (!willNavigateAway) {
6060
return this.sketchesService.deleteSketch(sketch);
6161
}
62-
const cloudUri = this.cloudUri(sketch); // TODO: warn user that it's a cloud sketch
62+
const cloudUri = this.createFeatures.cloudUri(sketch); // TODO: warn user that it's a cloud sketch
6363
if (willNavigateAway !== 'force') {
6464
const { response } = await remote.dialog.showMessageBox({
6565
title: nls.localizeByDefault('Delete'),

‎arduino-ide-extension/src/browser/contributions/include-library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { SketchContribution, Command, CommandRegistry } from './contribution';
1717
import { NotificationCenter } from '../notification-center';
1818
import { nls } from '@theia/core/lib/common';
1919
import * as monaco from '@theia/monaco-editor-core';
20-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
20+
import { CurrentSketch } from '../sketches-service-client-impl';
2121

2222
@injectable()
2323
export class IncludeLibrary extends SketchContribution {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ExecutableService,
99
sanitizeFqbn,
1010
} from '../../common/protocol';
11-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
11+
import { CurrentSketch } from '../sketches-service-client-impl';
1212
import { BoardsConfig } from '../boards/boards-config';
1313
import { BoardsServiceProvider } from '../boards/boards-service-provider';
1414
import { HostedPluginEvents } from '../hosted-plugin-events';

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { nls } from '@theia/core/lib/common/nls';
88
import { inject, injectable } from '@theia/core/shared/inversify';
99
import { WorkspaceInput } from '@theia/workspace/lib/browser/workspace-service';
1010
import * as dateFormat from 'dateformat';
11-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
11+
import { CurrentSketch } from '../sketches-service-client-impl';
1212
import { StartupTask } from '../../electron-common/startup-task';
1313
import { ArduinoMenus } from '../menu/arduino-menus';
1414
import {
@@ -71,7 +71,7 @@ export class SaveAsSketch extends CloudSketchContribution {
7171
}
7272

7373
let destinationUri: string | undefined;
74-
const cloudUri = this.cloudUri(sketch);
74+
const cloudUri = this.createFeatures.cloudUri(sketch);
7575
if (cloudUri) {
7676
destinationUri = await this.createCloudCopy({ cloudUri, sketch });
7777
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
KeybindingRegistry,
1111
} from './contribution';
1212
import { nls } from '@theia/core/lib/common';
13-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
13+
import { CurrentSketch } from '../sketches-service-client-impl';
1414

1515
@injectable()
1616
export class SaveSketch extends SketchContribution {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
open,
1919
} from './contribution';
2020
import { ArduinoMenus, PlaceholderMenuNode } from '../menu/arduino-menus';
21-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
21+
import { CurrentSketch } from '../sketches-service-client-impl';
2222
import { nls } from '@theia/core/lib/common';
2323

2424
@injectable()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DisposableCollection } from '@theia/core/lib/common/disposable';
33
import { inject, injectable } from '@theia/core/shared/inversify';
44
import { FileSystemFrontendContribution } from '@theia/filesystem/lib/browser/filesystem-frontend-contribution';
55
import { FileChangeType } from '@theia/filesystem/lib/common/files';
6-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
6+
import { CurrentSketch } from '../sketches-service-client-impl';
77
import { Sketch, SketchContribution } from './contribution';
88
import { OpenSketchFiles } from './open-sketch-files';
99

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
CoreServiceContribution,
1313
} from './contribution';
1414
import { deepClone, nls } from '@theia/core/lib/common';
15-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
15+
import { CurrentSketch } from '../sketches-service-client-impl';
1616
import type { VerifySketchParams } from './verify-sketch';
1717
import { UserFields } from './user-fields';
1818

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { nls } from '@theia/core/lib/common/nls';
44
import { Deferred } from '@theia/core/lib/common/promise-util';
55
import { injectable } from '@theia/core/shared/inversify';
66
import { WorkspaceCommands } from '@theia/workspace/lib/browser/workspace-commands';
7-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
7+
import { CurrentSketch } from '../sketches-service-client-impl';
88
import { Sketch, SketchContribution, URI } from './contribution';
99
import { SaveAsSketch } from './save-as-sketch';
1010

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TabBarToolbarRegistry,
1212
} from './contribution';
1313
import { nls } from '@theia/core/lib/common';
14-
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
14+
import { CurrentSketch } from '../sketches-service-client-impl';
1515
import { CoreService } from '../../common/protocol';
1616
import { CoreErrorHandler } from './core-error-handler';
1717

‎arduino-ide-extension/src/browser/create/create-features.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import { inject, injectable } from '@theia/core/shared/inversify';
55
import { AuthenticationSession } from '../../node/auth/types';
66
import { ArduinoPreferences } from '../arduino-preferences';
77
import { AuthenticationClientService } from '../auth/authentication-client-service';
8+
import { Sketch, URI } from '../contributions/contribution';
9+
import { LocalCacheFsProvider } from '../local-cache/local-cache-fs-provider';
810

911
@injectable()
1012
export class CreateFeatures implements FrontendApplicationContribution {
1113
@inject(ArduinoPreferences)
1214
private readonly preferences: ArduinoPreferences;
1315
@inject(AuthenticationClientService)
1416
private readonly authenticationService: AuthenticationClientService;
17+
@inject(LocalCacheFsProvider)
18+
private readonly localCacheFsProvider: LocalCacheFsProvider;
1519

1620
private readonly onDidChangeSessionEmitter = new Emitter<
1721
AuthenticationSession | undefined
@@ -66,4 +70,11 @@ export class CreateFeatures implements FrontendApplicationContribution {
6670
get session(): AuthenticationSession | undefined {
6771
return this._session;
6872
}
73+
74+
cloudUri(sketch: Sketch): URI | undefined {
75+
if (!this.session) {
76+
return undefined;
77+
}
78+
return this.localCacheFsProvider.from(new URI(sketch.uri));
79+
}
6980
}

‎arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts renamed to ‎arduino-ide-extension/src/browser/sketches-service-client-impl.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ import {
1010
DisposableCollection,
1111
} from '@theia/core/lib/common/disposable';
1212
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
13-
import { Sketch, SketchesService } from '.';
14-
import { ConfigServiceClient } from '../../browser/config/config-service-client';
15-
import { SketchContainer, SketchesError, SketchRef } from './sketches-service';
13+
import { Sketch, SketchesService } from '../common/protocol';
14+
import { ConfigServiceClient } from './config/config-service-client';
15+
import {
16+
SketchContainer,
17+
SketchesError,
18+
SketchRef,
19+
} from '../common/protocol/sketches-service';
1620
import {
1721
ARDUINO_CLOUD_FOLDER,
1822
REMOTE_SKETCHBOOK_FOLDER,
19-
} from '../../browser/utils/constants';
23+
} from './utils/constants';
2024
import * as monaco from '@theia/monaco-editor-core';
2125
import { Deferred } from '@theia/core/lib/common/promise-util';
2226
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';

‎arduino-ide-extension/src/browser/theia/core/widget-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { OutputWidget } from '@theia/output/lib/browser/output-widget';
1010
import {
1111
CurrentSketch,
1212
SketchesServiceClientImpl,
13-
} from '../../../common/protocol/sketches-service-client-impl';
13+
} from '../../sketches-service-client-impl';
1414

1515
@injectable()
1616
export class WidgetManager extends TheiaWidgetManager {

‎arduino-ide-extension/src/browser/theia/debug/debug-configuration-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { SketchesService } from '../../../common/protocol';
1414
import {
1515
CurrentSketch,
1616
SketchesServiceClientImpl,
17-
} from '../../../common/protocol/sketches-service-client-impl';
17+
} from '../../sketches-service-client-impl';
1818
import { DebugConfigurationModel } from './debug-configuration-model';
1919
import {
2020
FileOperationError,

‎arduino-ide-extension/src/browser/theia/editor/editor-widget-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { EditorWidgetFactory as TheiaEditorWidgetFactory } from '@theia/editor/l
66
import {
77
CurrentSketch,
88
SketchesServiceClientImpl,
9-
} from '../../../common/protocol/sketches-service-client-impl';
9+
} from '../../sketches-service-client-impl';
1010
import { SketchesService, Sketch } from '../../../common/protocol';
1111
import { nls } from '@theia/core/lib/common';
1212

‎arduino-ide-extension/src/browser/theia/monaco/monaco-editor-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
} from '@theia/core/lib/common/disposable';
77
import { EditorServiceOverrides, MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
88
import { MonacoEditorProvider as TheiaMonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
9-
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
9+
import { SketchesServiceClientImpl } from '../../sketches-service-client-impl';
1010
import * as monaco from '@theia/monaco-editor-core';
1111
import type { ReferencesModel } from '@theia/monaco-editor-core/esm/vs/editor/contrib/gotoSymbol/browser/referencesModel';
1212

‎arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import { EditorPreferences } from '@theia/editor/lib/browser/editor-preferences'
66
import { MonacoToProtocolConverter } from '@theia/monaco/lib/browser/monaco-to-protocol-converter';
77
import { ProtocolToMonacoConverter } from '@theia/monaco/lib/browser/protocol-to-monaco-converter';
88
import { MonacoTextModelService as TheiaMonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
9-
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
9+
import { SketchesServiceClientImpl } from '../../sketches-service-client-impl';
1010

1111
@injectable()
1212
export class MonacoTextModelService extends TheiaMonacoTextModelService {
1313
@inject(SketchesServiceClientImpl)
1414
protected readonly sketchesServiceClient: SketchesServiceClientImpl;
1515

16-
protected override async createModel(resource: Resource): Promise<MonacoEditorModel> {
16+
protected override async createModel(
17+
resource: Resource
18+
): Promise<MonacoEditorModel> {
1719
const factory = this.factories
1820
.getContributions()
1921
.find(({ scheme }) => resource.uri.scheme === scheme);

‎arduino-ide-extension/src/browser/theia/workspace/workspace-commands.ts

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,28 @@ import {
1212
WorkspaceCommandContribution as TheiaWorkspaceCommandContribution,
1313
WorkspaceCommands,
1414
} from '@theia/workspace/lib/browser/workspace-commands';
15-
import { Sketch, SketchesService } from '../../../common/protocol';
15+
import { Sketch } from '../../../common/protocol';
1616
import {
1717
CurrentSketch,
1818
SketchesServiceClientImpl,
19-
} from '../../../common/protocol/sketches-service-client-impl';
19+
} from '../../sketches-service-client-impl';
20+
import { CreateFeatures } from '../../create/create-features';
2021
import { WorkspaceInputDialog } from './workspace-input-dialog';
2122

23+
interface ValidationContext {
24+
sketch: Sketch;
25+
cloudUri: URI | undefined;
26+
}
27+
2228
@injectable()
2329
export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribution {
2430
@inject(CommandService)
2531
private readonly commandService: CommandService;
26-
@inject(SketchesService)
27-
private readonly sketchService: SketchesService;
2832
@inject(SketchesServiceClientImpl)
2933
private readonly sketchesServiceClient: SketchesServiceClientImpl;
34+
@inject(CreateFeatures)
35+
private readonly createFeatures: CreateFeatures;
36+
private validationContext: ValidationContext | undefined;
3037

3138
override registerCommands(registry: CommandRegistry): void {
3239
super.registerCommands(registry);
@@ -65,7 +72,7 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
6572
this.labelProvider
6673
);
6774

68-
const name = await dialog.open();
75+
const name = await this.openDialog(dialog, parentUri);
6976
if (!name) {
7077
return;
7178
}
@@ -93,7 +100,9 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
93100
}
94101
let errorMessage: string | undefined = undefined;
95102
if (Sketch.Extensions.CODE_FILES.includes(extension)) {
96-
errorMessage = Sketch.validateSketchFolderName(name);
103+
errorMessage = this.validationContext?.cloudUri
104+
? Sketch.validateCloudSketchFolderName(name)
105+
: Sketch.validateSketchFolderName(name);
97106
}
98107
return errorMessage ?? super.validateFileName(userInput, parent, recursive);
99108
}
@@ -123,10 +132,7 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
123132
}
124133

125134
// file belongs to another sketch, do not allow rename
126-
const parentSketch = await this.sketchService.getSketchFolder(
127-
uri.toString()
128-
);
129-
if (parentSketch && parentSketch.uri !== sketch.uri) {
135+
if (!Sketch.isInSketch(uri, sketch)) {
130136
return;
131137
}
132138

@@ -166,7 +172,7 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
166172
},
167173
this.labelProvider
168174
);
169-
const name = await dialog.open();
175+
const name = await this.openDialog(dialog, uri);
170176
if (!name) {
171177
return;
172178
}
@@ -175,6 +181,34 @@ export class WorkspaceCommandContribution extends TheiaWorkspaceCommandContribut
175181
const newUri = uri.parent.resolve(nameWithExt);
176182
return this.fileService.move(oldUri, newUri);
177183
}
184+
185+
private async openDialog(
186+
dialog: WorkspaceInputDialog,
187+
uri: URI
188+
): Promise<string | undefined> {
189+
try {
190+
this.setValidationContext(uri);
191+
const name = await dialog.open();
192+
return name;
193+
} finally {
194+
this.resetValidationContext();
195+
}
196+
}
197+
198+
private setValidationContext(uri: URI): void {
199+
const sketch = this.sketchesServiceClient.tryGetCurrentSketch();
200+
if (
201+
CurrentSketch.isValid(sketch) &&
202+
new URI(sketch.uri).isEqualOrParent(uri)
203+
) {
204+
const cloudUri = this.createFeatures.cloudUri(sketch);
205+
this.validationContext = { sketch, cloudUri };
206+
}
207+
}
208+
209+
private resetValidationContext(): void {
210+
this.validationContext = undefined;
211+
}
178212
}
179213

180214
export function invalidExtension(

‎arduino-ide-extension/src/browser/theia/workspace/workspace-delete-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { WorkspaceDeleteHandler as TheiaWorkspaceDeleteHandler } from '@theia/wo
55
import {
66
CurrentSketch,
77
SketchesServiceClientImpl,
8-
} from '../../../common/protocol/sketches-service-client-impl';
8+
} from '../../sketches-service-client-impl';
99
import { DeleteSketch } from '../../contributions/delete-sketch';
1010

1111
@injectable()

‎arduino-ide-extension/src/browser/theia/workspace/workspace-variable-contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Sketch } from '../../../common/protocol';
99
import {
1010
CurrentSketch,
1111
SketchesServiceClientImpl,
12-
} from '../../../common/protocol/sketches-service-client-impl';
12+
} from '../../sketches-service-client-impl';
1313
import { DisposableCollection } from '@theia/core/lib/common/disposable';
1414

1515
@injectable()

‎arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-contributions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { SketchbookCommands } from '../sketchbook/sketchbook-commands';
2626
import {
2727
CurrentSketch,
2828
SketchesServiceClientImpl,
29-
} from '../../../common/protocol/sketches-service-client-impl';
29+
} from '../../sketches-service-client-impl';
3030
import { Contribution } from '../../contributions/contribution';
3131
import { ArduinoPreferences } from '../../arduino-preferences';
3232
import { MainMenuManager } from '../../../common/main-menu-manager';

‎arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-tree-model.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
1+
import {
2+
inject,
3+
injectable,
4+
postConstruct,
5+
} from '@theia/core/shared/inversify';
26
import URI from '@theia/core/lib/common/uri';
37
import { FileNode, FileTreeModel } from '@theia/filesystem/lib/browser';
48
import { FileService } from '@theia/filesystem/lib/browser/file-service';
@@ -13,7 +17,10 @@ import {
1317
} from '@theia/core/lib/browser/tree';
1418
import { SketchbookCommands } from './sketchbook-commands';
1519
import { OpenerService, open } from '@theia/core/lib/browser';
16-
import { CurrentSketch, SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
20+
import {
21+
CurrentSketch,
22+
SketchesServiceClientImpl,
23+
} from '../../sketches-service-client-impl';
1724
import { CommandRegistry } from '@theia/core/lib/common/command';
1825
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
1926
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
@@ -195,7 +202,10 @@ export class SketchbookTreeModel extends FileTreeModel {
195202
/**
196203
* Move the given source file or directory to the given target directory.
197204
*/
198-
override async move(source: TreeNode, target: TreeNode): Promise<URI | undefined> {
205+
override async move(
206+
source: TreeNode,
207+
target: TreeNode
208+
): Promise<URI | undefined> {
199209
if (source.parent && WorkspaceRootNode.is(source)) {
200210
// do not support moving a root folder
201211
return undefined;

‎arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-tree-widget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { ArduinoPreferences } from '../../arduino-preferences';
2121
import {
2222
CurrentSketch,
2323
SketchesServiceClientImpl,
24-
} from '../../../common/protocol/sketches-service-client-impl';
24+
} from '../../sketches-service-client-impl';
2525
import { SelectableTreeNode } from '@theia/core/lib/browser/tree/tree-selection';
2626
import { Sketch } from '../../contributions/contribution';
2727
import { nls } from '@theia/core/lib/common';

‎arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-widget-contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
import {
2727
CurrentSketch,
2828
SketchesServiceClientImpl,
29-
} from '../../../common/protocol/sketches-service-client-impl';
29+
} from '../../sketches-service-client-impl';
3030
import { FileService } from '@theia/filesystem/lib/browser/file-service';
3131
import { URI } from '../../contributions/contribution';
3232
import { WorkspaceInput } from '@theia/workspace/lib/browser';

‎arduino-ide-extension/src/test/browser/workspace-commands.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
WorkspaceCommandContribution,
3434
} from '../../browser/theia/workspace/workspace-commands';
3535
import { Sketch, SketchesService } from '../../common/protocol';
36-
import { SketchesServiceClientImpl } from '../../common/protocol/sketches-service-client-impl';
36+
import { SketchesServiceClientImpl } from '../../browser/sketches-service-client-impl';
3737

3838
disableJSDOM();
3939

0 commit comments

Comments
 (0)
Please sign in to comment.