anakin-language-server icon indicating copy to clipboard operation
anakin-language-server copied to clipboard

The member variables of a class instance should map to an LSP Field (or Property)

Open rwols opened this issue 3 years ago • 2 comments

class Foo:

    def __init__(self):
        self.x = 1
        self.y = 2


f = Foo()
f.|

Currently, this will report the members x and y as variables, but they should be reported as fields (or properties). If they were reported as field, we can distinguish "regular" class members from "fancy" @property class members (see #15).

rwols avatar Jul 06 '20 21:07 rwols

@davidhalter What do you say about this one? Is Jedi interested in returning something like class_variable as the type of the x and y instead of statement? Thanks in advance.

muffinmad avatar Jul 20 '20 19:07 muffinmad

I don't see the difference and won't make that change. You will have to do that yourself. I think splitting up the types too much is not a good idea.

davidhalter avatar Jul 20 '20 21:07 davidhalter