fix: added support for autocompletion on the low ui approach for pycharm#313
Merged
ramedina86 merged 1 commit intowriter:devfrom Mar 18, 2024
Conversation
0ab33d4 to
ab70857
Compare
mmikita95
reviewed
Mar 18, 2024
| raise UIError("A component can only be created inside a container") | ||
|
|
||
| @property | ||
| def component_tree(self) -> ComponentTree: |
Contributor
There was a problem hiding this comment.
I see that this property is not used, and other methods still access current_component_tree() directly. I believe we could replace all calls to it with this property, or is there something I am missing?
Contributor
Author
There was a problem hiding this comment.
I keep it for debug purpose on the IDE. It help people that read the code to understand how to access component tree.
Yes we can
Contributor
Author
There was a problem hiding this comment.
Finally we can't because the method are static and component tree is a property. It's not accessible
97e3a5a to
4e1a6fd
Compare
4e1a6fd to
6baa79f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pycharm does not currently support autocompletion on TypedDict passed as an argument to a method. This problem does not seem to be really addressed in their roadmap.
https://youtrack.jetbrains.com/issue/PY-54151/TypedDict-completion-at-callee-does-not-work-for-methods
On the other hand, Pycharm supports autocompletion on static methods of a class.
I propose a draft to manage the component tree as a context variable. This pattern offer 2 advantages :
FabienArcellier#40
I test this implementation on event handler and async event handler