Open jacob314 opened 5 years ago
We could use the service protocol as an intermediary layer here. The service protocol has a way for clients to register services (_registerService
), and other clients can then invoke them. flutter_tools currently exposes hot reload as a service this way - a web based client can invoke hot reload in a running flutter app by calling this service.
So an IDE could register a 'getAnalyzer' service, or flutter_tools could as well. The analysis server is not designed to have more than one client, so we may want either a separate analysis server process, or to expose very specific functionality over the service protocol (doc comments, code completion, ...).
using the service protocol as an intermediary layer makes sense.
There are cases such as displaying doc comments, autocompleting expressions, and getting types where having access to the analyzer service is needed.
TBD: the most robust way to wire up the analyzer to the web app. IDEs such as VSCode already have an analyzer service running but command line users do not.