python-editor-v3
python-editor-v3 copied to clipboard
[Autocomplete] Completion after `display.show(Image.` shows global completions not image completions
Completion after display.show(Image. shows global completions not image completions.
You need some following code. The default sample code will suffice.
If the missing bracket is supplied then the completions are correct.
We auto-insert the closing bracket in normal entry, but a user editing a line that shows an image might delete the bracket and image name when swapping to a new image.
Not clear what we can do to improve this but we should investigate.
CC @microbit-giles
Raised again by Giles on https://github.com/microbit-foundation/python-editor-next/issues/600.
Interesting, TypeScript seems to cope in an analogous scenario:

It might be interesting to compare the error-recovered parse trees and/or autocomplete logic. Perhaps we could learn from Typescript and propose a Pyright change.