@@ -1308,7 +1308,7 @@ public void preprocess(String buildPath, PdePreprocessor preprocessor) throws Ru
1308
1308
StringBuffer bigCode = new StringBuffer ();
1309
1309
int bigCount = 0 ;
1310
1310
for (SketchCode sc : code ) {
1311
- if (sc .isExtension ("ino" ) || sc . isExtension ( "pde" )) {
1311
+ if (sc .isExtension (Base . SKETCH_EXTENSIONS )) {
1312
1312
sc .setPreprocOffset (bigCount );
1313
1313
// These #line directives help the compiler report errors with
1314
1314
// correct the filename and line number (issue 281 & 907)
@@ -1368,7 +1368,7 @@ public void preprocess(String buildPath, PdePreprocessor preprocessor) throws Ru
1368
1368
// 3. then loop over the code[] and save each .java file
1369
1369
1370
1370
for (SketchCode sc : code ) {
1371
- if (sc .isExtension ("c" ) || sc . isExtension ( "cpp" ) || sc .isExtension ("h" )) {
1371
+ if (sc .isExtension (Base . SOURCE_EXTENSIONS ) || sc .isExtension (Base . HEADER_EXTENSIONS )) {
1372
1372
// no pre-processing services necessary for java files
1373
1373
// just write the the contents of 'program' to a .java file
1374
1374
// into the build directory. uses byte stream and reader/writer
@@ -1382,7 +1382,7 @@ public void preprocess(String buildPath, PdePreprocessor preprocessor) throws Ru
1382
1382
}
1383
1383
// sc.setPreprocName(filename);
1384
1384
1385
- } else if (sc .isExtension ("ino" ) || sc . isExtension ( "pde" )) {
1385
+ } else if (sc .isExtension (Base . SKETCH_EXTENSIONS )) {
1386
1386
// The compiler and runner will need this to have a proper offset
1387
1387
sc .addPreprocOffset (headerOffset );
1388
1388
}
@@ -1818,20 +1818,22 @@ public boolean validExtension(String what) {
1818
1818
* Returns the default extension for this editor setup.
1819
1819
*/
1820
1820
public String getDefaultExtension () {
1821
- return "ino" ;
1821
+ return Base . SKETCH_EXTENSIONS [ 0 ] ;
1822
1822
}
1823
1823
1824
- static private List <String > hiddenExtensions = Arrays .asList ("ino" , "pde" );
1825
-
1826
1824
public List <String > getHiddenExtensions () {
1827
- return hiddenExtensions ;
1825
+ return Arrays . asList ( Base . SKETCH_EXTENSIONS ) ;
1828
1826
}
1829
1827
1830
1828
/**
1831
1829
* Returns a String[] array of proper extensions.
1832
1830
*/
1833
1831
public List <String > getExtensions () {
1834
- return Arrays .asList ("ino" , "pde" , "c" , "cpp" , "h" );
1832
+ List <String > res = new ArrayList <String >();
1833
+ res .addAll (Arrays .asList (Base .SKETCH_EXTENSIONS ));
1834
+ res .addAll (Arrays .asList (Base .SOURCE_EXTENSIONS ));
1835
+ res .addAll (Arrays .asList (Base .HEADER_EXTENSIONS ));
1836
+ return res ;
1835
1837
}
1836
1838
1837
1839
0 commit comments