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

Code pane context menu #18

Open
retailcoder opened this issue Feb 12, 2023 · 2 comments
Open

Code pane context menu #18

retailcoder opened this issue Feb 12, 2023 · 2 comments
Labels
component: Rubbeduck.UI Issue involves UI components feature: editor shell Issues that relate to the editor shell skill:xaml Issues that involve XAML markup and WPF

Comments

@retailcoder
Copy link
Member

retailcoder commented Feb 12, 2023

We need to implement the code pane context menu completely from scratch, including the bare-bones stuff like Copy and Paste (surely we want these commands in the Rubberduck Editor 🤔😂).

TODO list a subtask for each command to wire up here

Note: some of these commands would remain no-op (and hidden) until a corresponding LSP server method is actually implemented, i.e. we want to wire up "find references" even if the RPC request for it comes back in error.

@retailcoder retailcoder added skill:xaml Issues that involve XAML markup and WPF feature: editor shell Issues that relate to the editor shell component: Rubbeduck.UI Issue involves UI components labels Feb 12, 2023
@mansellan
Copy link
Member

Would be good to make some of the context menus more... contextual too, for example how VS solution explorer changes radically depending on tree node type.

@retailcoder
Copy link
Member Author

Explorer contexts:

  • Project context, for the project nodes
  • Library context, for the project/library reference nodes
  • Folder context, for folder nodes

Shared contexts:

  • Module context, for module nodes and when the selection/caret isn't anywhere special
  • Member context, for member nodes and when the selection/caret is on or inside a member (including module-level members; not necessarily a procedure)

Additional editor contexts:

  • Local context, when the selection/caret is on a local variable or parameter declaration or reference.
  • Expression context, when the selection/caret is in an expression.
  • Literal context, when the selection/caret is on a literal token of any kind, including strings.
  • Comment context, when we're in a comment.
  • Annotation context, when the comment is actually an annotation.
  • Marker context when the comment is (or contains) a recognized TODO marker.

Any others?

Identifying the context could greatly simplify the commands' CanExecute conditions and avoid repeated/redundant checks if done right. A mechanism to discover the current context should be put in place first (some LSP server requests will be needed for that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Rubbeduck.UI Issue involves UI components feature: editor shell Issues that relate to the editor shell skill:xaml Issues that involve XAML markup and WPF
Projects
None yet
Development

No branches or pull requests

2 participants