Skip to content
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

IDE2 throws error when remote sketchbook tree is active and clicking in the settings.json file #1594

Open
3 tasks done
kittaakos opened this issue Oct 28, 2022 · 1 comment
Labels
topic: cloud Related to Arduino Cloud and cloud sketches topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

Describe the problem

See title.

Error:

sketchbook-widget-contribution.ts:246 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'revealFile')
    at SketchbookWidgetContribution.selectWidgetFileNode (sketchbook-widget-contribution.ts:246)

The problem should be solved here.

async selectWidgetFileNode(widget: Widget | undefined): Promise<void> {
if (Navigatable.is(widget)) {
const resourceUri = widget.getResourceUri();
if (resourceUri) {
const treeWidget = (await this.widget).getTreeWidget();
const { model } = treeWidget;
const node = await model.revealFile(resourceUri);
if (SelectableTreeNode.is(node)) {
model.selectNode(node);
}
}
}
}
protected onCurrentWidgetChangedHandler(): void {
this.selectWidgetFileNode(this.shell.currentWidget);
}

To reproduce

Open the cloud sketchbook tree and the settings.jon file and edit the settings.json file. IDE2 tries to blindly reveal the corresponding node in the sketchbook tree, but it's not there.

Expected behavior

No error.

Arduino IDE version

#1581, but I think it's the same from the main

Operating system

macOS

Operating system version

12.5.1

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 28, 2022
@kittaakos
Copy link
Contributor Author

Related error when not signed in:

root ERROR Error: Not logged in.
    at f.get currentUserUri [as currentUserUri] (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8038373)
    at from (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:8037598)
    at t.DelegatingFileSystemProvider.fromUnderlyingResource (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2949162)
    at t.DelegatingFileSystemProvider.handleFileChanges (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2948856)
    at file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2946355
    at file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2345439
    at r.invoke (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2345529)
    at s.fire (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2347323)
    at Object.notifyDidChangeFile (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2961278)
    at m.onNotification (file:///Users/a.kitta/Desktop/Arduino%20IDE.app/Contents/Resources/app/lib/bundle.js:2:2381972)

@kittaakos kittaakos added the topic: cloud Related to Arduino Cloud and cloud sketches label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cloud Related to Arduino Cloud and cloud sketches topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant