LSP runs Slowly

Looking for some support with this LSP for sway.

The LSP is running extremely slowly. Any tips on optimization for macOS?

1 Like

Hi @csnormie can I ask you to provide some more details.

First let’s confirm you are running the most recent version:

$ fuelup toolchain install latest
$ fuelup update
$ forc-lsp --version
forc-lsp 0.49.1

Second make sure that your PATH resolves to the fuelup forc-lsp.

$ which forc-lsp
$HOME/.fuelup/bin/forc-lsp

If it’s still running slowly, can you enable verbose logging of the LSP server and send us the logs. Once enabled you can find this in the output window under sway language server. In VSCode, this is under the setting:

"sway-lsp.trace.server": "verbose"

Thanks.

2 Likes

Hi, @Josh. I worked with @csnormie and was experiencing the same issue.

It is partially resolved.

Resolution Details

The forc-lsp was not playing well with the LSP in the GitHub copilot vim plugin. GitHub - github/copilot.vim: Neovim plugin for GitHub Copilot.

After disabling copilot, responses after simple changes are received in less than 5s, whereas while enabled, they took more than 10s. It’s still significantly slower than more mature LSPs, but now it is at least usable.

I’m happy to add logs from a verbose log if this is still much slower than expected.

Configuration:

forc-lsp beta-4 0.46.1
M1 Macbook pro (MacOS 14.1)
Neovim

Thanks for the reply with the details.

There has been a considerable number of optimisation on the language server since 0.46.1 so your report doesn’t surprise me. I would be interested to hear if you are still experiencing such slow response times with the latest version of the language server.

1 Like

Yes it’s also painfully slow for me as well, constantly crashing

I know it doesn’t scale well with bigger projects because when I open small projects it runs fine

Is there a command to restart the LSP?

When i close vscode it works fine but as soon as i start editing code it’s a mess

I opened an issue, there’s a video worth watching in my last comment to see the behavior