We would like our custom LightVirtualFile instances to offer auto complete that matches the open project (or even a particular module). We have observed this happens automatically in WebStorm but for IntelliJ we only get basic language completion.
We have also observed that scratch files are able to do this (and Kotlin scratch files even have a module selector) but after studying the code it's still not clear to us how this works. Also, we noticed this is not the case with PyCharm (as reported here: https://youtrack.jetbrains.com/issue/PY-24670?_ga=2.10049011.771698166.1588872331-888628167.1586353309)
Is there a language-agnostic way to make this work? Any pointers would be of great help!