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

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

Open
facchinm wants to merge 3 commits into arduino:master
base: master
Choose a base branch
Loading
from facchinm:watcher_java
Open

Conversation

Copy link
Member

@facchinm facchinm commented Mar 14, 2017
edited
Loading

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

per1234 and b264 reacted with thumbs up emoji
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.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.

facchinm reacted with thumbs up emoji

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
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
Reviewers
No reviews
Assignees
No one assigned
Labels
in progress Work on this item is in progress
Projects
None yet
Milestone
Next
Development

Successfully merging this pull request may close these issues.

File edited externally to IDE does not reload

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