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: stop caching ASTs for dependencies #38278

Open
stamblerre opened this issue Apr 6, 2020 · 0 comments
Open

x/tools/gopls: stop caching ASTs for dependencies #38278

stamblerre opened this issue Apr 6, 2020 · 0 comments

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Apr 6, 2020

We really only use dependency ASTs for finding definitions and documentation, and we can avoid extra work and AST traversal by precomputing what we need. In most cases, dependencies are only type-checked once. I propose this alternative:

  • We type-check all packages in "full" mode (allowing us to use the type information for analyses).
  • Instead of having different parse modes for files, we have different modes for PackageHandles, one for workspace packages (PackageHandle) and one for dependencies (ExportedPackageHandle). PackageHandle remains the same as it is now, while ExportedPackageHandle does not contain references to the package's ParseGoHandles. Rather, it contains a pre-computed table of information that can be used for various features. My guess is that it will be a table of token.Pos -> documentation, but I'm sure I missed things.

/cc @heschik @ianthehat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.