Normally I would just fix this bug, but given our proximity to the v0.12.0 release I'm filing it for later:
When state changes in gopls, we re-evaluate file watchers. Currently, this is done synchronously to the state change processing, via Server.didModifyFiles->updateWatchedDirectories.
Problems with this:
- AFAIK there is no need to block change processing on updating watched directories. File watching is always going to be asynchronous, so I don't think we avoid any races by blocking while processing didChange notifications
- we should generally avoid blocking on server->client calls during notification processing, as it can lead to distributed deadlocks in certain clients
- we should
awaitLoaded before re-evaluating file watches, as go list might surface new directories to watch after e.g. a go.mod change. We can't awaitLoaded during change processing.
Normally I would just fix this bug, but given our proximity to the v0.12.0 release I'm filing it for later:
When state changes in gopls, we re-evaluate file watchers. Currently, this is done synchronously to the state change processing, via
Server.didModifyFiles->updateWatchedDirectories.Problems with this:
awaitLoadedbefore re-evaluating file watches, asgo listmight surface new directories to watch after e.g. a go.mod change. We can'tawaitLoadedduring change processing.