There is already an experimental implementation of this, but it has proved to be rather slow.
It will be required to implement a language server for this, which may (or not) speed up the response.
Due to the slowness of the compiler, it will be ideal if the compiler could have a global instance and a cancellation.