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

Fix #1988 #1989

Merged
merged 4 commits into from
Apr 25, 2024
Merged

Fix #1988 #1989

merged 4 commits into from
Apr 25, 2024

Conversation

pyscripter
Copy link
Contributor

See #1988

Test:

from jedi import Script

source = """class Test:
    str: str

print(Test.str.)
"""

source2 = """class Picture:
    bitmap: bytes

class Image:
    Picture: Picture

img = Image()
pic = img.Picture.
"""

def main():
    script = Script(source)
    completions = script.complete(4, 15)
    assert completions[0].name == 'capitalize'

    script = Script(source2)
    completions = script.complete(8, 18)
    assert completions[0].name == 'bitmap'

if __name__ == '__main__':
    main()

Copy link
Owner

@davidhalter davidhalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a test to test/completion/pep0484_basic.py? You can problaby just take the code piece you provided and add a "test":

    str: str = 'abc'

#? ['upper']
Test.str.upp

Thanks!

jedi/inference/syntax_tree.py Outdated Show resolved Hide resolved
jedi/inference/syntax_tree.py Outdated Show resolved Hide resolved
@pyscripter
Copy link
Contributor Author

Added test and addressed your feedback.

@davidhalter davidhalter merged commit a4574a5 into davidhalter:master Apr 25, 2024
114 checks passed
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

Successfully merging this pull request may close these issues.

2 participants