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

Remove file map cache when re-analyzing files #5084

Merged
merged 4 commits into from Jan 22, 2021

Conversation

joehoyle
Copy link
Contributor

When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.

When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.

In doing this I had to write a few more tests to check my assumptions too, so adding those additional tests.
@muglug muglug merged commit ba43e6d into vimeo:master Jan 22, 2021
@muglug
Copy link
Collaborator

muglug commented Jan 22, 2021

Thanks!

danog pushed a commit to danog/psalm that referenced this pull request Jan 29, 2021
* Remove file map cache when re-analyzing files

When the project is re-analyzed under the single thread condition (not using a process pool), the filemaps are not cleared before re-analyzing files. This means that file maps only get appended to. If you delete the contents of a file via the LSP, the file map will still be populated with all the old values for example.

In doing this I had to write a few more tests to check my assumptions too, so adding those additional tests.

* Rename test

* Formatting

* Formatting again!
@muglug
Copy link
Collaborator

muglug commented Feb 28, 2021

Ok actually this needs to be slightly more nuanced – there's existing logic that updates the reference map when code moves around. That code also needs to account for removing methods.

@joehoyle
Copy link
Contributor Author

joehoyle commented Mar 1, 2021

@muglug ahh totally missed that behavior. Thanks for handling.

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.

None yet

2 participants