AdaCore / ada_language_server

Server implementing the Microsoft Language Protocol for Ada and SPARK
GNU General Public License v3.0
236 stars 55 forks source link

[Bug]: Noticeable input-delay when entering whitespace #1200

Closed 0xfadead closed 3 months ago

0xfadead commented 3 months ago

Environment

Bug Summary and Reproducer

Bug Summary: When entering a whitespace before other tokens the immediate next one disappears for a split second before the next tokens move. Even when having no next tokens it still lags. I recorded a video of this: https://asciinema.org/a/BJOVnrs5bNBjiR7TR8lgRXak5

Steps to reproduce:

  1. Install the ada-language-server extension from mason
  2. Open an Ada Project
  3. Enter a space before any other token(s)

Expected behavior: Slightly less noticeable lag when entering whitespace.

Configuration and Logs

[Even with `ALS.IN=yes` and `ALS.OUT=yes` there is no output -- there's only a logfile with no content]

Other VS Code Extensions

Additional context

AnthonyLeonardoGracio commented 3 months ago

Hello @0xfadead,

Really strange, I can't reproduce from VS Code, using the exact same version of the Ada Language Server. So I suspect a bad interacting between the Neovim client and the server.

The first step in order to debug this would be to have proper logs: I suggest you to create the traces config fiels as described here.

Once we have proper logs it would be easier to debug this, so let's first solve this issue.

Regards,

0xfadead commented 3 months ago

Hi @AnthonyLeonardoGracio

The first step in order to debug this would be to have proper logs: I suggest you to create the traces config fiels as described here.

I have this in my ~/.als/ada_ls_traces.cfg:

ALS.IN=yes
ALS.OUT=yes
ALS.MAIN=yes
ALS.LAL_PP_ON_FORMATTING=yes

But I get no output even though a file called als.2024-07-22<timestamp>.log is created.

Are there any extra configuration options I need to enable to get any sort of output?

Thanks in advance

AnthonyLeonardoGracio commented 3 months ago

Hi @AnthonyLeonardoGracio

The first step in order to debug this would be to have proper logs: I suggest you to create the traces config fiels as described here.

I have this in my ~/.als/ada_ls_traces.cfg:

ALS.IN=yes
ALS.OUT=yes
ALS.MAIN=yes
ALS.LAL_PP_ON_FORMATTING=yes

But I get no output even though a file called als.2024-07-22<timestamp>.log is created.

Are there any extra configuration options I need to enable to get any sort of output?

Thanks in advance

Hello @0xfadead,

Indeed, my bad, we have revamped the way traces files work in the development version but it has not been released in the Marketplace yet. With your version you just need to rename ~/.als/ada_ls_traces.cfg into ~/.als/traces.cfg, then you will have non-empty log files.

I'll adjust the documentation about traces files to make it version specific. Sorry again.

Regards,

0xfadead commented 3 months ago

Hi @AnthonyLeonardoGracio,

I renamed the file and here's the log: als.2024-07-23T165948.12540.log

AnthonyLeonardoGracio commented 3 months ago

Hi @AnthonyLeonardoGracio,

I renamed the file and here's the log: als.2024-07-23T165948.12540.log

Thanks for the log. Nothing suspect unfortunately. I am wondering if the small delay can come from the textDocument/signatureHelp request: could you try to disable this feature from the Neovim client, to see if it gets better?

Regards,

0xfadead commented 3 months ago

Hi @AnthonyLeonardoGracio,

I have disabled textDocument/signatureHelp with vim.lsp.handlers['textDocument/signatureHelp'] = nil The problem still persists though.

Here's the log with only ALS.MAIN: als_main.log

Here's the log with ALS.MAIN, ALS.IN and ALS.OUT: als_all.log

0xfadead commented 3 months ago

Sorry for the ping @AnthonyLeonardoGracio. I think the first message didn't ping you because I included it in an edit.

AnthonyLeonardoGracio commented 3 months ago

Hi @AnthonyLeonardoGracio,

I have disabled textDocument/signatureHelp with vim.lsp.handlers['textDocument/signatureHelp'] = nil The problem still persists though.

Here's the log with only ALS.MAIN: als_main.log

Here's the log with ALS.MAIN, ALS.IN and ALS.OUT: als_all.log

I don't see anything strange unfortunately. I just see that the textDocument/semanticTokens request is sent right after by the Neovim client: try to disable it to see if things improve. But at this stage I would say it's a client bug, not a problem coming from the server. The behavior does not exist in VS Code for instance.

0xfadead commented 3 months ago

Okay, thanks. I'll close the issue since, as you said, it's probably a bug in something else.

Have a great rest of your day, Cheers

0xfadead commented 3 months ago

The issue was fixed by someone on reddit: https://www.reddit.com/r/ada/comments/1e3cthr/comment/lgio025/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button