python-editor-v3 icon indicating copy to clipboard operation
python-editor-v3 copied to clipboard

[Autocomplete] Completion after `display.show(Image.` shows global completions not image completions

Open microbit-matt-hillsdon opened this issue 4 years ago • 2 comments
trafficstars

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

microbit-matt-hillsdon avatar Sep 16 '21 14:09 microbit-matt-hillsdon

Raised again by Giles on https://github.com/microbit-foundation/python-editor-next/issues/600.

microbit-matt-hillsdon avatar Feb 17 '22 12:02 microbit-matt-hillsdon

Interesting, TypeScript seems to cope in an analogous scenario:

image

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.

microbit-matt-hillsdon avatar Oct 10 '22 13:10 microbit-matt-hillsdon