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

Add commands to outline elements #49925

Open
jrieken opened this issue May 15, 2018 · 9 comments
Open

Add commands to outline elements #49925

jrieken opened this issue May 15, 2018 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality outline Source outline view issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented May 15, 2018

The outline view should offer commands that can be run straight from an element. E.g. rename but also triggering things like find references et al. Similar to the editor-context-menu this could be made open for contributions

@jrieken jrieken self-assigned this May 15, 2018
@jrieken jrieken added feature-request Request for new features or functionality outline Source outline view issues labels May 15, 2018
@jrieken
Copy link
Member Author

jrieken commented May 15, 2018

from #5605 (comment)

There are also refactoring features built into this UI in Eclipse:
Dragging a member and dropping it to another position also refactors the code by moving the code block belonging to that member to the position indicated by the drop target.
Deleting a tree node also deletes the corresponding sections of code in the file.
Any node has a context menu that allows for different operations, e.g. rename
The context menu also offers things like "find references" or "open call hierarchy"

@yanckst
Copy link

yanckst commented Jul 2, 2018

As requested, this comment comes from issues/53451

Right now, the only features we have are a filter and a sort for finding/sorting elements in the code.

What if we can add more feature in this view? I don't know if it was designed for that, but it can help a lot for refactoring the code.

Here's a GIF demonstrating the current features :
vscode-outline

What we can add :

  • Contextual Menu
  • Rename
  • Delete
  • Drag/Drop

For the Rename refactoring :

When the user right-click on the mouse, a contextual menu should appear and a "Rename" choice should be there. When the user, click on rename, it should rename the entity (constructor, property, method, etc) in the code and update all references. The user could also user the the keyboard shortcut like F2 for renaming, like we do in the application too.

For the Delete refactoring :

When the user right-click on the mouse, a contextual menu should appear and a "Delete" choice should be there. When the user, click on delete, it should delete the entity (constructor, property, method, etc) in the code and update all references. The user could also user the the keyboard shortcut like del for deleting, like we do in the application too.

For the Drag/Drop refactoring :

The user should be able to move the entity and it should update in the code too, not only in the outline view. The cursor should be changed by the "move" cursor.

Nice to have if it's possible :

When displaying the entities (constructors, properties, methods, etc). It would be very nice to have something visual to distinguish public vs protected vs private. Right now, all entities are displayed. When you have a huge class, sometimes you want to spot the private methods region. If you have something visual in this view, it would help a lot finding what you are looking for. Like changing the icon or the font. If a entity is private, the font could be darker than the public ones.

If it's possible, we can also add a sorting in the sorting choices. We can add something like "Sort by: Member access" below the "Sort by: Type"

In the outline view when opening a packages.config, it will be very nice if we can have a context menu there. Right now, the outline display the dependencies, the devdependencies the configs, and more. It would be practical if we can have a context menu. If the user right-click on a package name in the devdependencies or the dependencies, we can show 2 options: "update" and "delete", When selecting the "update" option, basically, it updates the package and when we select the "delete" option, it removes the package. It can call npm directly in the background. If you right-click on the script displayed in the outline view, it should display the contextual menu with an action : "Run script". Basically, when the user clicks on "run script" in the menu, the command npm run script is called.

If anyone has any refactoring ideas that I didn't mention, please feel free to add a comment. 😊😊

@kAlvaro
Copy link

kAlvaro commented Jul 11, 2018

@yanckst The public vs protected vs private bit was reported afterwards (#49995) and someone said it's mostly a duplicate of #23927.

@yanckst
Copy link

yanckst commented Jul 16, 2018

@kAlvaro I didn't saw the feature request when I added my comment, but I think my comment is still relevant

@aisbergde
Copy link

it is an old feature request and nothing happens. Are there any workarounds or plugins to work on the outline level?

Especially I miss a way to easy move and indent sections, when editing markdown files. A separate extension also would be fine, but I can't find any.

I can imagine that it is not so easy to implement something working in all languages, but maybe it would be possible to extend the outline view only for specific languages if it is to hard to implement a general solution?

@Blaiski
Copy link

Blaiski commented May 6, 2021

Just adding my interest for a menu contribution point in the outline view (i.e., outline/item/context), similar to all other menu contribution points. My extension is currently resorting to inline codeActions but this is not elegant/efficient as user will have to scroll from one DocumentSymbol to another in the editor.

@Harshita-mindfire
Copy link

Harshita-mindfire commented Sep 23, 2021

Adding a +1 for this feature request. I would appreciate the contextual UI to rename my note headers(while working with md files) with right click on outline, then to run a command for the same operation.

@sandipchitale
Copy link

sandipchitale commented Feb 16, 2023

+1 for things like setting CTOR, Overloaded Method and Field access/modify breakpoints in Java.

@markusroessler
Copy link

+1 especially the drag&drop feature would be very helpful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality outline Source outline view issues
Projects
None yet
Development

No branches or pull requests

8 participants