Skip to content

Remove "Format Selection" from editor context menu #1395

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

Closed
3 tasks done
per1234 opened this issue Sep 4, 2022 · 3 comments
Closed
3 tasks done

Remove "Format Selection" from editor context menu #1395

per1234 opened this issue Sep 4, 2022 · 3 comments
Assignees
Labels
conclusion: declined Will not be worked on 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 request

Remove the "Format Selection" item from the editor context menu.

🙂 The IDE's user interface will be made more streamlined without significant loss of functionality. The capability will still be available via the keyboard shortcut and "Format Selection" command palette item if it is wanted by some users.

Describe the current behavior

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

image

There are two items in the menu for formatting code:

  • Format Document
  • Format Selection

The first provides the essential functionality of formatting the entire sketch file, more commonly accessed via the Tools > Auto Format menu item or Ctrl+T keyboard shortcut.

The second provides the more niche capability of applying formatting only to the text currently selected in the editor view. It is not clear that this is something of use to any significant number of users.

Arduino IDE version

2.0.0-rc9.2.snapshot-20cc34c

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

Related: #1394

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details
@per1234 per1234 added 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 phase: design Work is in the design phase criticality: medium Of moderate impact labels Sep 4, 2022
@kittaakos
Copy link
Contributor

Is this required for .ino files only or remove all the IDE2? For example, open the settings.json file and check the context menu.

@per1234
Copy link
Contributor Author

per1234 commented Sep 5, 2022

The GitHub issue was created by me, but I actually only published it from the internal backlog (9890, I split it into two separate issues since there appeared to be distinct motivations for the requests: not working vs. not needed).

I see @ubidefeo was the original creator of the issue, so maybe they can answer the question.

@per1234
Copy link
Contributor Author

per1234 commented Nov 22, 2022

Since we never received any feedback after 2.5 months, I'm going to close this as declined. The feature works fine.

I don't think the feature is at all useful to the average Arduino IDE user, but there is a use case for this feature in specific circumstances: Sometimes you are contributing to a codebase with inconsistent formatting due to sloppy prior development work. As a conscientious developer, you want to correctly format the code you are contributing. However, it would not be appropriate to submit formatting changes to unrelated code with your contribution. In this case, doing a universal format and then having to sort your contribution out of the resulting huge diff when staging the commit can be quite some work. Being able to selectively format only your own code allows you to avoid that.

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2022
@per1234 per1234 assigned per1234 and unassigned 91volt Nov 22, 2022
@per1234 per1234 added the conclusion: declined Will not be worked on label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: declined Will not be worked on 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

No branches or pull requests

3 participants