Rubberduck: Add option for no blank lines between Get/Let/Set properties generated by encapsulate field

Created on 2 Dec 2020  路  1Comment  路  Source: rubberduck-vba/Rubberduck

Justification
Some users prefer no spacing between the properties. Extra spacing adds to scrolling

Description
As the default for events handlers, when using Implements keyword, and others I'm unaware of is to include a space between the members I assume we keep this as the default behavior. Add option to remove/include blank lines between properties.

Additional context

'Before Encapsulate Field
Public Foo As String
'After Encapsulate Field - Note spacing between Get/Let
Private Type TSheet1
    Foo As String
End Type

Private this As TSheet1

Public Property Get Foo() As String
    Foo = this.Foo
End Property

Public Property Let Foo(ByVal RHS As String)
    this.Foo = RHS
End Property
'This feature request would change - Spacing between Get/Let has been removed
Private Type TSheet1
    Foo As String
End Type

Private this As TSheet1

Public Property Get Foo() As String
    Foo = this.Foo
End Property
Public Property Let Foo(ByVal RHS As String)
    this.Foo = RHS
End Property

For multiple backing fields

Private Type TSheet1
    Foo As String
    Bar As Range
End Type

Private this As TSheet1

Public Property Get Foo() As String
    Foo = this.Foo
End Property
Public Property Let Foo(ByVal RHS As String)
    this.Foo = RHS
End Property

Public Property Get Bar() As Range
    Set Bar = this.Bar
End Property
Public Property Set Bar(ByVal RHS As Range)
    Set this.Bar = RHS
End Property

...
enhancement

Most helpful comment

I think this should be an indenter setting; the generated code goes through the indenter, and there's already a setting for vertical whitespace between scopes - I'm guessing we'd be looking at a checkbox to perhaps "remove vertical space between property members" here.

Implementing this in the refactoring itself would be the wrong place I think.

>All comments

I think this should be an indenter setting; the generated code goes through the indenter, and there's already a setting for vertical whitespace between scopes - I'm guessing we'd be looking at a checkbox to perhaps "remove vertical space between property members" here.

Implementing this in the refactoring itself would be the wrong place I think.

Was this page helpful?
0 / 5 - 0 ratings