Skip to content
This repository was archived by the owner on Aug 31, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant