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

LSP Slows down normal autocomplete #2430

Closed
aubreypwd opened this issue Mar 6, 2024 · 12 comments
Closed

LSP Slows down normal autocomplete #2430

aubreypwd opened this issue Mar 6, 2024 · 12 comments

Comments

@aubreypwd
Copy link

aubreypwd commented Mar 6, 2024

Describe the bug

When LSP is enabled, I can start to type something that would normally autocomplete:

CleanShot 2024-03-06 at 12 54 59

But with LSP enabled:

CleanShot 2024-03-06 at 12 55 49

Note: It will eventually pop up sometimes, after a long delay.

Expected behavior

Autocomplete still works as normal.

Logs

📹 https://a.supportally.com/v/2140Ye

:: [13:10:19.317] --> LSP-copilot getCompletions (17): <params with 88181 characters>
LSP-copilot: [getCompletions] Producing empty completions due to document version mismatch. Completions requested for document version 27 but document version was 17.
:: [13:10:19.378] --> LSP-copilot getCompletionsCycling (18): <params with 88181 characters>
LSP-copilot: [getCompletions] Producing empty completions due to document version mismatch. Completions requested for document version 27 but document version was 17.```

**Environment (please complete the following information):**

- OS: MacOS Sonoma
- Sublime Text version: https://a.supportally.com/i/2GCSTG
- LSP version: 1.29.0
- Language servers used: LSP-copilot

Note, it does not make a difference if I enable/disable copilot.

**Additional context**

I tried enabling and disabling my SublimeLinter* packages, that also did not help. Only LSP.
@rchl
Copy link
Member

rchl commented Mar 6, 2024

From your screencast it doesn't look like completions are not slowed down but rather completely suppressed.

Do you have any other servers running in php files? What is shown in the bottom-left corner?

Also check Sublime Text console for any errors.

@aubreypwd
Copy link
Author

I find:

Producing empty completions due to document version mismatch. Completions requested for document version 32 but document version was 27.

...to be interesting. I don't know what it means, but I do get empty completions.

@aubreypwd
Copy link
Author

CleanShot 2024-03-06 at 13 13 45@2x

After about 15 seconds or more I do eventually get a list of completions.

@rchl
Copy link
Member

rchl commented Mar 6, 2024

If LSP-copilot for some reason takes a long time to generate completions then it's an expected behavior. We can't show completions until server responds.

But you said that it happens with LSP-copilot disabled and I'm interested in that case rather.

If it doesn't happen with LSP-copilot disabled then there is nothing to fix here. Just make sure that LSP-copilot works faster. Since it relies on cloud, it's probably some issue related to your network.

Eventually you can try filing an issue against LSP-copilot.

@aubreypwd
Copy link
Author

It does happen with LSP-coplot disabled:

CleanShot.2024-03-06.at.18.21.41.mp4

Here I enable both LSP and LSP-copilot, then I disable LSP-copilot, then I disable LSP and it finally starts working again.

@rchl
Copy link
Member

rchl commented Mar 7, 2024

Try disabling copilot and then closing and reopening the file.

There might be a special case happening in disabling a package that we don't handle correctly.

@aubreypwd
Copy link
Author

I tried that... didn't seem to make a change. But I did find that some files were slow, while other files were faster:

📹 https://a.supportally.com/v/94QnzY

Maybe a file size or complexity issue?

Again all I have enabled is:

  • LSP
  • LSP-copilot

I also tested with LSP-copilot disabled (after a ST restart) and I still had the weird per-file speed issues.

@rchl
Copy link
Member

rchl commented Mar 7, 2024

When it's slow, what is shown in the bottom left corner of the ST window?

@aubreypwd
Copy link
Author

I assume you mean the status bar? Nothing of note:

CleanShot 2024-03-07 at 12 59 41@2x

CleanShot 2024-03-07 at 12 59 10

@rchl
Copy link
Member

rchl commented Mar 10, 2024

Pretty sure it won't happen in Safe Mode (you can install Package Control and LSP in it for testing) in which case it would likely be due to some other plugin. Maybe some weird interaction between LSP and another plugin...

You can try Safe Mode and if it doesn't reproduce there then in your original installation try disabling various other plugins.

@aubreypwd
Copy link
Author

I have decided to give up on Sublime Text after 10+ years lol! I am not going to re-test this again in safe mode, sorry. Feel free to close the issue if you still think this isn't an issue. Thanks for building this though!

@rchl
Copy link
Member

rchl commented Mar 15, 2024

We can't do much about an issue when there is no reproduction and you are the first in years to report it.

@rchl rchl closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
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

No branches or pull requests

2 participants