zed icon indicating copy to clipboard operation
zed copied to clipboard

Zed keeps getting stuck "resolving code actions"

Open dela-dels opened this issue 1 year ago • 16 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

While using Zed, i've noticed for some time now that the editor gets stuck "Resolving code actions". This i've noticed prevents intellisense from working properly as well. I'm mostly writing PHP code.

Environment

Zed: v0.159.10 (Zed) OS: macOS 15.1.0 Memory: 8 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-11-05 at 6 02 22 PM

If applicable, attach your Zed.log file to this issue.

Zed.log

2024-11-05T17:58:37.580406Z [ERROR] sending into a closed channel 2024-11-05T17:58:37.581326Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:37.663478Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:37.663716Z [ERROR] server shut down 2024-11-05T17:58:37.747575Z [ERROR] sending into a closed channel 2024-11-05T17:58:37.748449Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:37.797017Z [ERROR] sending into a closed channel 2024-11-05T17:58:37.797915Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:37.881485Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:37.881721Z [ERROR] server shut down 2024-11-05T17:58:37.984785Z [ERROR] sending into a closed channel 2024-11-05T17:58:37.985912Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.066931Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.068146Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.116598Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.118154Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.19809Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.198326Z [ERROR] server shut down 2024-11-05T17:58:38.299521Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.300759Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.367097Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.368297Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.450416Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.450742Z [ERROR] server shut down 2024-11-05T17:58:38.481623Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.482769Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.565248Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.566365Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.647582Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.647819Z [ERROR] server shut down 2024-11-05T17:58:38.797787Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.798838Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.870028Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.879344Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.950015Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:38.950385Z [ERROR] server shut down 2024-11-05T17:58:38.986608Z [ERROR] sending into a closed channel 2024-11-05T17:58:38.997974Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.06641Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.066773Z [ERROR] server shut down 2024-11-05T17:58:39.084309Z [ERROR] sending into a closed channel 2024-11-05T17:58:39.085593Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.162385Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.162609Z [ERROR] server shut down 2024-11-05T17:58:39.265984Z [ERROR] sending into a closed channel 2024-11-05T17:58:39.267212Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.347765Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.348003Z [ERROR] server shut down 2024-11-05T17:58:39.533326Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.533646Z [ERROR] server shut down 2024-11-05T17:58:39.56567Z [ERROR] sending into a closed channel 2024-11-05T17:58:39.566914Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.646111Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.646346Z [ERROR] server shut down 2024-11-05T17:58:39.686944Z [ERROR] sending into a closed channel 2024-11-05T17:58:39.696345Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.781507Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.781825Z [ERROR] server shut down 2024-11-05T17:58:39.846782Z [ERROR] sending into a closed channel 2024-11-05T17:58:39.847844Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.931915Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:39.932154Z [ERROR] server shut down 2024-11-05T17:58:40.080451Z [ERROR] sending into a closed channel 2024-11-05T17:58:40.081612Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.163853Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.164103Z [ERROR] server shut down 2024-11-05T17:58:40.252566Z [ERROR] sending into a closed channel 2024-11-05T17:58:40.262038Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.33145Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.331686Z [ERROR] server shut down 2024-11-05T17:58:40.532533Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.532812Z [ERROR] server shut down 2024-11-05T17:58:40.963096Z [ERROR] sending into a closed channel 2024-11-05T17:58:40.966666Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:40.967681Z [ERROR] server shut down 2024-11-05T17:58:40.967875Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:41.045014Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:41.045337Z [ERROR] server shut down 2024-11-05T17:58:41.195018Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:41.195276Z [ERROR] server shut down 2024-11-05T17:58:41.378409Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:41.378621Z [ERROR] server shut down 2024-11-05T17:58:42.598382Z [ERROR] sending into a closed channel 2024-11-05T17:58:42.599667Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:42.599894Z [ERROR] server shut down 2024-11-05T17:58:42.681296Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:42.681533Z [ERROR] server shut down 2024-11-05T17:58:42.862609Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:42.862817Z [ERROR] server shut down 2024-11-05T17:58:43.116293Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:43.382311Z [ERROR] sending into a closed channel 2024-11-05T17:58:43.415226Z [ERROR] sending into a closed channel 2024-11-05T17:58:43.647579Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:43.647795Z [ERROR] server shut down 2024-11-05T17:58:43.966248Z [ERROR] sending into a closed channel 2024-11-05T17:58:48.012357Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.012609Z [ERROR] server shut down 2024-11-05T17:58:48.147666Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.147909Z [ERROR] server shut down 2024-11-05T17:58:48.332729Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.333067Z [ERROR] server shut down 2024-11-05T17:58:48.631514Z [ERROR] sending into a closed channel 2024-11-05T17:58:48.632978Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.713877Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.714118Z [ERROR] server shut down 2024-11-05T17:58:48.765764Z [ERROR] sending into a closed channel 2024-11-05T17:58:48.766936Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.847555Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:48.847806Z [ERROR] server shut down 2024-11-05T17:58:48.968962Z [ERROR] sending into a closed channel 2024-11-05T17:58:48.978584Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.036328Z [ERROR] sending into a closed channel 2024-11-05T17:58:49.04642Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.132869Z [ERROR] sending into a closed channel 2024-11-05T17:58:49.13445Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.214025Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.214258Z [ERROR] server shut down 2024-11-05T17:58:49.253632Z [ERROR] sending into a closed channel 2024-11-05T17:58:49.263197Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.348874Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.349231Z [ERROR] server shut down 2024-11-05T17:58:49.532105Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T17:58:49.532384Z [ERROR] server shut down 2024-11-05T18:01:28.548736Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T18:01:28.549918Z [ERROR] server shut down 2024-11-05T18:01:28.648162Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T18:01:28.648362Z [ERROR] server shut down 2024-11-05T18:01:28.831614Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down 2024-11-05T18:01:28.831997Z [ERROR] server shut down

