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

Fix crash in code action #7367

Closed
wants to merge 121 commits into from
Closed

Conversation

tm1000
Copy link
Contributor

@tm1000 tm1000 commented Jan 10, 2022

This PR fixes the following bug introduced into codeAction as a result of the underlying cache being empty when creating new files while using the language server

[Error - 11:05:08 PM] Request textDocument/codeAction failed.
  Message: UnexpectedValueException: Expecting /project/myTestFile.php:27:531:-:closure to have storage in /project/myTestFile.php in /project/vendor/vimeo/psalm/src/Psalm/Codebase.php:650

It's actually almost the same as #7247 except I didn't add the try/catch to my own code! 🤕

Additionally this adds a quick speedup to codeAction by adding a cache whenemitIssues is called so that we don't have to run the IssueBuffer everytime codeAction is called (which in vscode is a lot because every time the mouse or cursor moves a codeAction is sent). Instead we just ask the LanguageServer to give us the previous issues returned from IssueBuffer through the use of the method getCurrentIssues

dvz and others added 30 commits December 14, 2021 20:00
weirdan and others added 26 commits January 5, 2022 23:32
replace `array<never, never>` as a way to detect empty arrays by a dedicated method
Support PHPStan notation for empty-arrays
Rename was_static property to is_static to be more accurate
Add explicit `resolveSymlinks` option for project directories
@tm1000
Copy link
Contributor Author

tm1000 commented Jan 10, 2022

Ugh. This got really messed up ignore!

@tm1000 tm1000 closed this Jan 10, 2022
@weirdan
Copy link
Collaborator

weirdan commented Jan 11, 2022

Please branch off the 4.x branch.

@tm1000
Copy link
Contributor Author

tm1000 commented Jan 11, 2022

@weirdan did that in my newer pr

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

5 participants