Skip to content

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

Closed
@per1234

Description

@per1234

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

Activity

kittaakos

kittaakos commented on Sep 5, 2022

@kittaakos
Contributor

🐛 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

per1234 commented on Sep 5, 2022

@per1234
ContributorAuthor

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

kittaakos commented on Sep 6, 2022

@kittaakos
Contributor

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

per1234 commented on Sep 6, 2022

@per1234
ContributorAuthor

@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?

changed the title [-]Non-functional items in editor context menu[/-] [+]Non-functional language server items in editor context menu[/+] on Sep 22, 2022
berparis

berparis commented on Dec 12, 2022

@berparis

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

added 2 commits that reference this issue on May 8, 2023
7534d8a
7ad0ab7
added a commit that references this issue on May 9, 2023
192aac5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @kittaakos@per1234@91volt@berparis

    Issue actions

      Non-functional language server items in editor context menu · Issue #1394 · arduino/arduino-ide