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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix closure to have storage bug in codeAction #7368

Merged
merged 1 commit into from Jan 11, 2022

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

Sorry for the other PR. I didn't realize you started work on v5 and set the default branch to 4.x

@tm1000
Copy link
Contributor Author

tm1000 commented Jan 10, 2022

test-with-real-projects is failing on the following cause:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - azjezz/psl is present at version 1.9.x-dev and cannot be modified by Composer
    - php-standard-library/psalm-plugin 2.0.0 conflicts with azjezz/psl <2.0.
    - Root composer.json requires php-standard-library/psalm-plugin ^2.0 -> satisfiable by php-standard-library/psalm-plugin[2.0.0].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require php-standard-library/psalm-plugin:*" to figure out if any version is installable, or "composer require php-standard-library/psalm-plugin:^2.1" if you know which you need.

Installation failed, reverting ./composer.json to its original content

So nothing to do with this commit.

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Jan 11, 2022
@orklah
Copy link
Collaborator

orklah commented Jan 11, 2022

Thanks!

@PythooonUser
Copy link

Thanks for fixing this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants