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

OtherMethodQueryBuilderParser: prevent broken type infering with partial analysis #504

Open
wants to merge 2 commits into
base: 1.3.x
Choose a base branch
from

Conversation

janedbal
Copy link
Contributor

@janedbal janedbal commented Dec 6, 2023

Currently, when a file is not among "analysed files" (which is any file not listed in partial analysis), every method body is stripped by CleaningParser. Due to that OtherMethodQueryBuilderParser cannot determine what is happening to the QueryBuilder there and results in mixed. This results in nasty:

  • partial analysis: mixed returned
  • full analysis: list<Entity> returned

Due to the nature of this feature (affecting only methods returning QueryBuilder) I think it is safe to remove the CleaningParser even with this improvement.

extension.neon Show resolved Hide resolved
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked into this and thought about it. The problem is that a lot of files will now be cached twice in memory because here you're using a new instance of the cached parser.

Ideally you'd reuse the existing cache for already parsed files by the rich parser and just cache differently parsed files that are otherwise parsed by the simple parser.

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

Successfully merging this pull request may close these issues.

2 participants