<!-- Click above this line and paste or drag-and-drop your log--></details>

dela-dels avatar Nov 05 '24 18:11 dela-dels

This is due to the php language server (it is a good idea to specify your language in the issue too) failing.

2024-11-05T17:58:38.300759Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down

Do you have the phpactor logs somewhere? Otherwise it's not very clear how to help you.

SomeoneToIgnore avatar Nov 05 '24 20:11 SomeoneToIgnore

Alternatively, please share the project we can repro the issue on.

SomeoneToIgnore avatar Nov 06 '24 07:11 SomeoneToIgnore

This is due to the php language server (it is a good idea to specify your language in the issue too) failing.

2024-11-05T17:58:38.300759Z [WARN] Generic lsp request to phpactor/phpactor failed: server shut down

Do you have the phpactor logs somewhere? Otherwise it's not very clear how to help you.

@SomeoneToIgnore unfortunately I've not been successful getting the logs of phpfactor

dela-dels avatar Nov 06 '24 08:11 dela-dels

Alternatively, please share the project we can repro the issue on.

https://github.com/dela-dels/zed-phpfactor-issue

sample repo. unfortunately i can't share the actual repo

dela-dels avatar Nov 06 '24 13:11 dela-dels

Thank you, I have been testing this but unable to see anything odd with the LSP, it definitely does not crash for me:

https://github.com/user-attachments/assets/99da2b76-ae23-4530-a279-1a7245947dc4

The problem is — I do not see any code actions at all there, so presumably it's due to some extra phpfactor configuration? I have not written any php code ever and did not configure the LSP server anyhow specifically.

SomeoneToIgnore avatar Nov 06 '24 19:11 SomeoneToIgnore

Thank you, I have been testing this but unable to see anything odd with the LSP, it definitely does not crash for me:

phpfactor.mov The problem is — I do not see any code actions at all there, so presumably it's due to some extra phpfactor configuration? I have not written any php code ever and did not configure the LSP server anyhow specifically.

So I noticed as well that with the repo I shared, I do not see those issues. My assumption is that, I face the said issue in the current codebase probably because it's a very huge codebase

dela-dels avatar Nov 07 '24 11:11 dela-dels

@SomeoneToIgnore managed to get a recording of the issue while working on a codebase today.

https://github.com/user-attachments/assets/a0f6cb2f-0c94-415c-b741-0a4101bcc262

dela-dels avatar Nov 11 '24 13:11 dela-dels

Yes, I'm afraid it's something relatively internal to phpfactor, as Zed does not even have this Resolving code actions message, it comes out of the LSP server.

So, we most probably won't know what happens just by looking at Zed, without the server logs or a way to repro this.

SomeoneToIgnore avatar Nov 11 '24 14:11 SomeoneToIgnore

@SomeoneToIgnore Oh right, i get you.

dela-dels avatar Nov 11 '24 15:11 dela-dels

@SomeoneToIgnore Not sure if I should file a new issue instead, but here's my log file, with a logging level of "info" since "debug" went past megabytes in the blink of an eye:

.phpactor.log

The LSP stopped working sometime around these lines:

