1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-26 20:54:22 +01:00

1887 Commits

Author SHA1 Message Date
Martino Facchin
b2546131d8 Initial implementation of bookmarks
Toggle on the left, find next with F3
2020-04-07 14:09:07 +02:00
Martino Facchin
b8a6e6d589 Find/Replace: display on top of the related Editor
If the editor is focused, acquire alwaysOnTop capabilities but drop them as soon as both the editor and the dialog are out of focus

try to implement partial transparency

As implemented in Notepad++, a partially transparent search/replace window could make it easier to interact with the editor (particularly in fullscreen contexts, when the "always on top" window could hide the search results).
Unfortunately, Java can only apply the transparency to undecorated window, so it's a no-go.
Java gurus, please come to the rescue :D

Fix find/replace focus on Windows

Probably this approach could be adopted by all OSes with a little care on the window lifecycle.

[Find/Replace][Win] grab focus when just opened

Solves https://github.com/arduino/Arduino/issues/6951#issuecomment-351995084

Use Windows method for all OS
2020-04-07 14:09:07 +02:00
Cristian Maglie
93d013d1f4 autocomplete: improved rendering of completions 2020-04-07 14:09:06 +02:00
Cristian Maglie
3d6af521db autocomplete: extracted ArduinoCompletion to Completion generation method 2020-04-07 14:09:06 +02:00
Cristian Maglie
385a6738e9 autocompletion: factored filtering of completions 2020-04-07 14:09:06 +02:00
Martino Facchin
5e8895c475 Remove autocomplete for macros
Was causing NPE on certain cores
2020-04-07 14:09:06 +02:00
Cristian Maglie
79339d24f7 Added more debugging output for codecompletion errors 2020-04-07 14:09:06 +02:00
Cristian Maglie
77fd2b3919 Increase debugging info in json parsing from autocomplete 2020-04-07 14:09:06 +02:00
Cristian Maglie
46641780bf Refactored notification popup 2020-04-07 14:09:06 +02:00
Martino Facchin
8b53785c9f autocomplete: restore braces on functions
Also make the output more uniform (no differences between templates and funxtions)

New format is: functionName (bold) parameters (light grey) : returnType
2020-04-07 14:09:06 +02:00
Martino Facchin
d8d06134c7 cache + sort for autocomplete 2020-04-07 14:09:06 +02:00
Martino Facchin
ad2b97fff8 eclipse: add autocomplete to classpath 2020-04-07 14:09:06 +02:00
Cristian Maglie
7de9a3e483 Calling arduino builder with GPRC API [experimental] 2020-04-07 14:09:06 +02:00
Cristian Maglie
b693544c77 Added missing licenses 2020-04-07 14:09:06 +02:00
Cristian Maglie
a6652f938a codecompletion: added function parameters support. 2020-04-07 14:09:06 +02:00
Martino Facchin
41f0dde6f7 include autocomplete icons in pde.jar 2020-04-07 14:09:06 +02:00
Cristian Maglie
ce22446f60 Use FunctionCompletion when dealing with function autocompletions 2020-04-07 14:09:06 +02:00
Cristian Maglie
f949c79f63 Added some more infos in CompletionDetails 2020-04-07 14:09:06 +02:00
Cristian Maglie
fae321cd99 Added CompletionsRenderer 2020-04-07 14:09:06 +02:00
Cristian Maglie
42930e22b0 Testing autocomplete with arduino-preprocessor 2020-04-07 14:09:06 +02:00
ricardo.jl.rufino@gmail.com
2015c98908 Refactoring autocomplete structure 2020-04-07 14:09:06 +02:00
ricardo.jl.rufino@gmail.com
c84fd1a398 Base implementation of autocomplete #849 2020-04-07 14:09:06 +02:00
Martino Facchin
cabd626f0a Limit selected tab size in case of crowded header 2020-04-07 14:09:06 +02:00
Martino Facchin
336cde194d [tabs] some heavy lifting on tabs handling
The situation is still a shit, but at least better than before.
2020-04-07 14:09:06 +02:00
Martino Facchin
56dcf6bde4 Implement MouseWheelListener on tabs
tested with Marlin Firmware, solves #6109 #3601 #1193
2020-04-07 14:09:06 +02:00
Martino Facchin
578d34e203 Shift tabs if selected one if being painted offscreen
Implemented using a dry run to get the metrics and the needed shift
Fixes #1193 and #6109
2020-04-07 14:09:06 +02:00
Martino Facchin
2bcbaf7a68 Add clickable HTML view of Serial Monitor
The HTML view only activates if:
- the output is steady
- the "frame" contains a link
- the length of the entire content is < 1KB

No performance penalty compared to normal view (in standard conditions)
2020-04-07 14:09:06 +02:00
Martino Facchin
58eeaafde1 Extend UpdatableBoardsLibsFakeURLsHandler to handle real links 2020-04-07 14:09:06 +02:00
Martino Facchin
97fd81ac0c Avoid board change during compilation/upload
By threading the boardChange callback we can busy wait until
the compilation/upload phase has ended and change the board when done.

Fixes #6035
2020-04-07 14:09:06 +02:00
Martino Facchin
70d5537fb0 Add watcher on sketch files
Reloads sketch content if the Editor is not in foreground and isomething happens in the backing storage files.

Note that no confirmation dialog is displayed (same behaviour as SublimeText, differs from other IDEs)

Fixes #4551 and #5345
2020-04-07 14:09:06 +02:00
Martino Facchin
abbd40242d [RecentlyUsedBoards] Fix merge conflicts 2020-04-07 14:09:06 +02:00
Martino Facchin
917b1321d6 Prepare for LRU persistency 2020-04-07 14:09:06 +02:00
Martino Facchin
ddd876ca4e Make Recently used boards size configurable from preferences 2020-04-07 14:09:06 +02:00
Martino Facchin
14e59208b3 Fix concurrent access to menuItemsToClickAfterStartup 2020-04-07 14:09:06 +02:00
Martino Facchin
8a410a8a7f Add per-session recently used boards list
The list appears at the top of Board submenu
Boards are also reachable via a CTRL+SHIFT+number (starting from 1)
2020-04-07 14:09:06 +02:00
Martino Facchin
d0b74b0263 Refactor boardMenu creation
This commit is part of https://github.com/arduino/Arduino/pull/7120 by @sandeepmistry
2020-04-07 14:09:06 +02:00
Cristian Maglie
a1e43ce490 Removed some trivial warnings 2020-03-25 15:26:53 +01:00
Cristian Maglie
931c2b7f21 Do not translate labels of boards submenus
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.
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
9b48e8d047 Sort board submenus alphabetically
This sorts the board submenus themselves, based on the displayed name.
This does not change the ordering of board items within these submenus
(which uses the order from boards.txt).
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
6c1100f9ec Do not use a boards submenu with just one platform
When just one platform is installed, it does not make much sense to use
a submenu, so just add the boards directly under the boards menu as
before.
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
7bcd76332e Separate the boards menu per platform
Previously, the Tools->Boards menu was one long list, divided into
different platforms by (unselectable) headers. When more than one or two
platforms were installed, this quickly results in a very long list of
boards that is hard to navigate.

This commit changes the board menu to have a submenu for each platform,
where each submenu contains just the boards for that platform.

Note that this first keeps a list of board items and then adds those to
the boards menu later. This could have been done directly, but the
intermediate list makes it easier to special-case single platform
installations, as well as sort the list in subsequent commits.

This fixes part of #8858.
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
7c4205b412 Handle nested submenus of the Tools menu
There is some code that, for each submenu under Tools, shows the
selected item in the label of the submenu itself (e.g. before opening
the submenu). This was done whenever the Tools menu is opened and
iterated over all the items in the submenu to identify the s

Previously, this code only looked at direct children of the submenu.
Now, this code also looks through submenus recursively, to keep the code
working even when items are divided over sub-submenus.

This makes a small behaviour change: previously, the first selected item
with a non-zero label was used. Now, the first selected item is used,
which makes the code a bit cleaner. I cannot quickly see any case where
the first selected item would have an empty text (and even more that
there is *another* selected item), so this check seems unnecessary. If
this case would occur nonetheless, it would only mean the selected item
is not displayed in the tools menu, nothing would otherwise break.
2020-03-25 15:26:53 +01:00
Matthijs Kooijman
e803061709 Never leave programmers menu empty
When there are no programmers available for the current board, the
programmers menu would remain empty, which would prevent it from
unfolding and could make users think there was something wrong with the
menu.

Now, a disabled item with a message is added if no programmers are
available, which should make it more clear what is going on.

This is a followup for #9373.
2020-03-24 20:37:12 +01:00
Cristian Maglie
d6667dd4ca Added unit testing for UTF8 decoder in Serial 2020-03-24 15:24:50 +01:00
Cristian Maglie
a82f9a0e74 Silenced function deprecated warning 2020-03-23 18:42:35 +01:00
Martino Facchin
bb629d1ba0 Wait a bit before resuming serial monitor
Helps in case the bootloader port has not yet disappeared when upload completes successfully.
2020-03-23 17:37:01 +01:00
Martino Facchin
85a3b385eb
Merge pull request #9873 from matthijskooijman/allow-serial-change-when-disabled
Allow config changes and clear in disabled serial monitor and plotter
2020-03-23 12:12:56 +01:00
Martino Facchin
558ddd3d91 Don't restore sketch if last.sketch.location is out of display
`if ((screen.width != screenW) || (screen.height != screenH))` was making sure to reset every preference in case the display geometry changed.
Unfortunately, on Windows 10, `Toolkit.getDefaultToolkit().getScreenSize()` reports only the primary monitor either if external display is connected or not.

Fixes #9781
2020-03-23 12:07:40 +01:00
Martino Facchin
6f943ea4a8
Merge pull request #9843 from cmaglie/fix-proxy-prefs
Fixed user/pass preferences save for "manual" proxy settings.
2020-03-23 12:06:16 +01:00
Matthijs Kooijman
84e017fc36 Only show programmers for current board
Previously, the programmers menu always showed *all* programmers of
*all* platforms. This made it hard to find the programmer you need.

When selecting a programmer from another platform, it would typically
not work, since the tool definitions rely on specific variables to be
defined by the board, or files available in the variant directory, which
are typically platform-dependent. Also, some programmers might be
defined in multiple platforms, but there is currently no way to tell
which one is for the current platform an will work, and which is for
another platform and will break.

This commit changes the programmer menu to only show programmers from
the platforms that define the board and the core used. The latter is
only used when boar definition refers a core in another platform, in
which case the core and variant already have a strong coupling (the
variant must offer the right variables for the core to work), so that
would also apply to the programmer, so programmers from the referenced
core's platform can be expected to work.

When a board is selected, the menu of available programmers is
refreshed, but the currently selected programmer preference is
untouched. This might mean that a programmer is selected that is invalid
for the current board and will not actually work. This could be fixed by
clearing the current programmer when it becomes invalid, but that would
mean that changing to another platform and back would always require
reselecting the programmer to use, which seems counter-productive. An
alternative fix would be to check the programmer against the board and
throw an error, but that would require duplicating some code, which did
not seem worthwile (ideally, all this code will be moved to arduino-cli
anyway in the future).

This fixes #9373.
2020-03-23 12:05:38 +01:00