editor
editor copied to clipboard
Import statement autocompletions for gametest
Summary Autocompletions are unavailable when trying to import anything from the gametest modules
To Reproduce Steps to reproduce the behavior:
- Create a new bridge project with gametest enabled
- Click on the
main.js
file - Type
world
or any of the other objects from gametest - Control+Space
Observed behavior
world
doesn't show in the autocompletions
Expected behavior
The autocompletions should show world
as a suggestion and using tab should auto-import it
Screenshots / File Attachments
Platform
Windows 11 - Edge v2.3.1
I've looked into this and Monaco apparently doesn't support this yet. I am not sure whether/when we will find the time to implement this ourselves so here's some information in case someone else wants to pick this up:
Generally there are two things we need to do:
- Finding all exported symbols from a module and then proposing them with a completion item provider
- Upon selecting a completion item, parse imports within the file and merge the new imported symbol into an existing import or add a new import statement
You can find a reference implementation for an older monaco version here: https://github.com/stackblitz/monaco-auto-import/tree/master/src/auto-complete