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

Methods marked with 'property' are not offered for completion as properties. #21

Open
MineBill opened this issue Jul 28, 2024 · 2 comments

Comments

@MineBill
Copy link
Contributor

Consider the following example:

class Vector {
    float X, Y, Z;

    Vector() {}
    Vector(float x, float y, float z) {
        X = x;
        Y = y;
        Z = z;
    }
}

class MyClass {
    private void Test() {
        auto v = Up;
    }

    Vector get_Up() const property {
        return Vector(0, 1, 0);
    }
}

The method get_Up is declared with property and as such Angelscript allows us to use this method as a property without the get_ prefix and without calling it:

auto v = Up;

However, the above line of code will be underlined with an error and the property Up will not be offered for completion:

image

Although, in a real script one would use the "normal" way of declaring getters and setters, when registering them from the application side, we must still use the function version.

More info can be found here.

It is also important to note the ScriptEngine option asEP_PROPERTY_ACCESSOR_MODE that changes the behavior, so the LSP might consider allowing for this option as well. More info here.

@sashi0034
Copy link
Owner

Thanks for pointing that out. I overlooked the support for traditional property access.

I will take some time to fix this!

@sashi0034
Copy link
Owner

Properties defined with get_ and set_ are now recognized and you can use them in completion.
However, there are still bugs related to renaming and definition jumps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants