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

Property Setter and Getter method do not indent correctly #209

Closed
simondrum opened this issue Sep 19, 2024 · 3 comments · Fixed by #244
Closed

Property Setter and Getter method do not indent correctly #209

simondrum opened this issue Sep 19, 2024 · 3 comments · Fixed by #244
Assignees
Labels
bug Something isn't working

Comments

@simondrum
Copy link
Collaborator

Properties that contains code in the setter or getter are not working

I tried this:

class AClass:
        DEFINE private property m_Total as integer no-undo
                get.
                set.
        
        DEFINE PUBLIC PROPERTY propertyWidthGetterAndSetter AS SomeClass NO-UNDO
                GET:
                                RETURN ?.
                        END GET.
                SET(INPUT pValue AS SomeClass):
                                IF valid-object(pValue) THEN DO:
                                        pValue:CallMethod().
                                END.
                        END SET.
        
        DEFINE PRIVATE VARIABLE propertyWidthGetter_ AS SomeClass NO-UNDO.
        DEFINE PROTECTED PROPERTY propertyWidthGetter AS SomeClass NO-UNDO
                GET():
                                IF NOT valid-object(propertyWidthGetter_) THEN propertyWidthGetter = new SomeClass().
                                
                                RETURN propertyWidthGetter_.
                        END GET.
end class.
@simondrum
Copy link
Collaborator Author

Do you wan't me to create issues when I find something not working as expected and no issue exists?

@PauliusKu
Copy link
Collaborator

@simondrum Yeah sure, you may create issues here. Preferably, add code snippet before formatting and after.

@PauliusKu
Copy link
Collaborator

@gustason can you have a look into this, and see if we can do anything about it, or do we need to register a tree-sitter bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants