ebkalderon / tower-lsp

Language Server Protocol implementation written in Rust
Apache License 2.0
951 stars 54 forks source link

Add `RequestFailed` and `ServerCancelled` LSP specific error codes? #411

Open DavisVaughan opened 5 months ago

DavisVaughan commented 5 months ago

I see these two LSP specific error codes: https://github.com/ebkalderon/tower-lsp/blob/49e1ce54549d5efc53b75510517c2f0b86f5c827/src/jsonrpc/error.rs#L31-L42

In 3.17 we got a few more: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseMessage

Notably:

/**
     * A request failed but it was syntactically correct, e.g the
     * method name was known and the parameters were valid. The error
     * message should contain human readable information about why
     * the request failed.
     *
     * @since 3.17.0
     */
    export const RequestFailed: [integer](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#integer) = -32803;

    /**
     * The server cancelled the request. This error code should
     * only be used for requests that explicitly support being
     * server cancellable.
     *
     * @since 3.17.0
     */
    export const ServerCancelled: [integer](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#integer) = -32802;

Would it make sense to add these in?