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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-functional language server items in editor context menu #1394

Closed
3 tasks done
per1234 opened this issue Sep 4, 2022 · 5 comments 路 Fixed by #2027
Closed
3 tasks done

Non-functional language server items in editor context menu #1394

per1234 opened this issue Sep 4, 2022 · 5 comments 路 Fixed by #2027
Assignees
Labels
conclusion: resolved Issue was resolved criticality: medium Of moderate impact phase: design Work is in the design phase priority: medium Resolution is a medium priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Sep 4, 2022

Describe the problem

Right clicking on the sketch editor view opens a context menu that offers various useful operations that can be done on the selection:

image

馃悰 The "Refactor..." and "Source Action..." context menu items don't appear to be usable with Arduino sketches. They increase the complexity and clutter of the Arduino IDE user interface without adding anything of value.

To reproduce

  1. Select any code in the sketch editor view.
  2. Right click on the selection.
  3. Select "Refactor..." from the context menu.
    馃槙 A tooltip appears: "No refactorings available"
  4. Right click on the selection.
  5. Select "Source Action..." from the context menu.
    馃槙 A tooltip appears: "No source actions available"

Expected behavior

All items in the editor context menu are useful.

Arduino IDE version

2.0.0-rc9.2.snapshot-20cc34c

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

Additional Reports

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added criticality: medium Of moderate impact phase: design Work is in the design phase priority: medium Resolution is a medium priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Sep 4, 2022
@kittaakos
Copy link
Contributor

kittaakos commented Sep 5, 2022

馃悰 The "Refactor..." and "Source Action..." context menu items don't appear to be usable with Arduino sketches.

The LS should use them. Instead of removing the context menu items, I recommend supporting them in IDE2 in the long run.


Update: if we remove them, we need to decide whether to remove them for .ino files or all over the application. (Related: #1395 (comment)) Thank you!

@per1234
Copy link
Contributor Author

per1234 commented Sep 5, 2022

The question is: how difficult will it be to support them, and how long will it take to add that? If it will be a long time and the context menu customization is easy to do, I think it would be worth removing them provisionally.

all over the application

I would remove them anywhere they are not working.

I also don't think it is worth making any effort or using system resources to provide enhanced functionalities for JSON (though I would make an exception for the settings.json schema). Only a tiny fraction of users will want to directly edit JSON files in the IDE. If they need enhanced JSON capabilities, they can use any of the many existing tools that provide it.

@kittaakos
Copy link
Contributor

kittaakos commented Sep 6, 2022

I would remove them anywhere they are not working.

IDE2 does not know it upfront. If a language (json, ino) is contributed to IDE2, the capabilities come from the server the menu items will be there. IDE2 has no chance to figure out if the capabilities are functional or not.

The question is: how difficult will it be to support them

I think the problem is here. The Arduino LS remaps the code actions from clangd as they are, but the Arduino LS's id is not clangd, but the language ID is ino so the quick fixes, refactorings won't work.

If it will be a long time and the context menu customization is easy to do,

Customizing these menus is not trivial either. I propose sticking to the natural workflow and fixing the real issue instead of trying to remove the menu items as part of a hack.

@per1234
Copy link
Contributor Author

per1234 commented Sep 6, 2022

@ubidefeo, since this was originally your issue (9890 in the internal backlog), what do you think? Should we close this in favor of a bug report in arduino/arduino-language-reference tracking the defect that causes these context menu items to be non-functional?

@per1234 per1234 changed the title Non-functional items in editor context menu Non-functional language server items in editor context menu Sep 22, 2022
@berparis
Copy link

Hello,
I don't understand what exact status now is that bug report, but it would be very usefull to have this feature working.
I'm using Arduino IDE 2.0.3 with MacOS Ventura 13.0.1 and I observe exactly the described problem here on top of page.
Thanks, Bernard

@per1234 per1234 mentioned this issue May 5, 2023
4 tasks
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue May 8, 2023
Closes arduino#1394

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to kittaakos/arduino-ide that referenced this issue May 9, 2023
 - 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>
kittaakos pushed a commit that referenced this issue May 9, 2023
 - 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 #1394)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@per1234 per1234 added the conclusion: resolved Issue was resolved label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved criticality: medium Of moderate impact phase: design Work is in the design phase priority: medium Resolution is a medium priority topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants