enum LSProtocol::LSPErrorCodes

Defined in:

lsprotocol/types.cr

Enum Members

RequestFailed = -32803

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

ServerCancelled = -32802

The server cancelled the request. This error code should only be used for requests that explicitly support being server cancellable.

@since 3.17.0

ContentModified = -32801

The server detected that the content of a document got modified outside normal conditions. A server should NOT send this error code if it detects a content change in it unprocessed messages. The result even computed on an older state might still be useful for the client.

If a client decides that a result is not of any use anymore the client should cancel the request.

RequestCancelled = -32800

The client has canceled a request and a server has detected the cancel.

Constructors

Instance Method Summary

Constructor Detail

def self.from_json(pull : JSON::PullParser) : self #

[View source]
def self.new(pull : JSON::PullParser) : self #

[View source]

Instance Method Detail

def content_modified? #

[View source]
def request_cancelled? #

[View source]
def request_failed? #

[View source]
def server_cancelled? #

[View source]
def to_json(json : JSON::Builder) #
Description copied from struct Enum

Serializes this enum member by name.

For non-flags enums, the serialization is a JSON string. The value is the member name (see #to_s) transformed with String#underscore.

enum Stages
  INITIAL
  SECOND_STAGE
end

Stages::INITIAL.to_json      # => %("initial")
Stages::SECOND_STAGE.to_json # => %("second_stage")

For flags enums, the serialization is a JSON array including every flagged member individually serialized in the same way as a member of a non-flags enum. None is serialized as an empty array, All as an array containing all members.

@[Flags]
enum Sides
  LEFT
  RIGHT
end

Sides::LEFT.to_json                  # => %(["left"])
(Sides::LEFT | Sides::RIGHT).to_json # => %(["left","right"])
Sides::All.to_json                   # => %(["left","right"])
Sides::None.to_json                  # => %([])

ValueConverter.to_json offers a different serialization strategy based on the member value.


[View source]