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

Add watcher on sketch files #6074

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Mar 14, 2017

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

@mastrolinux mastrolinux added the in progress Work on this item is in progress label Mar 14, 2017
@facchinm facchinm added this to the Release 1.8.3 milestone Mar 20, 2017
@per1234
Copy link
Collaborator

per1234 commented Jul 3, 2017

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.EditorTab$1.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.

facchinm added 2 commits July 3, 2017 12:47
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
@arduino arduino deleted a comment from ArduinoBot Jul 4, 2017
@arduino arduino deleted a comment from ArduinoBot Jul 4, 2017
@evaarnas
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress Work on this item is in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File edited externally to IDE does not reload
6 participants