Mercury editor: inconsistent indentation for property setters with an access modifier

I noticed an indentation inconsistency in the Mercury editor when formatting a property whose setter has an explicit access modifier.

For example:

Public Class RectPane
    Inherits MermaidPane

    Private _fWidth As Double
    Private _fHeight As Double

    Public Property Width As Double
        Get
            Return _fWidth
        End Get
    Private Set(val As Double)
        _fWidth = val
    End Set
    End Property

    Public Property Height As Double
        Get
            Return _fHeight
        End Get
    Private Set(val As Double)
        _fHeight = val
    End Set
    End Property
End Class

As shown in the attached screenshots, the editor indents Private Set(...) differently from Get.

If I remove the Private modifier and write only:

Set(val As Double)

the getter and setter are indented consistently.

Actual behavior

A setter with an explicit access modifier, such as Private Set, is placed at a different indentation level from the corresponding Get block.

Expected behavior

Get and Private Set should be aligned at the same indentation level, because both are accessors of the same property.

For example:

Public Property Width As Double
    Get
        Return _fWidth
    End Get
    Private Set(val As Double)
        _fWidth = val
    End Set
End Property

This does not appear to affect compilation, but it makes property formatting visually inconsistent. It would be useful if the editor’s automatic indentation treated access-modified setters in the same way as ordinary setters.

Is this on typing, or when pasting or reformatting with Ctrl-I/Ctrk+Shift-I?

when (shift) ctrl I

Logged as bugs://E27766.

bugs://E27766 was closed as fixed.

1 Like