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

Unsaved changes cause wrong error display in output window after compilation. #2542

Open
3 tasks done
georgepapas123 opened this issue Oct 25, 2024 · 0 comments
Open
3 tasks done
Labels
type: imperfection Perceived defect in any part of project

Comments

@georgepapas123
Copy link

Describe the problem

The line number containing the error is correct, the ~~~~~ underline indicating the error position is also correct, but the line contents is read from disk and thus it is wrong unless sketch was just saved.
The workaround for the moment is to always save before compile or keep AutoSave enabled.
This is obviously a non-critical bug, but it shouldn't be too hard to fix either.
The sketch in memory is used to show the correct line number and the exact line position of the error, just use that instead of re-reading the lines from disk.

To reproduce

Disable Autosave in settings, make a deliberate error and reorder something (e.g. a function) so that error is now on a different line.
Compile without saving the sketch.
In the output window the error will be shown with the correct (new) line number and the exact character position will be indicated, but the line contents will be that of the sketch on disk.

Expected behavior

The correct line number, with the correct line contents and line position of the error should be shown.

Arduino IDE version

2.3.2

Operating system

Windows

Operating system version

Windows 10 22H2

Additional context

I wasn't able to verify with the latest nightly build because it seems to get stuck at 60% "Downloading index: package_esp9266com_index.json" during startup.

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
@georgepapas123 georgepapas123 added the type: imperfection Perceived defect in any part of project label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

1 participant