-
Notifications
You must be signed in to change notification settings - Fork 6
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
Invalid syntax in Enum stubs, and no code completion for enums #9
Comments
That is odd! I'll play around with it tonight and let you know. Two questions that'll help me:
|
All right, so the main issue was in translating the LEGO API. The display method as written would only accept a string, but the ImageFile is an enum class, so it wasn't considered a valid parameter (which is why it wasn't accepting an ImageFile until you edited the value to be a string). I've changed the method in the stubs package to accept a string OR an ImageFile value (which is what the brick would accept since that enum is likely a string path under the hood). Update the package to version 0.0.4 and that should resolve the issue. |
Works like a charm! Thank you for your support and great work for the community! |
I added your project in my environment and I got error message. I is still installed and the intellisence support for VS Code mostly works.
https://github.com/drewwhis/pybricks-stubs/blob/master/pybricks/parameters.py#L7
My issue is that the code completion can't help me for the enums like Align, SoundFile, etc.
Any idea why and how to fix it?
If I define the enum value with
LEFT = ""
for example, it is now visible in the code hints. But I am afraid that I am doing something utterly wrong.
Update: Well, I tested and it worked:
and my code:
The text was updated successfully, but these errors were encountered: