Closed rwols closed 4 years ago
The simple and brittle solution that comes to mind is to look if line before completion candidate definition is @property
.
But let's expand Jedi's types range by little if we can! ;)
@davidhalter Can you please tell whether it is possible to make this test pass in Jedi:
def test_completion_property(Script):
script = Script(dedent('''\
class Foo:
@property
def bar(self):
return 42
foo = Foo()
foo.b
'''))
c, = script.complete(9, 5)
assert c.type == 'property'
Thanks!
Going to include that in 0.18.0 probably. But note that this is not going to be perfect and more like a heuristic (which is probably good enough).
This will be fixed in 0.18.0. IMO it was never really a bug, but it's definitely nicer this way.
@davidhalter Awesome! Thanks!
@rwols You can install latest Jedi's master, anakinls
v1.18.1 already supports Jedi's property
completion type.
This will report
bar
as a function, but it should be a property (or field).