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

convert stub file function declarations into QScintilla autocompletion schema #2301

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Jeffrey04
Copy link
Contributor

@Jeffrey04 Jeffrey04 commented Jul 17, 2022

refs: #2291

Usage:

python utils/completion_convert.py <stub_file dir> <output_filepath>

@Jeffrey04
Copy link
Contributor Author

I suppose I should have used ast to parse the stub file

@Jeffrey04
Copy link
Contributor Author

am aware of the code only work for one file for now, working on traversing the directory next
(is there a way to not trigger a build until this PR is ready?)

@Jeffrey04
Copy link
Contributor Author

for https://github.com/oivron/microbit-stubs/blob/master/microbit/lib/audio.py

script current returns a file

MICROBIT_APIS = [_("play(source, wait, pins) Play the source to completion where 'source' is an iterable, each element of which must be an AudioFrame instance."), _("is_playing() Return True if audio is playing, otherwise return False."), _("stop() Stops all audio playback.")]

@Jeffrey04 Jeffrey04 marked this pull request as ready for review July 17, 2022 13:25
@Jeffrey04
Copy link
Contributor Author

code should now generate the autocompletion guide, it is hackish, and most certainly require a lot of polishing, please let me know if I missed out anything that require fixing

@Jeffrey04 Jeffrey04 changed the title 2291 proof-of-concept to turn toy example into stub 2291 convert stub file function declarations into QScintilla autocompletion schema Jul 17, 2022
@Jeffrey04 Jeffrey04 changed the title 2291 convert stub file function declarations into QScintilla autocompletion schema convert stub file function declarations into QScintilla autocompletion schema Jul 17, 2022
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.

1 participant