Open
Conversation
f90ee39 to
40946b7
Compare
- Per-document caching for the AST - Per-document caching for the node resolver - Stats for cache hits etc. - Adds option to disable highlighter - Log cache purges
40946b7 to
db3477b
Compare
mamazu
reviewed
Jun 28, 2025
| public function findIn(TextDocument $source): NamespacedClassReferences | ||
| { | ||
| $ast = $this->parser->parseSourceFile($source->__toString()); | ||
| $ast = $this->parser->parseSourceFile($source->__toString(), $source->uri()?->__toString()); |
Contributor
There was a problem hiding this comment.
Seeing that we use it like this most of the time, why not change it to take in the whole source.
Contributor
|
I have locally merged this branch into my experimental branch rather to catch if something can fail than to observe the impact on performance. @dantleech do you consider to add any benchmark here? |
dantleech
commented
Sep 20, 2025
|
|
||
| namespace Phpactor; | ||
|
|
||
| final class Stats |
Collaborator
Author
There was a problem hiding this comment.
opentelemetry will do this better, remove.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
highlightfunctionality to be toggledThe node resolver cache isn't so effective when ediring a document as the AST is reparsed on each edit and the cache invalidated - so at best it's the same as it was before in the current document however some operations analyse other documents - in which case it's very beneficial.
Caching the AST also ensures that the object_ids stay the same and the cache remains valid.#
The cache is purged for each document when it is either updated, closed or saved.
Danger:
Problems
The following should be


Action&DeleteActionbut it alternates between that and the parameter type:When it is correct goto-definition jumps to the parameter type when it should offer a choice between the intersection types.