Skip to content

Commit f5e7388

Browse files
authored
fix: handle string ids (#72)
1 parent d61613b commit f5e7388

150 files changed

Lines changed: 374 additions & 352 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/gen_lsp/protocol/requests/call_hierarchy_incoming_calls.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule GenLSP.Requests.CallHierarchyIncomingCalls do
1616
typedstruct do
1717
field :method, String.t(), default: "callHierarchy/incomingCalls"
1818
field :jsonrpc, String.t(), default: "2.0"
19-
field :id, integer(), enforce: true
19+
field :id, integer() | String.t(), enforce: true
2020
field :params, GenLSP.Structures.CallHierarchyIncomingCallsParams.t()
2121
end
2222

@@ -28,7 +28,7 @@ defmodule GenLSP.Requests.CallHierarchyIncomingCalls do
2828
schema(__MODULE__, %{
2929
method: "callHierarchy/incomingCalls",
3030
jsonrpc: "2.0",
31-
id: int(),
31+
id: oneof([int(), str()]),
3232
params: GenLSP.Structures.CallHierarchyIncomingCallsParams.schema()
3333
})
3434
end

lib/gen_lsp/protocol/requests/call_hierarchy_outgoing_calls.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule GenLSP.Requests.CallHierarchyOutgoingCalls do
1616
typedstruct do
1717
field :method, String.t(), default: "callHierarchy/outgoingCalls"
1818
field :jsonrpc, String.t(), default: "2.0"
19-
field :id, integer(), enforce: true
19+
field :id, integer() | String.t(), enforce: true
2020
field :params, GenLSP.Structures.CallHierarchyOutgoingCallsParams.t()
2121
end
2222

@@ -28,7 +28,7 @@ defmodule GenLSP.Requests.CallHierarchyOutgoingCalls do
2828
schema(__MODULE__, %{
2929
method: "callHierarchy/outgoingCalls",
3030
jsonrpc: "2.0",
31-
id: int(),
31+
id: oneof([int(), str()]),
3232
params: GenLSP.Structures.CallHierarchyOutgoingCallsParams.schema()
3333
})
3434
end

lib/gen_lsp/protocol/requests/client_register_capability.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule GenLSP.Requests.ClientRegisterCapability do
1515
typedstruct do
1616
field :method, String.t(), default: "client/registerCapability"
1717
field :jsonrpc, String.t(), default: "2.0"
18-
field :id, integer(), enforce: true
18+
field :id, integer() | String.t(), enforce: true
1919
field :params, GenLSP.Structures.RegistrationParams.t()
2020
end
2121

@@ -27,7 +27,7 @@ defmodule GenLSP.Requests.ClientRegisterCapability do
2727
schema(__MODULE__, %{
2828
method: "client/registerCapability",
2929
jsonrpc: "2.0",
30-
id: int(),
30+
id: oneof([int(), str()]),
3131
params: GenLSP.Structures.RegistrationParams.schema()
3232
})
3333
end

lib/gen_lsp/protocol/requests/client_unregister_capability.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defmodule GenLSP.Requests.ClientUnregisterCapability do
1515
typedstruct do
1616
field :method, String.t(), default: "client/unregisterCapability"
1717
field :jsonrpc, String.t(), default: "2.0"
18-
field :id, integer(), enforce: true
18+
field :id, integer() | String.t(), enforce: true
1919
field :params, GenLSP.Structures.UnregistrationParams.t()
2020
end
2121

@@ -27,7 +27,7 @@ defmodule GenLSP.Requests.ClientUnregisterCapability do
2727
schema(__MODULE__, %{
2828
method: "client/unregisterCapability",
2929
jsonrpc: "2.0",
30-
id: int(),
30+
id: oneof([int(), str()]),
3131
params: GenLSP.Structures.UnregistrationParams.schema()
3232
})
3333
end

lib/gen_lsp/protocol/requests/code_action_resolve.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule GenLSP.Requests.CodeActionResolve do
1616
typedstruct do
1717
field :method, String.t(), default: "codeAction/resolve"
1818
field :jsonrpc, String.t(), default: "2.0"
19-
field :id, integer(), enforce: true
19+
field :id, integer() | String.t(), enforce: true
2020
field :params, GenLSP.Structures.CodeAction.t()
2121
end
2222

@@ -28,7 +28,7 @@ defmodule GenLSP.Requests.CodeActionResolve do
2828
schema(__MODULE__, %{
2929
method: "codeAction/resolve",
3030
jsonrpc: "2.0",
31-
id: int(),
31+
id: oneof([int(), str()]),
3232
params: GenLSP.Structures.CodeAction.schema()
3333
})
3434
end

lib/gen_lsp/protocol/requests/code_lens_resolve.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule GenLSP.Requests.CodeLensResolve do
1414
typedstruct do
1515
field :method, String.t(), default: "codeLens/resolve"
1616
field :jsonrpc, String.t(), default: "2.0"
17-
field :id, integer(), enforce: true
17+
field :id, integer() | String.t(), enforce: true
1818
field :params, GenLSP.Structures.CodeLens.t()
1919
end
2020

@@ -26,7 +26,7 @@ defmodule GenLSP.Requests.CodeLensResolve do
2626
schema(__MODULE__, %{
2727
method: "codeLens/resolve",
2828
jsonrpc: "2.0",
29-
id: int(),
29+
id: oneof([int(), str()]),
3030
params: GenLSP.Structures.CodeLens.schema()
3131
})
3232
end

lib/gen_lsp/protocol/requests/completion_item_resolve.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule GenLSP.Requests.CompletionItemResolve do
1616
typedstruct do
1717
field :method, String.t(), default: "completionItem/resolve"
1818
field :jsonrpc, String.t(), default: "2.0"
19-
field :id, integer(), enforce: true
19+
field :id, integer() | String.t(), enforce: true
2020
field :params, GenLSP.Structures.CompletionItem.t()
2121
end
2222

@@ -28,7 +28,7 @@ defmodule GenLSP.Requests.CompletionItemResolve do
2828
schema(__MODULE__, %{
2929
method: "completionItem/resolve",
3030
jsonrpc: "2.0",
31-
id: int(),
31+
id: oneof([int(), str()]),
3232
params: GenLSP.Structures.CompletionItem.schema()
3333
})
3434
end

lib/gen_lsp/protocol/requests/document_link_resolve.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule GenLSP.Requests.DocumentLinkResolve do
1616
typedstruct do
1717
field :method, String.t(), default: "documentLink/resolve"
1818
field :jsonrpc, String.t(), default: "2.0"
19-
field :id, integer(), enforce: true
19+
field :id, integer() | String.t(), enforce: true
2020
field :params, GenLSP.Structures.DocumentLink.t()
2121
end
2222

@@ -28,7 +28,7 @@ defmodule GenLSP.Requests.DocumentLinkResolve do
2828
schema(__MODULE__, %{
2929
method: "documentLink/resolve",
3030
jsonrpc: "2.0",
31-
id: int(),
31+
id: oneof([int(), str()]),
3232
params: GenLSP.Structures.DocumentLink.schema()
3333
})
3434
end

lib/gen_lsp/protocol/requests/initialize.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule GenLSP.Requests.Initialize do
1818
typedstruct do
1919
field :method, String.t(), default: "initialize"
2020
field :jsonrpc, String.t(), default: "2.0"
21-
field :id, integer(), enforce: true
21+
field :id, integer() | String.t(), enforce: true
2222
field :params, GenLSP.Structures.InitializeParams.t()
2323
end
2424

@@ -30,7 +30,7 @@ defmodule GenLSP.Requests.Initialize do
3030
schema(__MODULE__, %{
3131
method: "initialize",
3232
jsonrpc: "2.0",
33-
id: int(),
33+
id: oneof([int(), str()]),
3434
params: GenLSP.Structures.InitializeParams.schema()
3535
})
3636
end

lib/gen_lsp/protocol/requests/inlay_hint_resolve.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule GenLSP.Requests.InlayHintResolve do
1818
typedstruct do
1919
field :method, String.t(), default: "inlayHint/resolve"
2020
field :jsonrpc, String.t(), default: "2.0"
21-
field :id, integer(), enforce: true
21+
field :id, integer() | String.t(), enforce: true
2222
field :params, GenLSP.Structures.InlayHint.t()
2323
end
2424

@@ -30,7 +30,7 @@ defmodule GenLSP.Requests.InlayHintResolve do
3030
schema(__MODULE__, %{
3131
method: "inlayHint/resolve",
3232
jsonrpc: "2.0",
33-
id: int(),
33+
id: oneof([int(), str()]),
3434
params: GenLSP.Structures.InlayHint.schema()
3535
})
3636
end

0 commit comments

Comments
 (0)