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/internal/refactor/inline: readiness checklist #62650

Closed
9 tasks done
adonovan opened this issue Sep 14, 2023 · 3 comments
Closed
9 tasks done

x/tools/internal/refactor/inline: readiness checklist #62650

adonovan opened this issue Sep 14, 2023 · 3 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. Refactoring Issues related to refactoring tools Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Sep 14, 2023

This issue records the list of outstanding items before we call the inliner ready to announce in gopls:

@findleyr

@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Sep 14, 2023
@gopherbot gopherbot added this to the Unreleased milestone Sep 14, 2023
@adonovan adonovan self-assigned this Sep 14, 2023
@adonovan adonovan added gopls Issues related to the Go language server, gopls. Refactoring Issues related to refactoring tools labels Sep 14, 2023
@adonovan
Copy link
Member Author

adonovan commented Sep 15, 2023

Status update: I ran the inliner on every function call in the x/tools repo. The only remaining known bugs are #62664 and #62667.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.15.0 Sep 20, 2023
@adonovan
Copy link
Member Author

adonovan commented Sep 27, 2023

Here's a list of starter projects for anyone who wants to get their hands dirty in the inliner logic:

  • paren elimination x/tools/internal/refactor/inline: don't insert parens/braces unnecessarily #63259
  • support inlining of generic functions or methods
  • improve precision of check of whether arg elimination removes last ref to a caller var...
  • ...and instead of preventing elimination, blank out the var decl.
  • avoid imports.Process by reimplementing just the algorithm we need.
  • choose better local names for renaming imports
  • avoid unnecessarily renaming imports (may need additional inputs?)
  • implement "void tail call" strategy (i.e. f() statement before return stmt)
  • implement parameterless call to { stmt; return expr } from one of these contexts:
        //    x, y     = f()
        //    x, y    := f()
        //    var x, y = f()

@adonovan
Copy link
Member Author

adonovan commented Oct 3, 2023

All done! Let's not forget the handy to-do list above though. Moved to #63352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Refactoring Issues related to refactoring tools Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants