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 UI for editing Class/Form Attributes #4227

Closed
ThunderFrame opened this issue Jul 23, 2018 · 4 comments
Closed

Add UI for editing Class/Form Attributes #4227

ThunderFrame opened this issue Jul 23, 2018 · 4 comments
Labels
discussion enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-code-explorer module-and-procedure-attributes

Comments

@ThunderFrame
Copy link
Member

With the attributes-as-annotations approach seemingly dead in the water, Rubberduck needs a UI for inspecting and editing VB_Attributes. In VBA:

  • Standard Modules and Document Modules only have their Name attributes exposed.
  • Class modules expose their name and instancing attributes in the Properties Window, but not their PredeclaredId attribute.
  • UserForms expose their Name attribute, but not their Instancing attribute. Nor do they expose their PredeclaredId attribute, but a UserForm can't be made NOT Predeclared.

Furthermore, modules and procedures can have other, optional attributes, so ideally a UI would let you add, edit and remove the optional attributes.

Once an attribute is edited and validated, the module would need to be exported, removed, edited in the exported file, and then re-imported. Obviously, this won't work for Document modules.

Question is, what form should that UI take?

  • An attributes pane within the Code Explorer - This would seem to be the most logical UI, as the CE already deals with Modules and declarations, so it's a natural fit.
  • An attributes pane as a dedicated ToolWindow
  • A popup dialog that has checkboxes, dropdowns and textboxes for various attributes - perhaps mimicking the VB6 attributes dialog - This doesn't allow for easily inspecting the attributes
  • Make the attribute text visible in the AvalonEdit CodePane - Without intellisense, this relies upon the user knowing the editability and valid syntax and values for various attributes.

We also need to consider editing attributes for multiple components at once: see #4185

@ThunderFrame ThunderFrame added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. discussion feature-code-explorer module-and-procedure-attributes labels Jul 23, 2018
@bclothier
Copy link
Contributor

I definitely am not fan of VB6's propensity to use popups gratuitously. So that approach for me is no-go. It would be only appropriate for performing mass edits.

AvalonEdit seems to be a way off but even if it is here today, a dediccated toolwindow seems to me the most useful.

I would probably start with supporting editing only an indviviudal component then look at a popup UI for mass editing after, reusing the commands created to support those operations.

@ThunderFrame
Copy link
Member Author

What if it worked like editing the properties for a selection of multiple controls on a UserForm, where only the shared properties are editable?

@MDoerner
Copy link
Contributor

MDoerner commented Jul 23, 2018

Why can't we use the annotation as attributes approach here? The only major problem with this approach was that it is very hard to match up contexts in the code pane version and the exported version.

For the module wide attributes that should not be a problem as they only exist once and are not visible in the code pane anyway.

The problem with the approach have always been the procedure attributes, and the problem that it is kind of disrupting to export, delete and then reimport modules.

@bclothier
Copy link
Contributor

This is covered in the linked issue #4790 & #5120, so closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-code-explorer module-and-procedure-attributes
Projects
None yet
Development

No branches or pull requests

3 participants