Instead of opening up files during argument processing, the filenames
are now stored in a list and opened only after all commandline arguments
have been processed.
This commit in itself shouldn't change any behaviour, but it prepares
for improved error reporting in the next commits.
Previously, this would error out with an index out of bounds exception.
Now, an IOException is thrown, which is properly handled further up the
call chain.
Previously, strings containing the board id, or a joined version of the
package, platform and board id were passed around. Since comparing
objects is easier than strings and since parsing strings can be fragile,
it's better to just pass the TargetBoard objects.
There is one case where string parsing is still required: when parsing
the --board commandline option. However, the parsing is now done in the
right place, when handling the commandline, instead of in a generic
selectBoard method.
Since the custom suboptions are only visible when their associated board
is the currently selected one, there is no point in re-setting the
current board when a suboption is selected.
The current code forbids any files it does not know about, but this is
bad because:
- It breaks forward compatibility if we later add more files or
directories to the library format.
- It breaks for people who want to have some extra stuff in their
library (say, .gitignore or a README file). We can't keep a list of
"allowed" stuff, since there will always be stuff missing.
This commit removes that code and just allows all files again.
Added an "insideString" flag in scrubComments to avoid failing with strings like "Hello */*"
Added a handful of tests taking code from various issues in order to better avoid future regressions
Closes#1687
Fix the line number font rendering problem on the Mac.
Now, the TextAreaLineNumbers class extends the TextAreaPainter and just
overloads the paintLine method to make it render the line number instead
of rendering the whole line. Other than that, the superclass' drawing
code is used.
So: the same drawing code that renders the source code text in the
editor is now also being used to render the line numbers.