Otherwise it may happen some weird sorting when untraslated and
translated labels are sorted together:
Arduino megaAVR Boards
Arduino nRF52 Board
ESP32 Arduino
ESP8266 Modules
Schede Arduino AVR <-- the localized string falls to the bottom
Also there is no way for 3rd party boards developers to actually provide
a translation, so let's just remove them.
This fixes a problem with the Serial UTF-8 decoder. This decoding moves
data from char[] buf, into a ByteBuffer inFromSerial, then decodes them
into a CharBuffer outToMessage and converts to a char[] to pass on.
When the buf read contained just over a full buffer worth of bytes and
contained some multi-byte characters, a situation could arise where two
decodes were needed to fill up outToMessage, leaving some data in
inFromSerial. If in this case no data would be left in buf, decoding
would stop until more data came in from serial.
This commit fixes this problem by:
- Changing the outer loop to continue running when buf is empty, but
inFromSerial is not.
- Changing the inner loop to run at least once (so it runs when buf is
empty, but inFromSerial is no).
- Breaking out of the outer loop when no characters were produced (this
handles the case where only an incomplete UTF-8 character remains in
inFromSerial, which would otherwise prevent the loop from
terminating.
- Removes a `if (outToMessage.hasRemaining()` check that is now
necessarily true if the break was not done.
This fixes#9808.
Fixes https://github.com/arduino/Arduino/issues/9785 and probably many others
This commit strongly simplyfies the serial list code
Pluggable discovery introduced a bug since BoardPort.toString() started reporting only the name of the port, not the complete name_vid_pid needed to match liblistserial output.
Adding .toCompleteString() almost solves the bogus disconnection part alone, but resolveDeviceByVendorIdProductId() uses "0x" prefixes VID/PID, breaking it again.
In addition, all the logic used to match a board with its bootloader (to obtain a serial number on 32u4 boards) has been completely removed since it is currently useless (and unused).
There was an error in the following constants:
PREF_PROXY_AUTO_USERNAME = "proxy.manual.username"
PREF_PROXY_AUTO_PASSWORD = "proxy.manual.password"
they should be set to "auto" and not "manual":
PREF_PROXY_AUTO_USERNAME = "proxy.auto.username"
PREF_PROXY_AUTO_PASSWORD = "proxy.auto.password"
Changing the constants to the correct value now will fix the problem for
future installations of the IDE but will produce an annoying side-effect
for users upgrading from previous version of the IDE: they will lose
their saved user and pass (because it was saved as "proxy.manual.*")
and the IDE will suddenly stop working without any clear reason.
To avoid this I've left the value to "proxy.manual.*" and removed
the distinction from AUTO and MANUAL, so now we have only:
PREF_PROXY_USERNAME = "proxy.manual.username"
PREF_PROXY_PASSWORD = "proxy.manual.password"
The corresponding textbox in the preference dialog will be filled based on
the PROXY_TYPE selection.
Improve Codacy PR quality requirements:
Fields should be declared at the top of the class, before any method
declarations, constructors, initializers or inner classes.
When transforming compiler errors (to make filenames more friendly), it
would match "fatal error" or "error" but then always reconstruct as
"error", modifying the compiler error in a way that is not intended.
This commit fixes that, as well as the previous hardcoding of the
"error: " prefix when rebuilding the error message, by capturing this
entire prefix and simply reproducing it in the resulting error message.
Error messages are detected and parsed using a regex. Part of this regex
matches the optional column number.
The code that handled this assumed that a missing column would result in
less elements in the matches array, but a regex always results in one
element per set of parenthesis in the regex, which will be null if no
capture was made for that element.
In practice, this meant that if no column was present in the error
message, a NullPointerException would be raised. Furthermore, gcc 9
seems to have started outputting omitting column numbers (instead of
printing 0) for some errors (such as unterminated #ifdef), which exposed
this problem.
This commit fixes this by simply using the fixed match numbers to take
apart the regex match, and by checking for a null column number (all
other captures are non-optional, so no need to check there).
If the package_index.json signature is not valid, a dialog box asking
the user to "update" the index is shown. Previously a java-exception
was printed if running from terminal or the IDE would not start at
all (with no apparent reason) if lanched from GUI.
Now ```tar.xz``` format is widely used, and the official arduino
IDE download URL also shows that arduino uses ```tar.xz``` format.
(https://downloads.arduino.cc/arduino-1.8.9-linux64.tar.xz).
As we all know, the tar.xz format has the optimal size compared to tar,
tar.gz, tar.bz2, and zip.
(https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/)
Therefore, it is very unreasonable not to support tar.xz.
Supporting this format can save almost half of the bandwidth resources
and download time when compressing the gcc toolchain,
making users more comfortable.
Signed-off-by: Huang Rui <vowstar@gmail.com>
When creating a new sketch, it is initialized with the BareMinimum example sketch. This example sketch uses 2-width whitespace indentation, which might differ from the user-defined tab settings. This commit makes the generated example sketch consistent with the user-defined tab settings.
Consider a case where the user decides to install a library `A` that
depends on library `B` and `B` is not up-to-date (i.e. is installed a
version that is not the latest), then the user is asked to "install"
both libraries `A` and `B`, effectively upgrading `B`.
With this change the already installed library `B` is left untouched
and not displayed in the missing dependencies.