go101 / golds

An experimental Go local docs server/generator and code reader implemented with some fresh ideas.
https://go101.org/apps-and-libs/golds.html
MIT License
610 stars 28 forks source link

Feature request: watch mode #22

Open mugli opened 3 years ago

mugli commented 3 years ago

golds right now does not pick up changes made in the packages it has already parsed, even if we refresh the browser. Please consider adding a watch mode to reflect the changes on the filesystem. I think it would be very helpful for package authors.

zigo101 commented 3 years ago

Yes, Golds is mainly used to analyze a snapshot of a code base. Golds now maintains a lot of analyzed information in memory. A simple code change might invalidate much of the information. Rebuilding the information needs some time so might cause some obvious lags.

To avoid the lags, some analyzing work needs to be lazy executed as needed. The code needs to be refactored like go-lsp. I have not a clear idea on how to make the refactoring now, but I think it might be possible. I will add this to the todo list now.

On the other hand, the refactoring needs much effort and time to finish. Maybe it would be better to develop another Go app to support the watch feature.

I really don't know which route is better now.