sashi0034 / angel-lsp

AngelScript Language Server for VSCode
https://marketplace.visualstudio.com/items?itemName=sashi0034.angel-lsp
MIT License
14 stars 5 forks source link

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

Open MineBill opened 1 month ago

MineBill commented 1 month ago

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 commented 1 month ago

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

I will take some time to fix this!