Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Theia 1.37.0 #2027

Merged
merged 3 commits into from
May 9, 2023
Merged

chore: Theia 1.37.0 #2027

merged 3 commits into from
May 9, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Apr 20, 2023

Motivation

  • To use the latest version of the Theia framework,
  • To get rid of all yarn audit vulnerabilities,
  • To use the latest electron with contextIsolation enabled and nodeIntegration disabled, and
  • To enable the new high-contrast light theme.

Change description

  • Updated @theia/* to 1.37.0.
  • Fixed all yarn audit security vulnerabilities.
  • Updated to electron@23.2.4:
    • contextIsolation is true,
    • nodeIntegration is false, and the
    • webpack target is moved from electron-renderer to web.
  • Updated to typescript@4.9.3.
  • Updated the eslint plugins.
  • Added a new light high contrast theme to the IDE2.
  • High contrast themes use Theia APIs for style adjustments.
  • Support for ESM modules: "moduleResolution": "node16".
  • Node.js >= 16.14 is required.
  • VISX language packs were bumped to 1.70.0.
  • Removed undesired editor context menu items.
  • build: use execFileSync for npm scripts
  • build: use execa for the packager

% yarn audit
yarn audit v1.22.18
0 vulnerabilities found - Packages audited: 2091
✨  Done in 1.44s.

Light High Contrast theme:

ide2_hc_light.mp4

Other information

The application is not signed. On macOS, follow these steps.

Closes #321
Closes #1394

image
image

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: security Related to the protection of user data topic: theia Related to the Theia IDE framework labels Apr 20, 2023
@kittaakos kittaakos self-assigned this Apr 20, 2023
@kittaakos kittaakos mentioned this pull request Apr 20, 2023
4 tasks
@kittaakos
Copy link
Contributor Author

kittaakos commented Apr 24, 2023

Upstream: sindresorhus/cpy#109

Update: I patched it in IDE2, and provided a fix: sindresorhus/cpy#110.
Update2: Updated to cpy@10.0.0 with f2f347a.

@kittaakos kittaakos force-pushed the theia-1.37.0-next branch 5 times, most recently from c155a33 to b223ec3 Compare April 27, 2023 07:29
@kittaakos kittaakos marked this pull request as ready for review April 27, 2023 08:23
@kittaakos kittaakos changed the title chore: Theia 1.37.0-next chore: Theia 1.37.0 Apr 28, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: fixed!

## Unexpected change to `workbench.iconTheme` default

The default value of the workbench.iconTheme setting changed from none to theia-file-icons.

I don't have a strong opinion on the subject of what the default should be. However, the decision the last time the subject was discussed ((#1173) was that the default should be none and I am not aware of any change to the decision since then so I assume this was an inadvertent change.

To reproduce

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Delete the file at the following path:
    • Windows:
      C:\Users\<username>\.arduinoIDE\settings.json
      
      (where <username> is your Windows username)
    • Linux:
      ~/.arduinoIDE/settings.json
      
    • macOS:
      ~/.arduinoIDE/settings.json
      
  3. Start Arduino IDE.
    🐛 There is an icon on the left side of the editor tabs:
    image
  4. Open the bottom panel.
    🐛 There is an icon on the left side of the bottom panel tabs:
    image
  5. Run the "Preferences: Open Settings (UI)" command.
  6. Search for the workbench.iconTheme setting.

🐛 workbench.iconTheme is set to "File Icons (Theia)".

Expected behavior

The default value of the workbench.iconTheme setting is none.

Arduino IDE version

fc4882c (tester build for d66da25)

Operating system

Windows 11

@kittaakos
Copy link
Contributor Author

Expected behavior

The default value of the workbench.iconTheme setting is none.

Thanks for noticing it. An upstream change (eclipse-theia/theia@b33ab2c) broke the default behavior. I've adjusted it here: 7ff070c.

@AlbyIanna

This comment was marked as resolved.

@kittaakos
Copy link
Contributor Author

The style of the release notes in the IDE updater dialog is broken

Thanks for checking it.

The breaking change was eclipse-theia/theia@1b5ff9e#diff-d8d45a890507a01141c010ad4a6891edf2ae727cfa6dfe604cebbd667812cccbR68. I fixed it
45aeb7f.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: Fixed by 6adde6b

## **Edit > Paste** menu item is non-functional

Describe the problem

🐛 Selecting the Edit > Paste menu item does not have any effect.

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Select the text // put your setup
  3. Select Edit > Copy from the Arduino IDE menus.
  4. Move the cursor to another location in the sketch.
  5. Select Edit > Paste from the Arduino IDE menus.

🐛 The copied text is not pasted.

The IDE displays a warning notification:

⚠ Please use the browser's paste command or shortcut.

Expected behavior

Select Edit > Paste from the Arduino IDE menus pastes the content of the clipboard into the editor at the cursor location.

Arduino IDE version

0f1bf56 (tester build for 45aeb7f)

Operating system

  • Windows 11
  • Ubuntu 22.04

Additional context

The fault does not occur when using the build from the main branch (51f69f6)

I am not able to reproduce the fault on my macOS machine.


The fault also occurs when using the "Paste" item of the editor context menu.

Pasting via the Ctrl+V keyboard shortcut works as expected, so the fault is specific to the Edit > Paste menu item.


I notice no keyboard shortcut is listed for Paste in the Edit menu:

image

compare to 51f69f6:

image

The shortcut is also not defined for the "Paste" command in the "Keyboard Shortcuts" view:

image

compare to 51f69f6:

image

However, the fault still occurs even after I assign the Ctrl+V keybinding to the "Paste" command.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: fixed by 6adde6b

## **Show Sketch Folder** has no effect

Describe the problem

The sketch folder is not opened when you select Sketch > Show Sketch Folder from the Arduino IDE menus.

To reproduce

  1. Select Sketch > Show Sketch Folder from the Arduino IDE menus

🐛 The folder of the sketch is not opened in the file browser.

Expected behavior

The folder of the sketch currently open in the IDE window is opened in the file browser when Sketch > Show Sketch Folder is selected from the Arduino IDE menus.

Arduino IDE version

0f1bf56 (tester build for 45aeb7f)

Operating system

Windows 11

Additional context

The fault does not occur when using the build from the main branch (51f69f6)

The fault does not occur on my Linux and macOS machines.


Nothing is printed to the logs when I do a Show Sketch Folder operation.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: resolved by 7534d8a

## Non-functional language server-related items added to editor context menu

This is an expansion of the existing problem tracked at #1394

Maybe the conclusion will be the same:

#1394 (comment)

The LS should use them. Instead of removing the context menu items

but I thought it was at least worth mentioning because we now have a significant number of non-functional items and I am not aware of any work, plans, or investigation related to bringing them into a functional state.

Describe the problem

New items were added to the editor context menu:

  • Go to Declaration
  • Peek > Peek Declaration
  • Go to Type Definition
  • Peek > Peek Type Definition
  • Go to Implementations
  • Peek > Peek Implementations
  • Go to References
  • Peek > Peek References

🐛 None of the newly added items are functional.

To reproduce

  1. Create a sketch with the following content:
    typedef int foo_t;
    foo_t bar();
    foo_t bar() {
      return 42;
    }
    void setup() {
      bar();
    }
  2. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
  3. Wait for the the "indexing" process to finish, as indicated at the left side of the status bar.
  4. Right click on the bar on line 7.
  5. Select "Go to Declaration" from the context menu.
    🐛 Nothing happens (expected result is that the cursor would move to the bar function declaration at line 2)
  6. Right click on the bar on line 7.
  7. Select "Peek > Peek Declaration" from the context menu.
    🐛 Nothing happens (expected result is that a peek of the bar declaration would open)
  8. Right click on the foo_t on line 2.
  9. Select "Go to Type Definition" from the context menu.
    🐛 Nothing happens (expected result is that the cursor would move to the foo_t type definition at line 1)
  10. Right click on the foo_t on line 2.
  11. Select "Peek > Peek Type Definition" from the context menu.
    🐛 Nothing happens (expected result is that a peek of the foo_t type definition would open)
  12. Right click on the bar on line 2.
  13. Select "Go to References" from the context menu.
    🐛 Nothing happens (expected result is that a peek would open with all references to bar)
  14. Right click on the bar on line 2.
  15. Select "Peek > Peek References" from the context menu.
    🐛 Nothing happens (expected result is that a peek would open with all references to bar)

Expected behavior

All editor context menu items are functional.

Arduino IDE version

0f1bf56 (tester build for 45aeb7f)

Operating system

Windows 11

Additional context

The non-functional menu items are not present when using the build from the main branch (51f69f6)


I did not test "Go to Implementations" and "Peek Implementations" because I don't know what "implementation" means in the context of a C++ program.

@kittaakos
Copy link
Contributor Author

kittaakos commented May 5, 2023

We must update the minimum Node.js version. It's >=16.13.0:

yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning @puppeteer/browsers@0.5.0: Invalid bin entry for "@puppeteer/browsers" (in "@puppeteer/browsers").
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
error @npmcli/arborist@6.2.3: The engine "node" is incompatible with this module. Expected version "^14.17.0 || ^16.13.0 || >=18.0.0". Got "16.0.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Update:

It's 16.14.0:

info "@nrwl/nx-win32-arm64-msvc@15.9.2" is an optional dependency and failed compatibility check. Excluding it from installation.
error lru-cache@9.1.0: The engine "node" is incompatible with this module. Expected version "14 || >=16.14". Got "16.13.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@kittaakos
Copy link
Contributor Author

kittaakos commented May 5, 2023

Edit > Paste menu item is non-functional

Upstream: eclipse-theia/theia#12487

I will investigate. Thank you for noticing it 🙏


Update:

I found a quick workaround: 6adde6b

@kittaakos
Copy link
Contributor Author

We must update the minimum Node.js version. It's >=16.13.0:

Done. It's updated to 16.14.0.

Show Sketch Folder has no effect

I have fixed it and verified it from the latest build. Please re-check

Edit > Paste menu item is non-functional

I added a workaround. It worked for me with the latest build on Windows.

My build:

Version: 2.1.1-snapshot-e2539a8
Date: 2023-05-05T10:08:57.749Z
CLI Version: 0.32.2

Copyright © 2023 Arduino SA

@AlbyIanna

This comment was marked as resolved.

@kittaakos
Copy link
Contributor Author

Some strings are not getting localised

A couple of examples:

Very nice 👍

I have updated the VS Code extension language pack versions to match Theia's supported VS Code API version: https://github.com/eclipse-theia/theia/blob/v1.37.0/dev-packages/application-package/src/api.ts#L21. See the changes:

Screen Shot 2023-05-06 at 17 07 38

Screen Shot 2023-05-06 at 17 04 31

I also provided a better workaround for the cut/copy/paste. I will wait for a Windows build and do a double check, but it works on macOS as it was with 2.1.0

@kittaakos
Copy link
Contributor Author

I have updated the VS Code extension language pack versions to match Theia's supported VS Code API version:

Some supported languages do not have a more recent extension version available. We must check why and what are the implications of using older language packs with Theia using VS Code 1.72.x APIx:

bg, hu, nl, and uk extensions do not have a more recent version available.

per1234
per1234 previously requested changes May 7, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: resolved by bcb7f7d

## Some UI actions have no effect if performed soon after opening window

After opening an IDE window, some sort of an initialization process continues even after the UI appears in the window.

🐛 Some actions have no effect if the user performs them during this time window.

To reproduce

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Wait until the UI populates in the new window.
  3. Immediately* use the mouse to select File > New Sketch from the Arduino IDE menus.
    On Windows, this must be done while the mouse pointer has the "working in background" style while hovered over the IDE window:
    image

🐛 A new window does not open.

Expected behavior

UI elements are usable whenever they are exposed to the user.

Arduino IDE version

0fb9a06 (tester build for ed60048)

Operating system

  • Windows
  • macOS

Operating system version

  • Windows 11
  • macOS Ventura

Additional context

The fault does not occur when using the build from the main branch (964ea3b)


I used New Sketch in the demo, but the fault occurs with other UI operations as well.


I was not able to reproduce the fault on my Linux machine.

The fault does not occur when a keyboard shortcut (e.g., Ctrl+N) or even keyboard navigation of the GUI is used to trigger the operation instead of the mouse.

The fault does not occur if I make a keystroke before the UI action.


* On my high spec PC the window is ~5 seconds. It will likely be significantly longer for users with lower performance systems (and thus those users will be statistically more likely to be impacted by the regression).

@kittaakos
Copy link
Contributor Author

I have updated the VS Code extension language pack versions to match Theia's supported VS Code API version:

Something needs to be corrected. We might need to pick another version like we did last time. Related: #1449

Screen Shot 2023-05-08 at 09 05 15

@kittaakos
Copy link
Contributor Author

Non-functional language server-related items added to editor context menu

Fixed. Also, #1394 should be fixed.

Screen Shot 2023-05-08 at 20 10 51

Please mention in the review if something else needs to be removed. Thanks!


I have updated the VS Code extension language pack versions to match Theia's supported VS Code API version:

Something needs to be corrected. We might need to pick another version like we did last time. Related: #1449

Screen Shot 2023-05-08 at 09 05 15

Switched to 1.17.0 language extension.

Screen Shot 2023-05-08 at 17 08 08

Screen Shot 2023-05-08 at 17 07 53


Some UI actions have no effect if performed soon after opening window

The ugliest workaround is available for verification, but it works. Please verify it.

hack_for_nonfunctional_menu_items.mp4

Please revisit the behavior with the most recent changes. Thanks a lot for your persistence. This PR takes way longer than I anticipated.

@kittaakos
Copy link
Contributor Author

Switched to 1.17.0 language extension.

This still applies 👇 . From #2027 (comment):

Some supported languages do not have a more recent extension version available. We must check why and what are the implications of using older language packs with Theia using VS Code 1.72.x APIx:

bg, hu, nl, and uk extensions do not have a more recent version available.

@per1234 per1234 dismissed their stale review May 9, 2023 08:06

The issues I reported via my previous reviews have all been resolved. Thanks!

Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All my comments were addressed! I couldn't find any other issue and the code looks good to me. Thank, Akos!

Akos Kitta added 3 commits May 9, 2023 16:14
 - Updated `@theia/*` to `1.37.0`.
 - Fixed all `yarn audit` security vulnerabilities.
 - Updated to `electron@23.2.4`:
   - `contextIsolation` is `true`,
   - `nodeIntegration` is `false`, and the
   - `webpack` target is moved from `electron-renderer` to `web`.
 - Updated to `typescript@4.9.3`.
 - Updated the `eslint` plugins.
 - Added the new `Light High Contrast` theme to the IDE2.
 - High contrast themes use Theia APIs for style adjustments.
 - Support for ESM modules: `"moduleResolution": "node16"`.
 - Node.js >= 16.14 is required.
 - VISX langage packs were bumped to `1.70.0`.
 - Removed undesired editor context menu items. (Closes arduino#1394)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos
Copy link
Contributor Author

Some supported languages do not have a more recent extension version available. We must check why and what are the implications of using older language packs with Theia using VS Code 1.72.x APIx:

bg, hu, nl, and uk extensions do not have a more recent version available.

We must check why

@kittaakos
Copy link
Contributor Author

Great reviews! Thanks a lot for your time and patience. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: security Related to the protection of user data topic: theia Related to the Theia IDE framework type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-functional language server items in editor context menu In Dark mode top of the window is white
5 participants