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

[Bug] Autocomplete scans files that are not imported #757

Closed
laurensvalk opened this issue Oct 25, 2022 · 2 comments
Closed

[Bug] Autocomplete scans files that are not imported #757

laurensvalk opened this issue Oct 25, 2022 · 2 comments
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application

Comments

@laurensvalk
Copy link
Member

Describe the bug

Everything from all files appears to be scanned, and they are all suggested for autocomplete.

To reproduce

For example, if you define:

def my_useful_function(x, y):
    return x + y

in one file, it is suggested everywhere even if that module is not imported:

image

@laurensvalk laurensvalk added bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application labels Oct 25, 2022
@dlech
Copy link
Member

dlech commented Oct 25, 2022

This is a "feature" of the Monaco editor (there is probably an option turn it off). If there are no real code completions from Jedi, then the editor will just suggest anything that you have written before (this is what the "abc" icon means). For example my_func doesn't have to be a function. You can write # my_func and my_func will still be suggested.

@laurensvalk
Copy link
Member Author

Ah, that explains it.

Probably also explains why some terms are "remembered" even after you delete them.

there is probably an option turn it off

Yeah, perhaps that's a good idea. I'm trying to think of cases where we'd miss it, but I can't think of any yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working software: pybricks-code Issues with https://code.pybricks.com application
Projects
None yet
Development

No branches or pull requests

2 participants