bergercookie / asm-lsp

Language server for NASM/GAS/GO Assembly
https://crates.io/crates/asm-lsp
BSD 2-Clause "Simplified" License
269 stars 18 forks source link

fix: Don't send empty response to Helix client #150

Closed WillLillis closed 1 month ago

WillLillis commented 1 month ago

Whenever the server doesn't have an answer for a request (for example, you hover over something that it doesn't have information for), it sends an empty response. This looks like the following:

Response {
    id, // id passed in for the corresponding request
    result: None,
    error: None,
};

When this response is sent to the Helix LSP client, it shuts down the server with the following log:

[ERROR] Exiting asm-lsp after unexpected error: Parse(Error("data did not match any variant of untagged enum ServerMessage", line: 0, column: 0))

The easy solution for this is to detect if the lsp-client is helix at server start, and store that information in our Config object. If the client is helix and an empty response is going to be sent, we send nothing instead.

Closes #148