You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Following a recent exchange with @ianthehat I thought I would create a tracking issue for adding integration/support/??? into gopls for code generation. I suspect this issue will be more of a dumping ground for ideas/thoughts right now, but can be closed/repurposed etc as and when.
A rough list of thoughts:
strong preference (requirement?) for any solution to be dependency aware, that is if I change a file X that is a (transitive) dependency of other packages, and those other packages are part of the main module, then code generation should also happen in those packages. This also helps those code generators that rely on type checking
unclear when/how code generation should be triggered; on each file change is likely to be very expensive. Probably user initiated therefore?
should code generation be based solely on the contents of files on disk? Or, like gopls, represent the result of the editor's "overlay"?
how should generated files be identified? There is already a standard form comment for identifying generated files, but from a user's perspective (e.g. listing a directory contents) this is not as useful as (also) having a consistent file naming format, like a gen_ prefix. As far as tools are concerned, clearly it doesn't matter, but from a user's perspective, the file name approach is likely more useful
The text was updated successfully, but these errors were encountered: