Skip to content

Prevent overwriting existing libraries and platforms at first IDE start-up #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename contribution
  • Loading branch information
Alberto Iannaccone committed Jul 15, 2022
commit 28b57329f2fd5a99ca98c2e5b0758a9da4013bd6
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ import { WidgetManager as TheiaWidgetManager } from '@theia/core/lib/browser/wid
import { StartupTask } from './widgets/sketchbook/startup-task';
import { IndexesUpdateProgress } from './contributions/indexes-update-progress';
import { Daemon } from './contributions/daemon';
import { InitLibsPlatforms } from './contributions/init-libs-platforms';
import { FirstStartupInstaller } from './contributions/first-startup-installer';

MonacoThemingService.register({
id: 'arduino-theme',
Expand Down Expand Up @@ -700,7 +700,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
Contribution.configure(bind, StartupTask);
Contribution.configure(bind, IndexesUpdateProgress);
Contribution.configure(bind, Daemon);
Contribution.configure(bind, InitLibsPlatforms);
Contribution.configure(bind, FirstStartupInstaller);

// Disabled the quick-pick customization from Theia when multiple formatters are available.
// Use the default VS Code behavior, and pick the first one. In the IDE2, clang-format has `exclusive` selectors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BoardsService, LibraryService } from '../../common/protocol';
import { Contribution } from './contribution';

@injectable()
export class InitLibsPlatforms extends Contribution {
export class FirstStartupInstaller extends Contribution {
@inject(LocalStorageService)
private readonly localStorageService: LocalStorageService;
@inject(BoardsService)
Expand All @@ -14,7 +14,7 @@ export class InitLibsPlatforms extends Contribution {

override async onReady(): Promise<void> {
const isFirstStartup = !(await this.localStorageService.getData(
InitLibsPlatforms.INIT_LIBS_AND_PACKAGES
FirstStartupInstaller.INIT_LIBS_AND_PACKAGES
));
if (isFirstStartup) {
const avrPackage = await this.boardsService.getBoardPackage({
Expand Down Expand Up @@ -85,13 +85,13 @@ export class InitLibsPlatforms extends Contribution {

if (!avrPackageError && !builtInLibraryError) {
await this.localStorageService.setData(
InitLibsPlatforms.INIT_LIBS_AND_PACKAGES,
FirstStartupInstaller.INIT_LIBS_AND_PACKAGES,
true
);
}
}
}
}
export namespace InitLibsPlatforms {
export namespace FirstStartupInstaller {
export const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages';
}