Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: add support for code generation #31817

Open
myitcv opened this issue May 3, 2019 · 1 comment

Comments

@myitcv
Copy link
Member

@myitcv myitcv commented May 3, 2019

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
  • code generators should be encouraged to be artefact cache-based
  • 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
  • ...
@gopherbot gopherbot added this to the Unreleased milestone May 3, 2019
@myitcv

This comment has been minimized.

Copy link
Member Author

@myitcv myitcv commented May 3, 2019

@stamblerre stamblerre changed the title x/tools/cmd/gopls: code generation tracking issue x/tools/cmd/gopls: add support for code generation Jun 5, 2019
@stamblerre stamblerre changed the title x/tools/cmd/gopls: add support for code generation x/tools/gopls: add support for code generation Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.