The text of the Arduino IDE user interface has been localized to 12 languages.
Before localization can be accomplished, internationalization must be done in the application's code base:
- Set up infrastructure to export localization data
- Pass all target strings to that infrastructure
While the first of these tasks is completed, the second was not completed for several strings which are part of the user
interface.
Those outstanding strings are hereby internationalized and will be made available for localization.
The Arduino IDE's "Auto Format" feature is configured to produce the standard Arduino sketch formatting style by
default.
The Arduino IDE editor's default settings are compliant with that style. However, the user may adjust the editor
settings. In this case, the Arduino IDE automatically adjusts the Auto Format configuration to align with the user's
preferences.
The formatter configuration is consumed by several other projects in addition to the Arduino IDE. For this reason, the
configuration is hosted and maintained in a centralized location, from which it is pulled by all projects that use it.
Previously, the adjustment of the Arduino IDE formatter configuration according to the editor settings was integrated
into the configuration object itself. This meant that the standardized configuration had to be modified each time it was
pulled in to sync from the upstream source.
Moving the base formatter configuration object to a dedicated file, separated from the handling and adjustment code
allows syncs to be done by simply replacing the existing configuration file with the one automatically generated by the
CI system of the repository where the source configuration is hosted.
The Arduino IDE's "Auto Format" feature is configured to produce the standard Arduino sketch formatting style, as
established by the Arduino IDE 1.x formatter.
The configuration is consumed by several other projects which require the configuration in a YAML file. In order to
provide all the consumers with a single canonical source and to locate the infrastructure and activity related to the
maintenance of the file in a more appropriate repository, it is now hosted in a permanent location in the
`arduino/tooling-project-assets` repository.
The following changes have been made to the source configuration:
- Move documentation comments to a dedicated file in the upstream repository
- Make additional non-functional changes to the configuration format to facilitate maintenance
- Update to use the configuration API of ClangFormat 14.0.0
This last item did result in some functional changes to the configuration which will result in minor differences in the
formatter output.
These are actually reversions of unwanted differences from the Arduino IDE 1.x formatter output, which were unavoidable
when using the 11.0.1 version of ClangFormat in use at the time of the configuration's creation. These changes will
provide greater consistency during the migration from Arduino IDE 1.x to 2.x. The default output of the Arduino IDE
1.x formatter will continue to be considered the "gold standard" until Arduino IDE 2.x graduates from "pre-release"
status.
The Arduino IDE 2.x formatter configuration is fully customizable according to the preferences of each user. Those
already using custom configurations will not be affected in any way (though they are encouraged to sync their
configuration files from the source to bring them into compliance with the configuration API of the ClangFormat version
currently in use by Arduino IDE 2.x).
See the documentation and commit history for the source file for details on the configuration changes:
https://github.com/arduino/tooling-project-assets/tree/main/other/clang-format-configuration
The sketch code formatter configuration is passed to the ClangFormat tool as a string representing a JSON object via a
command line argument.
Previously, the contents of this string were not given any special treatment to ensure compatibility with the command
interpreter used on Windows machines. That did not result in problems only because the configuration didn't contain
problematic combinations of characters. This good fortune will not persist through updates to the configuration, so the
command must be properly processed.
The Windows command interpreter does not use the POSIX style backslash escaping. For this reason, escaped quotes in the
argument are recognized as normal quotes, meaning that the string alternates between quoted and unquoted states at
random. When a character with special significance to the Windows command interpreter happens to occur outside a quoted
section, an error results.
The solution is to use the Windows command interpreter's caret escaping on these characters. Since such an escaping
system is not recognized by POSIX shells, this is only done when the application is running on a Windows machine.
References:
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/echo#remarks
- https://en.wikipedia.org/wiki/Escape_character#Windows_Command_Prompt
The sketch code formatter configuration is passed to the ClangFormat tool as a string representing a JSON object via a
command line argument.
The quotes in the JSON syntax are escaped in order to make them compatible with this usage. Previously, consideration
was not given to escaping of the content. For example, with the previous escaping code, this content: `\"` would be
converted to `\\"`, whereas the correct escaping would look like `\\\"`.
That did not result in problems only because the configuration didn't contain escaped content. This good fortune will
not persist through updates to the configuration so the command must be properly processed.
The content of the configuration will now be escaped in addition to the quotes of the JSON data format.
* move initialization of libs and platforms into new contribution
* use noOverwrite when install built-in libraries and platform
* catch errors when installing platforms and libraries at first start-up
* arduino-cli version 0.25.0-rc1
* refine platforms and libraries initialization in case of errors
* add trailing newline when libraries and platform installation fail
* use regex to check error if builtin library dependencies are already installed
* rename contribution
Restored monitor service creation state before a36524e:
Pass core client provider into new instances as a field.
Closes#1161
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
The Arduino IDE attempts to provide some additional guidance to users based on matches against compilation error
messages.
This practice was established during a time when some significant breaking changes were made to the common APIs in order
to ease the transition.
Since that time, the practice has mostly been discontinued. The interpretations are only valid for very old code that is
unlikely to be used by the target users now. So their benefit is negligible. The patterns used are inexact, meaning that
the interpretations may be printed inappropriately, which is more and more likely as the cases where the matches would
be valid become increasingly rare. When the maintenance burden is taken into consideration, it is clear that the harm is
far more than any benefits from these. So they are removed.
Notes for specific interpretations:
> Please import the SPI library from the Sketch > Import Library menu.
> As of Arduino 0019, the Ethernet library depends on the SPI library.
> You appear to be using it or another library that depends on the SPI library.
The target error was more common prior to Arduino IDE 1.6.6 (released ~6.5 years ago), when it was necessary for the
sketch to contain `#include` directives for transitive in addition to direct library dependencies (SPI is a common
transitive dependency).
Due to the nature of the SPI library, it is not often used directly, and when it is used directly it is done by more
advanced users who are unlikely to forget the `#include` directive and would have no need for this interpretation even
if they did.
It is far more likely for the user to forget an `#include` for a popular library, yet Arduino rightly does not attempt
to maintain interpretations for those.
The "Sketch > Import Library" menu path was renamed to "Sketch > Include Library" ~7 years ago.
Arduino IDE 0019 was released ~12 years ago. We can safely assume the migration to the new Ethernet API is complete.
> The 'BYTE' keyword is no longer supported.
> As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
> Please use Serial.write() instead.
Arduino IDE 1.0 was released ~10.5 years ago. We can safely assume the migration to the new Serial API is complete.
This compilation error pattern is now far more likely to occur due to incorrect usage of a completely unrelated
occurrence of the common `BYTE` name in the user's code.
> The Server class has been renamed EthernetServer.
> As of Arduino 1.0, the Server class in the Ethernet library has been renamed to EthernetServer.
> The Client class has been renamed EthernetClient.
> As of Arduino 1.0, the Client class in the Ethernet library has been renamed to EthernetClient.
> The Udp class has been renamed EthernetUdp.
> As of Arduino 1.0, the Udp class in the Ethernet library has been renamed to EthernetUdp.
Arduino IDE 1.0 was released ~10.5 years ago. We can safely assume the migration to the new Ethernet API is complete.
The compilation error patterns are in no way specific to the Ethernet library so is prone to false positives.
> Wire.send() has been renamed Wire.write().
> As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.
> Wire.receive() has been renamed Wire.read().
> As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.
Arduino IDE 1.0 was released ~10.5 years ago. We can safely assume the migration to the new Wire API is complete.
Due to the nature of the Wire library, it is not often used directly, and when it is used directly it is done by more
advanced users who have less need for an interpretation of the compiler error.
> 'Mouse' not found. Does your sketch include the line '#include <Mouse.h>'?
> 'Keyboard' not found. Does your sketch include the line '#include <Keyboard.h>'?
I left these in because they are the most "recent" (added due to a breaking change made 7 years ago).
However, I also feel that these are harmful and should either be removed or changed. The problem is that there is a
false match when the user attempts to compile the Keyboard or Mouse libraries for a board which does not have native USB
support (e.g., Uno, Mega), even when their sketch does contain the `#include` directives that are recommended by the
interpretation. That cause of the compilation error matching the pattern is more common than the case where the user is
compiling old code or forgot the `#include` directive, for which the interpretation is valid.
* 1032 failing upload flag for monitor mgr
* move upload failure fix logic to frontend
* misc corrections
* avoid starting monitor when upload is in progress
* avoid starting monitor when upload is in progress
* prevent monitor side effects on upload (WIP)
* send upload req after notifying mgr
* dispose instead of pause on upld (code not final)
* Revert "dispose instead of pause on upld (code not final)"
This reverts commit 2d5dff2a2d85754467470b5973b7ecac8017aa58.
* force wait before upload (test)
* always start queued services after uplaod finishes
* test cli with monitor close delay
* clean up unnecessary await(s)
* remove unused dependency
* revert CLI to 0.23
* use master cli for testing, await in upload finish
* remove upload port from pending monitor requests
* fix startQueuedServices
* refinements queued monitors
* clean up monitor mgr state
* fix typo from prev cleanup
* avoid dupl queued monitor services
* variable name changes
* reference latest cli commit in package.json
Co-authored-by: Alberto Iannaccone <a.iannaccone@arduino.cc>
For example, `malformed custom board options` was incorrectly detected
as loading JSON index file error.
Closes#1036
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
* backend structure WIP
* Scaffold interfaces and classes for pluggable monitors
* Implement MonitorService to handle pluggable monitor lifetime
* Rename WebSocketService to WebSocketProvider and uninjected it
* Moved some interfaces
* Changed upload settings
* Enhance MonitorManager APIs
* Fixed WebSocketChange event signature
* Add monitor proxy functions for the frontend
* Moved settings to MonitorService
* Remove several unnecessary serial monitor classes
* Changed how connection is handled on upload
* Proxied more monitor methods to frontend
* WebSocketProvider is not injectable anymore
* Add generic monitor settings storaging
* More serial classes removal
* Remove unused file
* Changed plotter contribution to use new manager proxy
* Changed MonitorWidget and children to use new monitor proxy
* Updated MonitorWidget to use new monitor proxy
* Fix backend logger bindings
* Delete unnecessary Symbol
* coreClientProvider is now set when constructing MonitorService
* Add missing binding
* Fix `MonitorManagerProxy` DI issue
* fix monitor connection
* delete duplex when connection is closed
* update arduino-cli to 0.22.0
* fix upload when monitor is open
* add MonitorSettingsProvider interface
* monitor settings provider stub
* updated pseudo code
* refactor monitor settings interfaces
* monitor service provider singleton
* add unit tests
* change MonitorService providers to injectable deps
* fix monitor settings client communication
* refactor monitor commands protocol
* use monitor settings provider properly
* add settings to monitor model
* add settings to monitor model
* reset serial monitor when port changes
* fix serial plotter opening
* refine monitor connection settings
* fix hanging web socket connections
* add serial plotter reset command
* send port to web socket clients
* monitor service wait for success serial port open
* fix reset loop
* update serial plotter version
* update arduino-cli version to 0.23.0-rc1 and regenerate grpc protocol
* remove useless plotter protocol file
* localize web socket errors
* clean-up code
* update translation file
* Fix duplicated editor tabs (#1012)
* Save dialog for closing temporary sketch and unsaved files (#893)
* Use normal `OnWillStop` event
* Align `CLOSE` command to rest of app
* Fixed FS path vs encoded URL comparision when handling stop request.
Ref: https://github.com/eclipse-theia/theia/issues/11226
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
* Fixed the translations.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
* Fixed the translations again.
Removed `electron` from the `nls-extract`. It does not contain app code.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
* Aligned the stop handler code to Theia.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Co-authored-by: Akos Kitta <a.kitta@arduino.cc>
* fix serial monitor send line ending
* refactor monitor-service poll for test/readability
* localize web socket errors
* update translation file
* Fix duplicated editor tabs (#1012)
* i18n:check rerun
* Speed up IDE startup time.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
* override coreClientProvider in monitor-service
* cleanup merged code
Co-authored-by: Francesco Stasi <f.stasi@me.com>
Co-authored-by: Silvano Cerza <silvanocerza@gmail.com>
Co-authored-by: Mark Sujew <mark.sujew@typefox.io>
Co-authored-by: David Simpson <45690499+davegarthsimpson@users.noreply.github.com>
Co-authored-by: Akos Kitta <a.kitta@arduino.cc>
- Bumped `clangd` to `14.0.0`,
- Can use `.clang-format` from:
- current sketch folder,
- `~/.arduinoIDE/.clang-format`,
- `directories#data/.clang-format`, or
- falls back to default formatter styles.
Closes#1009Closes#566
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>