Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[nvim] lsp workspace symbols incomplete on large projects#2884

TRPB started this conversation inGeneral
Discussion options

This is further to:#2844

I'm not sure where the problem is but I've tried using both snacks.nvim and telescope and described the issue here thinking it was a snacks.nvim issue:folke/snacks.nvim#1060

The problem is, on projects with > 200 files (or higher if the limit is increased) lsp workspace symbols is incomplete.

This happens in both Telescope and Snacks. I'd imagine how it should work is the picker sends the request to the LSP and the LSP returns the results. It seems like something is going wrong during that process.

If It type into either snacks or telescope:

SomeNamespace

I get a tiny subset of results. There are around 600 classes in the project with that namespace yet I get fewer than 10 results.

According to the author of snacks.nvim, that list is coming directly from the LSP. Is there a way (or an alternative picker) that works with a large number of classes in the project?

How can I debug this further? Either the picker or phpactor is not working as intended

If I increase the limit as described in#2844 it increases the results.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

there is a configurable limit as it's quite an expensive operation:https://phpactor.readthedocs.io/en/master/reference/configuration.html#languageserverindexerextension it's set as default to 250

You must be logged in to vote
1 reply
@TRPB
Comment options

Thanks, I've increased this limit but I'm not sure how it's supposed to work then.

I assume it's an issue between nvim, the picker and the LSP.

If I runphpactor index:search --fqn-begins=SomeNamespace it works as expected and very quickly gives me the complete set of results.

However,Snacks.picker() and telescope both cause phpactor to go oom when runninglsp_workspace_symbols. Perhaps I need to create a custom picker implementation that callsphpactor index:search via CLI, though this feels like it should be possible with the existing implementation

edit: Seems that I had to setcore.min_memory_limit when loading the nvim plugin rather than.phpactor.json for using the plugin and it builds the index independently of the CLI.

Though now I'm getting

[ERROR][2025-05-06 14:37:30] ...p/_transport.lua:36     "rpc"   "phpactor"      "stderr"        "Starting language server, use -vvv for verbose output\n"[ERROR][2025-05-06 14:37:59] ...p/_transport.lua:36     "rpc"   "phpactor"      "stderr"        "\n"[ERROR][2025-05-06 14:37:59] ...p/_transport.lua:36     "rpc"   "phpactor"      "stderr"        'In LspMessageSerializer.php line 23:\n                                                                               \n  Could not encode JSON: "Malformed UTF-8 characters, possibly incorrectly en  \n  coded"                                                                       \n                                                                               \n\nlanguage-server [--address ADDRESS] [--no-loop]\n\n

I'll try to tun on-vvv mode from within the plugin

edit 2:

I don't think it works the way I expect it to work.

If the lsp workspace symbol limit is 250 and I open snacks.picker I expected that:

  • it would show me 250 results (likely meaningless as there is no search term)
  • as I type it queries the LSP and fetches max 250 relevant results

But it seems that what actually happens is that those 250 results are the only ones indexed. I think with a higher limit it's crashing the lsp because it's trying to return all ~60k files at once.

A 250 limit would be fine if the second step above worked and I could search the entire workspace but only return 250 relevant files

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@TRPB@dantleech
Converted from issue

This discussion was converted from issue #2883 on May 06, 2025 12:40.


[8]ページ先頭

©2009-2025 Movatter.jp