Bug 807 : inside Sketch.java, don't hardwire the file extension types
Last modified: 2008-08-17 14:13




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
fry
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-06-05 09:39
Additional Comment #1 From fry 2008-06-05 09:42
dave, did you have ideas on how this should be implemented? i'm doing major
work on the editor/environment so i can get a fix in there if you'd like.

(also not sure if this is the right email for you, it's what you had used
on two very old bug reports)
Additional Comment #2 From mellis 2008-06-11 19:16
I don't have any fleshed out ideas, but I imagine something like:

String defaultExtension = ".pde";
String[] codeExtensions = { ".pde", ".java" };

Or, in the case of Arduino:

String defaultExtension = ".pde";
String[] codeExtensions = { ".pde", ".h" ".cpp", ".c" };

and then simply iterate through the arrays any time you'd otherwise use the literal extension.
Would you like me to take a shot at this?
Additional Comment #3 From fry 2008-06-11 19:27
if you have a moment, let me know--that'd be great. if not, i'll try to get
to it sometime soon.
Additional Comment #4 From fry 2008-08-17 14:13
This was way more work than i had expected, but i've implemented it for
0147. I was in the midst of cleaning up the API for Editor, Sketch, and
SketchCode to make way for the user-contributed Tools menu. Man, that code
is ugly in places.