enum

LSProtocol::LSPErrorCodes

Inherits Enum / Comparable / Value / Object

Constants

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

from_json(pull : JSON::PullParser) : self
Source
new(pull : JSON::PullParser) : self
Source

Instance methods

content_modified?

Returns true if this enum value equals ContentModified

Source
request_cancelled?

Returns true if this enum value equals RequestCancelled

Source
request_failed?

Returns true if this enum value equals RequestFailed

Source
server_cancelled?

Returns true if this enum value equals ServerCancelled

Source
to_json(json : JSON::Builder)

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.

Source