Skip to content

Commit

Permalink
Allow request ids to be strings (#1929)
Browse files Browse the repository at this point in the history
The LSP spec allows this: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage

Addons that want to sent requests must provide an id but since the
counter is internal to the server that is not easily possible at the moment.

See the conversation starting at Shopify/ruby-lsp-rails#326 (comment) for more context
  • Loading branch information
Earlopain authored Apr 16, 2024
1 parent fa8b842 commit add6922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ruby_lsp/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def to_hash
class Request < Message
extend T::Sig

sig { params(id: Integer, method: String, params: Object).void }
sig { params(id: T.any(Integer, String), method: String, params: Object).void }
def initialize(id:, method:, params:)
@id = id
super(method: method, params: params)
Expand Down

0 comments on commit add6922

Please sign in to comment.