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

ATL-972: Moved the ./theia/launch.json config into a temp folder. #168

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
kittaakos merged 1 commit into main from atl-972--debug-remove-theia-folder
Mar 4, 2021

Conversation

@kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Mar 3, 2021

What it does:

  • This PR gets rid of the sketch_folder/.theia/launch.json and moves it to a temp folder.

Steps to reproduce:

  • Create a sketch. Do not save it yet.
  • Select a board that can debug.
  • Compile and start the debug from the toolbar.
  • Debug view open, you should see a config entry Arduino. You can open the config file in an editor. Hover over the editor tab of launch.json; it will point to some temp folder (arduino-ide2-).
  • You should be able to re-launch the debug from the Debug view and toolbar as many times as you want.
  • Save the sketch. (Note: the Arduino config is missing from the debug view! We need a solution for this in the future.)
  • Compile and start the debugging. You should be able to restart the debug session from both the view and the toolbar.
  • Stop and start the IDE. Since the sketch was saved previously, you should see the Arduino debug config in the Debug view, and you can start the debug session from there.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it out with my Zero, standalone CMSIS-DAP probe, and J-Link and it works fine, but the "No Configurations" experience is really not pleasant. It seems to me that we're trading the very minor annoyance of the .theia folder pollution of the sketch for a significantly worse user experience. My suggestion is to wait until a solution is found that can avoid the "No Configuration" thing from happening.

Copy link
Contributor Author

Thank you for the review, Per.

but the "No Configurations" experience is really not pleasant. It seems to me that we're trading the very minor annoyance of the .theia folder pollution of the sketch for a significantly worse user experience.

This is a bit more complex. Let assume we keep the .theia folder in the sketch folder, and we perform the following steps:

  • Create a new sketch. A sketch will be created in the temp folder. Let's say it's under ~/temp/x.
  • Compile the new sketch. The compiled output will be under another temp folder: ~/temp/arduino-sketch-y.
  • Start debug. (As discussed, we keep the .theia folder inside the sketch folder.) A file will be created under ~/temp/x/.theia/launch.json, and the executable path inside the launch.json will point to ~/temp/arduino-sketch-y/board:fqbn/x.ino.elf.
  • Save the sketch and pick a folder somewhere, let's say ~/Documents/Arduino/x; here, it gets tricky. We could copy ~/temp/x/.theia/launch.json to ~/Documents/Arduino/x/.theia/launch.json, but the executable entry inside the launch.json still points to ~/temp/arduino-sketch-y/board:fqbn/x.ino.elf. This can be invalid, and this is the issue here, not that we keep the ./theia folder inside the sketch folder or not.

I hope this clarifies. If no, let me know.

Copy link
Contributor Author

My suggestion is to wait until a solution is found that can avoid the "No Configuration" thing from happening.

For the record; this is how it works now from the main, so technically, we do not change the UX at all.

Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explaining the case in which we would move the sketch and pre-existing config would have the wrong path.
I think how it is working now is good enough.
We'll investigate the debugger experience further down the road, especially since we'll have to find a more Arduino way of adding custom parameters via debug_custom.json.

This PR has therefore my approval.
Thank you @per1234 for your review 👍🏼

@kittaakos kittaakos merged commit d648159 into main Mar 4, 2021
@kittaakos kittaakos deleted the atl-972--debug-remove-theia-folder branch March 4, 2021 10:53
@per1234 per1234 added topic: debugger Related to the integrated debugger topic: code Related to content of the project itself labels Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@per1234 per1234 per1234 left review comments

@ubidefeo ubidefeo ubidefeo approved these changes

Assignees

No one assigned

Labels

topic: code Related to content of the project itself topic: debugger Related to the integrated debugger

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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