-
Notifications
You must be signed in to change notification settings - Fork 259
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
Cache file parsing in the LSP server #2327
Comments
Adding to the implementation notes (from an issue I ran into with the REPL):
|
Last time modified timestamps are not very reliable. I would consider hashing the contents of the file instead, because:
Until we see file IO become a significant part of the pipeline, we should consider just re-reading the source files.
Will that cause us to lose the cache for a module if the corresponding |
What I don't like about that is that it breaks the scalability of the parse caching. Consider a project with a huge amount of files, then you'd still need to read all of them from disk for every edit. Note that if a user edits a file through the IDE, the LSP server will get a change notification and we'll always remove that entry from the parse cache, so the time resolution might not be an issue in practice.
Yes it would.
I think it might be nicer to use the number of edits since the cache entry was last accessed as a measure of staleness, rather than time. This should also be fairly easy to add when we have a mechanism for clearing the cache after 1 edit. |
For BuiltIns we need a way to create a correct BuiltIns given a set of file parse cache entries. It could be a module traversal that fills BuiltIns, or having the parser return a list of calls that configure built-ins, that we cache. We also need to stop using Include tokens since they influence how a file is parsed in a way that doesn't depend on the contents of the file. |
Implemented by #4085 |
Change
Not in scope
Prerequisites
None
Enables
Implementation hints
Subtasks:
Parser.Parse
only depend on the contents and the origin of the file:IncludeToken
IsToBeVerified
andIsToBeCompiled
fromModuleDefinition
ModuleDecl
argument fromParser.Parse
and use additional return values instead, such asDefaultModuleDefinition
.ErrorReporter
argument fromParser.Parse
and use additional return values instead, such as aBatchErrorReporter
.BuiltIns
argument fromParser.Parse
and use additional return values instead.The text was updated successfully, but these errors were encountered: