-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Add watcher on sketch files #6074
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
Conversation
What about handling deletion of secondary sketch files (AKA "tabs") outside the IDE? If I delete one outside the IDE when using this test build 664 I get:
Could not createInput() for E:\Stuff\misc\electronics\arduino\temp\sketch_jul02a\foo.ino
java.io.FileNotFoundException: E:\Stuff\misc\electronics\arduino\temp\sketch_jul02a\foo.ino (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at processing.app.legacy.PApplet.createInput(PApplet.java:595)
at processing.app.legacy.PApplet.loadStrings(PApplet.java:254)
at processing.app.BaseNoGui.loadFile(BaseNoGui.java:605)
at processing.app.SketchFile.load(SketchFile.java:256)
at processing.app.EditorTab.reload(EditorTab.java:387)
at processing.app.tools.WatchDir.processEvents(WatchDir.java:142)
at processing.app.EditorTab1ドル.run(EditorTab.java:166)
at java.lang.Thread.run(Thread.java:745)
Warning: Failed to reload file: "foo.ino"
If the watcher removed tabs that were deleted outside the IDE it would help fix #2072.
Reloads sketch content if the Editor is not in foreground and isomething happens in the backing storage files. Note that no confirmation dialog is displayed (same behaviour as SublimeText, differs from other IDEs) Fixes arduino#4551 and arduino#5345
b5139ee
to
af45788
Compare
✅ Build completed.
Please test this code using one of the following:
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6074-BUILD-704-linux32.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6074-BUILD-704-linux64.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6074-BUILD-704-windows.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6074-BUILD-704-macosx.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-6074-BUILD-704-linuxarm.tar.xz
i️ The linuxarm
build is still experimental and may not be always available.
evaarnas
commented
Jan 14, 2020
It seems to work, unless I have unsaved changes in the Arduino IDE. That is, for "clean" files (all changes saved) it detects the external changes, but not for "dirty" files (with unsaved changes in the Arduino IDE).
Uh oh!
There was an error while loading. Please reload this page.
Reloads sketch content if the Editor is not in foreground and something happens in the backing storage files.
Note that no confirmation dialog is displayed (same behaviour as SublimeText, differs from other IDEs)
Fixes #4551 and #5345
ONLY TESTED ON LINUX with
/proc/sys/fs/inotify/max_user_watches
= 524288