[2025-01-24 15:40:07] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\RequestMessage" ({"jsonrpc":"2.0","id":79,"method":"textDocument\/definition","params":{"textDocument":{"uri":"file:\/\/\/home\/aliu\/Documents\/mediawiki\/includes\/skins\/Skin.php"},"position":{"line":1665,"character":10}}}): Exception [Phpactor\TextDocument\Exception\TextDocumentNotFound] Text document "file:///home/aliu/.local/share/zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar/vendor/jetbrains/phpstorm-stubs/pcre/pcre.php" not found {"channel":"LSP"} []
[2025-01-24 15:40:19] phpactor.WARNING: The process was killed {"channel":"LSP"} []
[2025-01-24 15:40:19] phpactor.WARNING: Killed process "91437" ('/usr/bin/php' '/home/aliu/.local/share/zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar' 'language-server:diagnostics' '--uri=file:///home/aliu/Documents/mediawiki/includes/skins/Skin.php' '--config-extra={"worse_reflection.enable_context_location": false}') because it lived longer than 5s {"channel":"LSP"} []

Here's another set of logs:

.phpactor.log

2025-01-24 15:51:52] phpactor.ERROR: Error when handling "Phpactor\LanguageServer\Core\Rpc\RequestMessage" ({"jsonrpc":"2.0","id":129,"method":"textDocument\/definition","params":{"textDocument":{"uri":"file:\/\/\/home\/aliu\/Documents\/mediawiki\/includes\/skins\/Skin.php"},"position":{"line":1716,"character":15}}}): Exception [Phpactor\TextDocument\Exception\TextDocumentNotFound] Text document "file:///home/aliu/.local/share/zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar/vendor/jetbrains/phpstorm-stubs/standard/standard_1.php" not found {"channel":"LSP"} []
[2025-01-24 15:51:53] phpactor.WARNING: The process was killed {"channel":"LSP"} []
[2025-01-24 15:51:53] phpactor.WARNING: Killed process "101065" ('/usr/bin/php' '/home/aliu/.local/share/zed/extensions/work/php/phpactor-2024.11.28.1/phpactor.phar' 'language-server:diagnostics' '--uri=file:///home/aliu/Documents/mediawiki/includes/skins/Skin.php' '--config-extra={"worse_reflection.enable_context_location": false}') because it lived longer than 5s {"channel":"LSP"} []

phpactor is then killed repeatedly.

aaronliu0130 avatar Jan 24 '25 15:01 aaronliu0130

Great, thank you for this. Not sure it's more clear for me, but at least it's something: the extension seems to lack (?) certain files that phpfactor wants to have? Those seem to be merely stubs though, so in the worst case, we can add them; but the path with jetbrains is somewhat confusing, as if the extension is doing something totally wrong on its side...

Last time, I did not manage to reproduce this error on the public repo given, so this is also not very clear — if you could provide some public example that reliably fails for you and more details if extra set-up is needed (does phpfactor want some config(s) and subscription(s)?) it would be splendid.

SomeoneToIgnore avatar Jan 24 '25 20:01 SomeoneToIgnore

I was coding on the MediaWiki-core codebase, specifically includes/skin/skin.php. The extension failed with the default configuration after a seemingly random amount (but less than 10 minutes) time of coding things. you could maybe try coding fizz buzz or something in the aforementioned file to reproduce it? idk

aaronliu0130 avatar Jan 25 '25 01:01 aaronliu0130

Any updates?

mehmetozguldev avatar Feb 25 '25 10:02 mehmetozguldev

if this happens to you then just add: "languages": { "PHP": { "language_servers": ["intelephense", "!phpactor", "..."] } } to your settings.

dtannen avatar Apr 01 '25 11:04 dtannen

That would disable virtually all PHP linting and the auto-complete and the hover-to-see-symbol-details thing, which is exactly like what happens with "resolving code actions" except you don't even get the first ~14 mins of it working.

aaronliu0130 avatar Apr 01 '25 18:04 aaronliu0130

probably because it's a very huge codebase

Phpactor has performance issues with large, complex, files. You might be able to improve performance by disabling diagnoatics on update.

The code actions were also developed in neovim in the context where they are explicitly requested. I think in VS code and Zed (?) they are requested frequently - which can cause issues when the analysis takes a number of seconds.

dantleech avatar May 01 '25 06:05 dantleech

Yes, I have this same problem using Laravel with phpactor. I would save a file 6 times and I'd end up with 6 "resolving code actions" for multiple minutes. I had to switch back to intelephense to get that to stop.

I opened the same project in neovim and saved with phpactor and everything was instant - so it sounds like what @dantleech is saying is correct.

bdlowery avatar Jul 18 '25 19:07 bdlowery