sig/shims/language-server_protocol.rbs in steep-1.4.0 vs sig/shims/language-server_protocol.rbs in steep-1.5.0.pre.1
- old
+ new
@@ -16,20 +16,10 @@
end
end
end
module Constant
- module DiagnosticSeverity
- ERROR: String
-
- WARNING: String
-
- INFORMATION: String
-
- HINT: String
- end
-
module CompletionItemKind
type t = Integer
TEXT: Integer
METHOD: Integer
@@ -85,10 +75,61 @@
PLAINTEXT: "plaintext"
MARKDOWN: "markdown"
end
+
+ module DiagnosticSeverity
+ type t = 1 | 2 | 3 | 4
+
+ ERROR: 1
+
+ WARNING: 2
+
+ INFORMATION: 3
+
+ HINT: 4
+ end
+
+ module DiagnosticTag
+ type t = 1 | 2
+
+ UNNECESSARY: 1
+
+ DEPRECATED: 2
+ end
+
+ module SymbolKind
+ FILE: 1
+ MODULE: 2
+ NAMESPACE: 3
+ PACKAGE: 4
+ CLASS: 5
+ METHOD: 6
+ PROPERTY: 7
+ FIELD: 8
+ CONSTRUCTOR: 9
+ ENUM: 10
+ INTERFACE: 11
+ FUNCTION: 12
+ VARIABLE: 13
+ CONSTANT: 14
+ STRING: 15
+ NUMBER: 16
+ BOOLEAN: 17
+ ARRAY: 18
+ OBJECT: 19
+ KEY: 20
+ NULL: 21
+ ENUM_MEMBER: 22
+ STRUCT: 23
+ EVENT: 24
+ OPERATOR: 25
+ TYPE_PARAMETER: 26
+
+ type t = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26
+ end
end
module Interface
interface _Base
def attributes: () -> Hash[Symbol, untyped]
@@ -97,10 +138,12 @@
def to_json: () -> String
end
class Position
+ type json = { line: Integer, character: Integer }
+
include _Base
# 0-origin line number
attr_reader line: Integer
@@ -112,18 +155,35 @@
end
class Range
include _Base
+ type json = {
+ start: Position::json,
+ end: Position::json
+ }
+
attr_reader start: Position
attr_reader end: Position
def initialize: (start: Position, end: Position) -> void
| (Hash[Symbol, untyped]) -> void
end
+ class Location
+ include _Base
+
+ type json = { uri: String, range: Range::json }
+
+ attr_reader uri: String
+
+ attr_reader range: Range
+
+ def initialize: (uri: String, range: Range) -> void
+ end
+
class MarkupContent
include _Base
attr_reader kind: Constant::MarkupKind::t
@@ -289,9 +349,90 @@
attr_reader active_signature: Integer?
attr_reader active_parameter: Integer?
def initialize: (signatures: Array[SignatureInformation], ?active_signature: Integer?, ?active_parameter: Integer?) -> void
+ end
+
+ class PublishDiagnosticsParams
+ include _Base
+
+ attr_reader uri: String
+
+ attr_reader version: Integer?
+
+ attr_reader diagnostics: Array[Diagnostic]
+
+ def initialize: (uri: String, ?version: Integer?, diagnostics: Array[Diagnostic]) -> void
+ end
+
+ class Diagnostic
+ type json = {
+ range: Range::json,
+ severity: Constant::DiagnosticSeverity::t?,
+ code: Integer | String | nil,
+ codeDescription: CodeDescription::json?,
+ source: String?,
+ message: String,
+ tags: Array[Constant::DiagnosticTag::t]?,
+ relatedInformation: RelatedInformation::json?,
+ data: untyped?
+ }
+
+ attr_reader range: Range
+
+ attr_reader severity: Constant::DiagnosticSeverity::t?
+
+ attr_reader code: Integer | String | nil
+
+ attr_reader code_description: CodeDescription?
+
+ attr_reader source: String?
+
+ attr_reader message: String
+
+ attr_reader tags: Array[Constant::DiagnosticTag::t]?
+
+ attr_reader related_information: RelatedInformation?
+
+ attr_reader data: untyped?
+
+ def initialize: (
+ range: Range,
+ ?severity: Constant::DiagnosticSeverity::t?,
+ ?code: Integer | String | nil,
+ ?code_description: CodeDescription?,
+ ?source: String?,
+ message: String,
+ ?tags: Array[Constant::DiagnosticTag::t]?,
+ ?related_information: RelatedInformation?,
+ ?data: untyped
+ ) -> void
+ end
+
+ class RelatedInformation
+ include _Base
+
+ type json = {
+ location: Location::json,
+ message: String
+ }
+
+ attr_reader location: Location
+
+ attr_reader message: String
+
+ def initialize: (location: Location, message: String) -> void
+ end
+
+ class CodeDescription
+ include _Base
+
+ type json = { href: String }
+
+ attr_reader href: String
+
+ def initialize: (href: String) -> void
end
end
end
end