diff --git a/Makefile b/Makefile index 6521363d..0b193336 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -poncho_dirs = forge expert_credo proto protocol engine expert +poncho_dirs = forge expert_credo engine expert compile.all: compile.poncho diff --git a/README.md b/README.md index 42820261..2733d64f 100644 --- a/README.md +++ b/README.md @@ -175,7 +175,7 @@ compile_project(:other) # the other project is compiled iex(2)> complete :other, "defmo|" [ - #Protocol.Types.Completion.Item<[ + #GenLSP.Structures.CompletionItem<[ detail: "", insert_text: "defmacro ${1:name}($2) do\n $0\nend\n", insert_text_format: :snippet, @@ -183,7 +183,7 @@ iex(2)> complete :other, "defmo|" label: "defmacro (Define a macro)", sort_text: "093_defmacro (Define a macro)" ]>, - #Protocol.Types.Completion.Item<[ + #GenLSP.Structures.CompletionItem<[ detail: "", insert_text: "defmacrop ${1:name}($2) do\n $0\nend\n", insert_text_format: :snippet, @@ -191,7 +191,7 @@ iex(2)> complete :other, "defmo|" label: "defmacrop (Define a private macro)", sort_text: "094_defmacrop (Define a private macro)" ]>, - #Protocol.Types.Completion.Item<[ + #GenLSP.Structures.CompletionItem<[ detail: "", insert_text: "defmodule ${1:module name} do\n $0\nend\n", insert_text_format: :snippet, diff --git a/apps/engine/lib/engine/engine/code_action.ex b/apps/engine/lib/engine/engine/code_action.ex index 85b31588..08dc4dba 100644 --- a/apps/engine/lib/engine/engine/code_action.ex +++ b/apps/engine/lib/engine/engine/code_action.ex @@ -5,20 +5,13 @@ defmodule Engine.CodeAction do alias Forge.Document.Changes alias Forge.Document.Range + require Logger + defstruct [:title, :kind, :changes, :uri] - @type code_action_kind :: - :empty - | :quick_fix - | :refactor - | :refactor_extract - | :refactor_inline - | :refactor_rewrite - | :source - | :source_organize_imports - | :source_fix_all + @type code_action_kind :: GenLSP.Enumerations.CodeActionKind.t() - @type trigger_kind :: :invoked | :automatic + @type trigger_kind :: GenLSP.Enumerations.CodeActionTriggerKind.t() @type t :: %__MODULE__{ title: String.t(), diff --git a/apps/engine/lib/engine/engine/code_action/handlers/add_alias.ex b/apps/engine/lib/engine/engine/code_action/handlers/add_alias.ex index c80bc54a..1176c68b 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/add_alias.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/add_alias.ex @@ -1,4 +1,11 @@ defmodule Engine.CodeAction.Handlers.AddAlias do + alias Engine.Analyzer + alias Engine.CodeAction + alias Engine.CodeIntelligence.Entity + alias Engine.CodeMod + alias Engine.Modules + alias Engine.Search.Fuzzy + alias Engine.Search.Indexer.Entry alias Forge.Ast alias Forge.Ast.Analysis alias Forge.Ast.Analysis.Alias @@ -7,14 +14,7 @@ defmodule Engine.CodeAction.Handlers.AddAlias do alias Forge.Document.Position alias Forge.Document.Range alias Forge.Formats - - alias Engine.Analyzer - alias Engine.CodeAction - alias Engine.CodeIntelligence.Entity - alias Engine.CodeMod - alias Engine.Modules - alias Engine.Search.Fuzzy - alias Engine.Search.Indexer.Entry + alias GenLSP.Enumerations.CodeActionKind alias Mix.Tasks.Namespace alias Sourceror.Zipper @@ -41,7 +41,7 @@ defmodule Engine.CodeAction.Handlers.AddAlias do @impl CodeAction.Handler def kinds do - [:quick_fix] + [CodeActionKind.quick_fix()] end @impl CodeAction.Handler @@ -69,7 +69,7 @@ defmodule Engine.CodeAction.Handlers.AddAlias do CodeAction.new( analysis.document.uri, "alias #{Formats.module(potential_alias_module)}", - :quick_fix, + CodeActionKind.quick_fix(), changes ) end diff --git a/apps/engine/lib/engine/engine/code_action/handlers/organize_aliases.ex b/apps/engine/lib/engine/engine/code_action/handlers/organize_aliases.ex index 83cdde13..bc1be535 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/organize_aliases.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/organize_aliases.ex @@ -6,6 +6,7 @@ defmodule Engine.CodeAction.Handlers.OrganizeAliases do alias Forge.Document alias Forge.Document.Changes alias Forge.Document.Range + alias GenLSP.Enumerations.CodeActionKind require Logger @@ -23,7 +24,15 @@ defmodule Engine.CodeAction.Handlers.OrganizeAliases do [] else changes = Changes.new(doc, edits) - [CodeAction.new(doc.uri, "Organize aliases", :source_organize_imports, changes)] + + [ + CodeAction.new( + doc.uri, + "Organize aliases", + CodeActionKind.source_organize_imports(), + changes + ) + ] end else _ -> @@ -33,7 +42,7 @@ defmodule Engine.CodeAction.Handlers.OrganizeAliases do @impl CodeAction.Handler def kinds do - [:source, :source_organize_imports] + [CodeActionKind.source(), CodeActionKind.source_organize_imports()] end @impl CodeAction.Handler diff --git a/apps/engine/lib/engine/engine/code_action/handlers/refactorex.ex b/apps/engine/lib/engine/engine/code_action/handlers/refactorex.ex index a1df13ec..0b5921d4 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/refactorex.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/refactorex.ex @@ -1,11 +1,10 @@ defmodule Engine.CodeAction.Handlers.Refactorex do + alias Engine.CodeAction + alias Engine.CodeMod alias Forge.Document alias Forge.Document.Changes alias Forge.Document.Range - - alias Engine.CodeAction - alias Engine.CodeMod - + alias GenLSP.Enumerations alias Refactorex.Refactor @behaviour CodeAction.Handler @@ -21,7 +20,7 @@ defmodule Engine.CodeAction.Handlers.Refactorex do CodeAction.new( doc.uri, refactoring.title, - map_kind(refactoring.kind), + refactoring.kind, ast_to_changes(doc, refactoring.refactored) ) end) @@ -31,10 +30,10 @@ defmodule Engine.CodeAction.Handlers.Refactorex do end @impl CodeAction.Handler - def kinds, do: [:refactor] + def kinds, do: [Enumerations.CodeActionKind.refactor()] @impl CodeAction.Handler - def trigger_kind, do: :invoked + def trigger_kind, do: Enumerations.CodeActionTriggerKind.invoked() defp line_or_selection(_, %{start: start, end: start}), do: {:ok, start.line} @@ -44,9 +43,6 @@ defmodule Engine.CodeAction.Handlers.Refactorex do |> Sourceror.parse_string(line: start.line, column: start.character) end - defp map_kind("quickfix"), do: :quick_fix - defp map_kind(kind), do: :"#{String.replace(kind, ".", "_")}" - defp ast_to_changes(doc, ast) do {formatter, opts} = CodeMod.Format.formatter_for_file(Engine.get_project(), doc.uri) diff --git a/apps/engine/lib/engine/engine/code_action/handlers/remove_unused_alias.ex b/apps/engine/lib/engine/engine/code_action/handlers/remove_unused_alias.ex index f407f155..02d495e5 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/remove_unused_alias.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/remove_unused_alias.ex @@ -31,6 +31,7 @@ defmodule Engine.CodeAction.Handlers.RemoveUnusedAlias do alias Forge.Document.Edit alias Forge.Document.Position alias Forge.Document.Range + alias GenLSP.Enumerations alias Sourceror.Zipper import Record @@ -51,7 +52,14 @@ defmodule Engine.CodeAction.Handlers.RemoveUnusedAlias do case to_edit(document, range.start, diagnostic) do {:ok, module_name, edit} -> changes = Changes.new(document, [edit]) - action = CodeAction.new(document.uri, "Remove alias #{module_name}", :source, changes) + + action = + CodeAction.new( + document.uri, + "Remove alias #{module_name}", + Enumerations.CodeActionKind.source(), + changes + ) [action | acc] @@ -63,7 +71,7 @@ defmodule Engine.CodeAction.Handlers.RemoveUnusedAlias do @impl CodeAction.Handler def kinds do - [:source] + [Enumerations.CodeActionKind.source()] end @impl CodeAction.Handler diff --git a/apps/engine/lib/engine/engine/code_action/handlers/replace_remote_function.ex b/apps/engine/lib/engine/engine/code_action/handlers/replace_remote_function.ex index ebe50719..7c6ac41d 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/replace_remote_function.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/replace_remote_function.ex @@ -1,13 +1,13 @@ defmodule Engine.CodeAction.Handlers.ReplaceRemoteFunction do + alias Engine.CodeAction + alias Engine.CodeAction.Diagnostic + alias Engine.Modules alias Forge.Ast alias Forge.Document alias Forge.Document.Changes alias Forge.Document.Edit alias Forge.Document.Range - - alias Engine.CodeAction - alias Engine.CodeAction.Diagnostic - alias Engine.Modules + alias GenLSP.Enumerations.CodeActionKind alias Sourceror.Zipper @behaviour CodeAction.Handler @@ -27,7 +27,7 @@ defmodule Engine.CodeAction.Handlers.ReplaceRemoteFunction do @impl CodeAction.Handler def kinds do - [:quick_fix] + [CodeActionKind.quick_fix()] end @impl CodeAction.Handler @@ -41,7 +41,14 @@ defmodule Engine.CodeAction.Handlers.ReplaceRemoteFunction do case apply_transform(doc, line_number, module, function, suggestion) do {:ok, edits} -> changes = Changes.new(doc, edits) - code_action = CodeAction.new(doc.uri, "Rename to #{suggestion}", :quick_fix, changes) + + code_action = + CodeAction.new( + doc.uri, + "Rename to #{suggestion}", + CodeActionKind.quick_fix(), + changes + ) [code_action | acc] diff --git a/apps/engine/lib/engine/engine/code_action/handlers/replace_with_underscore.ex b/apps/engine/lib/engine/engine/code_action/handlers/replace_with_underscore.ex index 716dcdbc..cf000e62 100644 --- a/apps/engine/lib/engine/engine/code_action/handlers/replace_with_underscore.ex +++ b/apps/engine/lib/engine/engine/code_action/handlers/replace_with_underscore.ex @@ -5,6 +5,7 @@ defmodule Engine.CodeAction.Handlers.ReplaceWithUnderscore do alias Forge.Document alias Forge.Document.Changes alias Forge.Document.Range + alias GenLSP.Enumerations.CodeActionKind alias Sourceror.Zipper @behaviour CodeAction.Handler @@ -14,7 +15,13 @@ defmodule Engine.CodeAction.Handlers.ReplaceWithUnderscore do Enum.reduce(diagnostics, [], fn %Diagnostic{} = diagnostic, acc -> with {:ok, variable_name, line_number} <- extract_variable_and_line(diagnostic), {:ok, changes} <- to_changes(doc, line_number, variable_name) do - action = CodeAction.new(doc.uri, "Rename to _#{variable_name}", :quick_fix, changes) + action = + CodeAction.new( + doc.uri, + "Rename to _#{variable_name}", + CodeActionKind.quick_fix(), + changes + ) [action | acc] else @@ -26,7 +33,7 @@ defmodule Engine.CodeAction.Handlers.ReplaceWithUnderscore do @impl CodeAction.Handler def kinds do - [:quick_fix] + [CodeActionKind.quick_fix()] end @impl CodeAction.Handler diff --git a/apps/engine/mix.exs b/apps/engine/mix.exs index ce4f0eb5..d63057e2 100644 --- a/apps/engine/mix.exs +++ b/apps/engine/mix.exs @@ -46,6 +46,7 @@ defmodule Engine.MixProject do Mix.Dialyzer.dependency(), {:elixir_sense, github: "elixir-lsp/elixir_sense", ref: "73ce7e0d239342fb9527d7ba567203e77dbb9b25"}, + {:gen_lsp, "~> 0.10"}, {:patch, "~> 0.15", only: [:dev, :test], optional: true, runtime: false}, {:path_glob, "~> 0.2", optional: true}, {:phoenix_live_view, "~> 1.0", only: [:test], optional: true, runtime: false}, diff --git a/apps/engine/mix.lock b/apps/engine/mix.lock index d27e6553..74bd1a20 100644 --- a/apps/engine/mix.lock +++ b/apps/engine/mix.lock @@ -8,8 +8,10 @@ "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "73ce7e0d239342fb9527d7ba567203e77dbb9b25", [ref: "73ce7e0d239342fb9527d7ba567203e77dbb9b25"]}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "gen_lsp": {:hex, :gen_lsp, "0.10.0", "f6da076b5ccedf937d17aa9743635a2c3d0f31265c853e58b02ab84d71852270", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "768f8f7b5c5e218fb36dcebd30dcd6275b61ca77052c98c3c4c0375158392c4a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "patch": {:hex, :patch, "0.15.0", "947dd6a8b24a2d2d1137721f20bb96a8feb4f83248e7b4ad88b4871d52807af5", [:mix], [], "hexpm", "e8dadf9b57b30e92f6b2b1ce2f7f57700d14c66d4ed56ee27777eb73fb77e58d"}, "path_glob": {:hex, :path_glob, "0.2.0", "b9e34b5045cac5ecb76ef1aa55281a52bf603bf7009002085de40958064ca312", [:mix], [{:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "be2594cb4553169a1a189f95193d910115f64f15f0d689454bb4e8cfae2e7ebc"}, @@ -21,11 +23,13 @@ "plug": {:hex, :plug, "1.17.0", "a0832e7af4ae0f4819e0c08dd2e7482364937aea6a8a997a679f2cbb7e026b2e", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6692046652a69a00a5a21d0b7e11fcf401064839d59d6b8787f23af55b1e6bc"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "refactorex": {:hex, :refactorex, "0.1.51", "74fc4603b31b600d78539ffea9fe170038aa8d471eec5aed261354c9734b4b27", [:mix], [{:sourceror, "~> 1.7", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "aefa150ab2c0d62aa8c01c4d04b932806118790f09c4106e20883281932fba03"}, + "schematic": {:hex, :schematic, "0.2.1", "0b091df94146fd15a0a343d1bd179a6c5a58562527746dadd09477311698dbb1", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0b255d65921e38006138201cd4263fd8bb807d9dfc511074615cd264a571b3b1"}, "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "websock_adapter": {:hex, :websock_adapter, "0.5.8", "3b97dc94e407e2d1fc666b2fb9acf6be81a1798a2602294aac000260a7c4a47d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "315b9a1865552212b5f35140ad194e67ce31af45bcee443d4ecb96b5fd3f3782"}, } diff --git a/apps/expert/lib/convertibles/expert.plugin.diagnostic.result.ex b/apps/expert/lib/convertibles/forge.plugin.diagnostic.result.ex similarity index 78% rename from apps/expert/lib/convertibles/expert.plugin.diagnostic.result.ex rename to apps/expert/lib/convertibles/forge.plugin.diagnostic.result.ex index 1c750278..66fbd5af 100644 --- a/apps/expert/lib/convertibles/expert.plugin.diagnostic.result.ex +++ b/apps/expert/lib/convertibles/forge.plugin.diagnostic.result.ex @@ -1,6 +1,7 @@ -defimpl Forge.Convertible, for: Forge.Plugin.V1.Diagnostic.Result do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types +defimpl Forge.Protocol.Convertible, for: Forge.Plugin.V1.Diagnostic.Result do + alias GenLSP.Structures + alias GenLSP.Enumerations.DiagnosticSeverity + alias Forge.Protocol.Conversions alias Forge.Document alias Forge.Document.Position alias Forge.Document.Range @@ -10,10 +11,10 @@ defimpl Forge.Convertible, for: Forge.Plugin.V1.Diagnostic.Result do def to_lsp(%Diagnostic.Result{} = diagnostic) do with {:ok, lsp_range} <- lsp_range(diagnostic) do - proto_diagnostic = %Types.Diagnostic{ + proto_diagnostic = %Structures.Diagnostic{ message: diagnostic.message, range: lsp_range, - severity: diagnostic.severity, + severity: map_severity(diagnostic.severity), source: diagnostic.source } @@ -21,6 +22,11 @@ defimpl Forge.Convertible, for: Forge.Plugin.V1.Diagnostic.Result do end end + defp map_severity(:error), do: DiagnosticSeverity.error() + defp map_severity(:warning), do: DiagnosticSeverity.warning() + defp map_severity(:information), do: DiagnosticSeverity.information() + defp map_severity(:hint), do: DiagnosticSeverity.hint() + def to_native(%Diagnostic.Result{} = diagnostic, _) do {:ok, diagnostic} end @@ -28,10 +34,10 @@ defimpl Forge.Convertible, for: Forge.Plugin.V1.Diagnostic.Result do defp lsp_range(%Diagnostic.Result{position: %Position{} = position}) do with {:ok, lsp_start_pos} <- Conversions.to_lsp(position) do range = - Types.Range.new( + %Structures.Range{ start: lsp_start_pos, - end: Types.Position.new(line: lsp_start_pos.line + 1, character: 0) - ) + end: %Structures.Position{line: lsp_start_pos.line + 1, character: 0} + } {:ok, range} end diff --git a/apps/expert/lib/expert.ex b/apps/expert/lib/expert.ex index 67f0703f..83989e36 100644 --- a/apps/expert/lib/expert.ex +++ b/apps/expert/lib/expert.ex @@ -1,22 +1,22 @@ defmodule Expert do - alias Expert.Proto.Convert - alias Expert.Protocol.Notifications - alias Expert.Protocol.Requests alias Expert.Provider.Handlers alias Expert.State alias Expert.TaskQueue + alias Forge.Protocol.Convert + alias GenLSP.Notifications + alias GenLSP.Requests require Logger use GenServer @server_specific_messages [ - Notifications.DidChange, - Notifications.DidChangeConfiguration, - Notifications.DidChangeWatchedFiles, - Notifications.DidClose, - Notifications.DidOpen, - Notifications.DidSave, + Notifications.TextDocumentDidChange, + Notifications.WorkspaceDidChangeConfiguration, + Notifications.WorkspaceDidChangeWatchedFiles, + Notifications.TextDocumentDidClose, + Notifications.TextDocumentDidOpen, + Notifications.TextDocumentDidSave, Notifications.Exit, Notifications.Initialized, Requests.Shutdown @@ -25,14 +25,14 @@ defmodule Expert do @dialyzer {:nowarn_function, apply_to_state: 2} @spec server_request( - Requests.request(), - (Requests.request(), {:ok, any()} | {:error, term()} -> term()) + term(), + (term(), {:ok, any()} | {:error, term()} -> term()) ) :: :ok def server_request(request, on_response) when is_function(on_response, 2) do GenServer.call(__MODULE__, {:server_request, request, on_response}) end - @spec server_request(Requests.request()) :: :ok + @spec server_request(term()) :: :ok def server_request(request) do server_request(request, fn _, _ -> :ok end) end @@ -102,12 +102,7 @@ defmodule Expert do end end - def handle_message(%Requests.Cancel{} = cancel_request, %State{} = state) do - TaskQueue.cancel(cancel_request) - {:ok, state} - end - - def handle_message(%Notifications.Cancel{} = cancel_notification, %State{} = state) do + def handle_message(%Notifications.DollarCancelRequest{} = cancel_notification, %State{} = state) do TaskQueue.cancel(cancel_notification) {:ok, state} end @@ -131,8 +126,10 @@ defmodule Expert do def handle_message(%_{} = request, %State{} = state) do with {:ok, handler} <- fetch_handler(request), - {:ok, req} <- Convert.to_native(request) do - TaskQueue.add(request.id, {handler, :handle, [req, state.configuration]}) + {:ok, request} <- Convert.to_native(request) do + # Logger.info("Handling request: #{inspect(request, pretty: true)}") + + TaskQueue.add(request.id, {handler, :handle, [request, state.configuration]}) else {:error, {:unhandled, _}} -> Logger.info("Unhandled request: #{request.method}") @@ -161,31 +158,31 @@ defmodule Expert do # credo:disable-for-next-line Credo.Check.Refactor.CyclomaticComplexity defp fetch_handler(%_{} = request) do case request do - %Requests.FindReferences{} -> + %Requests.TextDocumentReferences{} -> {:ok, Handlers.FindReferences} - %Requests.Formatting{} -> + %Requests.TextDocumentFormatting{} -> {:ok, Handlers.Formatting} - %Requests.CodeAction{} -> + %Requests.TextDocumentCodeAction{} -> {:ok, Handlers.CodeAction} - %Requests.CodeLens{} -> + %Requests.TextDocumentCodeLens{} -> {:ok, Handlers.CodeLens} - %Requests.Completion{} -> + %Requests.TextDocumentCompletion{} -> {:ok, Handlers.Completion} - %Requests.GoToDefinition{} -> + %Requests.TextDocumentDefinition{} -> {:ok, Handlers.GoToDefinition} - %Requests.Hover{} -> + %Requests.TextDocumentHover{} -> {:ok, Handlers.Hover} - %Requests.ExecuteCommand{} -> + %Requests.WorkspaceExecuteCommand{} -> {:ok, Handlers.Commands} - %Requests.DocumentSymbols{} -> + %Requests.TextDocumentDocumentSymbol{} -> {:ok, Handlers.DocumentSymbols} %Requests.WorkspaceSymbol{} -> diff --git a/apps/expert/lib/expert/code_intelligence/completion.ex b/apps/expert/lib/expert/code_intelligence/completion.ex index 94f9299c..28fa726b 100644 --- a/apps/expert/lib/expert/code_intelligence/completion.ex +++ b/apps/expert/lib/expert/code_intelligence/completion.ex @@ -4,16 +4,17 @@ defmodule Expert.CodeIntelligence.Completion do alias Expert.CodeIntelligence.Completion.Translatable alias Expert.Configuration alias Expert.Project.Intelligence - alias Expert.Protocol.Types.Completion - alias Expert.Protocol.Types.InsertTextFormat alias Forge.Ast.Analysis alias Forge.Ast.Env alias Forge.Document.Position alias Forge.Project alias Future.Code, as: Code + alias GenLSP.Enumerations.CompletionTriggerKind + alias GenLSP.Structures.CompletionContext + alias GenLSP.Structures.CompletionItem + alias GenLSP.Structures.CompletionList alias Mix.Tasks.Namespace - require InsertTextFormat require Logger @expert_deps Enum.map([:expert | Mix.Project.deps_apps()], &Atom.to_string/1) @@ -24,13 +25,13 @@ defmodule Expert.CodeIntelligence.Completion do [".", "@", "&", "%", "^", ":", "!", "-", "~"] end - @spec complete(Project.t(), Analysis.t(), Position.t(), Completion.Context.t()) :: - Completion.List.t() + @spec complete(Project.t(), Analysis.t(), Position.t(), CompletionContext.t()) :: + CompletionList.t() def complete( %Project{} = project, %Analysis{} = analysis, %Position{} = position, - %Completion.Context{} = context + %CompletionContext{} = context ) do case Env.new(project, analysis, position) do {:ok, env} -> @@ -46,7 +47,7 @@ defmodule Expert.CodeIntelligence.Completion do defp log_candidates(candidates) do log_iolist = - Enum.reduce(candidates, ["Emitting Completions: ["], fn %Completion.Item{} = completion, + Enum.reduce(candidates, ["Emitting Completions: ["], fn %CompletionItem{} = completion, acc -> name = Map.get(completion, :name) || Map.get(completion, :label) kind = completion |> Map.get(:kind, :unknown) |> to_string() @@ -57,7 +58,7 @@ defmodule Expert.CodeIntelligence.Completion do Logger.info([log_iolist, "]"]) end - defp completions(%Project{} = project, %Env{} = env, %Completion.Context{} = context) do + defp completions(%Project{} = project, %Env{} = env, %CompletionContext{} = context) do prefix_tokens = Env.prefix_tokens(env, 1) cond do @@ -162,7 +163,7 @@ defmodule Expert.CodeIntelligence.Completion do local_completions, %Project{} = project, %Env{} = env, - %Completion.Context{} = context + %CompletionContext{} = context ) do debug_local_completions(local_completions) @@ -170,7 +171,7 @@ defmodule Expert.CodeIntelligence.Completion do displayable?(project, result), applies_to_context?(project, result, context), applies_to_env?(env, result), - %Completion.Item{} = item <- to_completion_item(result, env) do + %CompletionItem{} = item <- to_completion_item(result, env) do item end end @@ -338,30 +339,31 @@ defmodule Expert.CodeIntelligence.Completion do false end - defp applies_to_context?(%Project{} = project, result, %Completion.Context{ - trigger_kind: :trigger_character, - trigger_character: "%" - }) do - case result do - %Candidate.Module{} = result -> - Intelligence.defines_struct?(project, result.full_name, from: :child, to: :child) + defp applies_to_context?(%Project{} = project, result, %CompletionContext{} = context) do + struct_completion? = + context.trigger_kind == CompletionTriggerKind.trigger_character() and + context.trigger_character == "%" - %Candidate.Struct{} -> - true + if struct_completion? do + case result do + %Candidate.Module{} = result -> + Intelligence.defines_struct?(project, result.full_name, from: :child, to: :child) - _other -> - false - end - end + %Candidate.Struct{} -> + true - defp applies_to_context?(_project, _result, _context) do - true + _other -> + false + end + else + true + end end defp maybe_to_completion_list(items \\ []) defp maybe_to_completion_list([]) do - Completion.List.new(items: [], is_incomplete: true) + %CompletionList{items: [], is_incomplete: true} end defp maybe_to_completion_list(items), do: items diff --git a/apps/expert/lib/expert/code_intelligence/completion/builder.ex b/apps/expert/lib/expert/code_intelligence/completion/builder.ex index 17c0afa8..28c4de94 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/builder.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/builder.ex @@ -11,14 +11,16 @@ defmodule Expert.CodeIntelligence.Completion.Builder do """ alias Expert.CodeIntelligence.Completion.SortScope - alias Expert.Protocol.Types.Completion - alias Expert.Protocol.Types.Markup.Content alias Forge.Ast.Env alias Forge.Document alias Forge.Document.Edit alias Forge.Document.Position alias Forge.Document.Range alias Future.Code, as: Code + alias GenLSP.Enumerations.InsertTextFormat + alias GenLSP.Enumerations.MarkupKind + alias GenLSP.Structures.CompletionItem + alias GenLSP.Structures.MarkupContent @doc "Fields found in `t:Expert.Protocol.Types.Completion.Item.t()`" @type item_opts :: keyword() @@ -27,19 +29,19 @@ defmodule Expert.CodeIntelligence.Completion.Builder do @type line_range :: {start_character :: pos_integer, end_character :: pos_integer} - @spec snippet(Env.t(), String.t(), item_opts) :: Completion.Item.t() + @spec snippet(Env.t(), String.t(), item_opts) :: CompletionItem.t() def snippet(%Env{} = env, text, options \\ []) do range = prefix_range(env) text_edit_snippet(env, text, range, options) end - @spec plain_text(Env.t(), String.t(), item_opts) :: Completion.Item.t() + @spec plain_text(Env.t(), String.t(), item_opts) :: CompletionItem.t() def plain_text(%Env{} = env, text, options \\ []) do range = prefix_range(env) text_edit(env, text, range, options) end - @spec text_edit(Env.t(), String.t(), line_range, item_opts) :: Completion.Item.t() + @spec text_edit(Env.t(), String.t(), line_range, item_opts) :: CompletionItem.t() def text_edit(%Env{} = env, text, {start_char, end_char}, options \\ []) do line_number = env.position.line @@ -51,14 +53,15 @@ defmodule Expert.CodeIntelligence.Completion.Builder do edits = Document.Changes.new(env.document, Edit.new(text, range)) - options - |> Keyword.put(:text_edit, edits) - |> Completion.Item.new() + options = Keyword.put(options, :text_edit, edits) + + CompletionItem + |> struct(options) |> markdown_docs() |> set_sort_scope(SortScope.default()) end - @spec text_edit_snippet(Env.t(), String.t(), line_range, item_opts) :: Completion.Item.t() + @spec text_edit_snippet(Env.t(), String.t(), line_range, item_opts) :: CompletionItem.t() def text_edit_snippet(%Env{} = env, text, {start_char, end_char}, options \\ []) do snippet = String.trim_trailing(text, "\n") line_number = env.position.line @@ -71,10 +74,13 @@ defmodule Expert.CodeIntelligence.Completion.Builder do edits = Document.Changes.new(env.document, Edit.new(snippet, range)) - options - |> Keyword.put(:text_edit, edits) - |> Keyword.put(:insert_text_format, :snippet) - |> Completion.Item.new() + option = + options + |> Keyword.put(:text_edit, edits) + |> Keyword.put(:insert_text_format, InsertTextFormat.snippet()) + + CompletionItem + |> struct(option) |> markdown_docs() |> set_sort_scope(SortScope.default()) end @@ -84,10 +90,10 @@ defmodule Expert.CodeIntelligence.Completion.Builder do def fallback("", fallback), do: fallback def fallback(detail, _), do: detail - @spec set_sort_scope(Completion.Item.t(), sort_scope :: String.t()) :: Completion.Item.t() + @spec set_sort_scope(CompletionItem.t(), sort_scope :: String.t()) :: CompletionItem.t() def set_sort_scope(item, default \\ SortScope.default()) - def set_sort_scope(%Completion.Item{} = item, sort_scope) + def set_sort_scope(%CompletionItem{} = item, sort_scope) when is_binary(sort_scope) do stripped_sort_text = item.sort_text @@ -95,7 +101,7 @@ defmodule Expert.CodeIntelligence.Completion.Builder do |> strip_sort_text() sort_text = "0#{sort_scope}_#{stripped_sort_text}" - %Completion.Item{item | sort_text: sort_text} + %CompletionItem{item | sort_text: sort_text} end # private @@ -176,10 +182,10 @@ defmodule Expert.CodeIntelligence.Completion.Builder do String.replace(sort_text, @sort_prefix_re, "") end - defp markdown_docs(%Completion.Item{} = item) do + defp markdown_docs(%CompletionItem{} = item) do case item.documentation do doc when is_binary(doc) -> - %{item | documentation: %Content{kind: :markdown, value: doc}} + %{item | documentation: %MarkupContent{kind: MarkupKind.markdown(), value: doc}} _ -> item diff --git a/apps/expert/lib/expert/code_intelligence/completion/translatable.ex b/apps/expert/lib/expert/code_intelligence/completion/translatable.ex index 1f647b39..6fcaa32f 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translatable.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translatable.ex @@ -1,11 +1,11 @@ defprotocol Expert.CodeIntelligence.Completion.Translatable do + alias GenLSP.Structures.CompletionItem alias Forge.Ast.Env - alias Expert.Protocol.Types.Completion alias Expert.CodeIntelligence.Completion.Builder @type t :: any() - @type translated :: [Completion.Item.t()] | Completion.Item.t() | :skip + @type translated :: [CompletionItem.t()] | CompletionItem.t() | :skip @fallback_to_any true @spec translate(t, Builder.t(), Env.t()) :: translated diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/bitstring_option.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/bitstring_option.ex index f055cb67..e8b1d162 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/bitstring_option.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/bitstring_option.ex @@ -4,6 +4,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOption do alias Expert.CodeIntelligence.Completion.Translatable alias Expert.CodeIntelligence.Completion.Translations alias Forge.Ast.Env + alias GenLSP.Enumerations.CompletionItemKind require Logger @@ -17,7 +18,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOption do env |> builder.plain_text(option.name, filter_text: option.name, - kind: :unit, + kind: CompletionItemKind.unit(), label: option.name ) |> builder.set_sort_scope(SortScope.global()) diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/callable.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/callable.ex index dea684ee..0eb2e190 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/callable.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/callable.ex @@ -3,6 +3,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callable do alias Expert.CodeIntelligence.Completion.Builder alias Expert.CodeIntelligence.Completion.SortScope alias Forge.Ast.Env + alias GenLSP.Enumerations.CompletionItemKind @callables [Candidate.Function, Candidate.Macro, Candidate.Callback, Candidate.Typespec] @@ -49,10 +50,10 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callable do kind = case callable do %Candidate.Typespec{} -> - :type_parameter + CompletionItemKind.type_parameter() _ -> - :function + CompletionItemKind.function() end detail = @@ -83,7 +84,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callable do env |> Builder.plain_text(name_and_arity, label: name_and_arity, - kind: :function, + kind: CompletionItemKind.function(), detail: "(Capture)", sort_text: sort_text(callable), filter_text: "#{callable.name}", @@ -95,7 +96,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callable do env |> Builder.snippet(callable_snippet(callable, env), label: label(callable, env), - kind: :function, + kind: CompletionItemKind.function(), detail: "(Capture with arguments)", sort_text: sort_text(callable), filter_text: "#{callable.name}", diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/callback.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/callback.ex index 24129e98..384cfc07 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/callback.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/callback.ex @@ -5,6 +5,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callback do alias Expert.CodeIntelligence.Completion.Translatable alias Forge.Ast.Env alias Forge.Document + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Callback do def translate(callback, _builder, %Env{} = env) do @@ -21,7 +22,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Callback do insert_text(name, arg_names, env), line_range(line), label: label(name, arg_names), - kind: :interface, + kind: CompletionItemKind.interface(), detail: detail(callback), sort_text: sort_text(callback), filter_text: "def #{name}", diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/macro.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/macro.ex index fb3ece92..2723ead4 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/macro.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/macro.ex @@ -9,6 +9,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do alias Forge.Ast.Env alias Forge.Document alias Forge.Document.Position + alias GenLSP.Enumerations.CompletionItemKind @snippet_macros ~w(def defp defmacro defmacrop defimpl defmodule defprotocol defguard defguardp defexception test use) @unhelpful_macros ~w(:: alias! in and or destructure) @@ -45,7 +46,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -64,7 +65,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -83,7 +84,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -102,7 +103,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -121,7 +122,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -136,7 +137,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -151,7 +152,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -166,7 +167,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -181,7 +182,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -196,7 +197,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -211,7 +212,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -226,7 +227,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -239,7 +240,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: "use" ) @@ -254,7 +255,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -273,7 +274,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -292,7 +293,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -311,7 +312,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -330,7 +331,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -349,7 +350,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -368,7 +369,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -383,7 +384,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -402,7 +403,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -422,7 +423,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -441,7 +442,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) @@ -460,7 +461,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(stub_snippet, detail: "A stub test", - kind: :class, + kind: CompletionItemKind.class(), label: stub_label, filter_text: "test" ) @@ -479,7 +480,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(plain_snippet, detail: "A test", - kind: :class, + kind: CompletionItemKind.class(), label: plain_label, filter_text: "test" ) @@ -498,7 +499,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(context_snippet, detail: "A test that receives context", - kind: :class, + kind: CompletionItemKind.class(), label: context_label, filter_text: "test" ) @@ -515,7 +516,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: "A describe block", - kind: :class, + kind: CompletionItemKind.class(), label: ~S(describe "message"), filter_text: "describe" ) @@ -529,7 +530,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.plain_text("__MODULE__", detail: macro.spec, - kind: :constant, + kind: CompletionItemKind.constant(), label: "__MODULE__", filter_text: "__MODULE__" ) @@ -542,7 +543,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.plain_text(dunder_form, detail: macro.spec, - kind: :constant, + kind: CompletionItemKind.constant(), label: dunder_form, filter_text: dunder_form ) @@ -605,7 +606,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Macro do env |> builder.snippet(snippet, detail: macro.spec, - kind: :class, + kind: CompletionItemKind.class(), label: label, filter_text: macro.name ) diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/map_field.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/map_field.ex index 840ac4c4..b00ada08 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/map_field.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/map_field.ex @@ -2,13 +2,14 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MapField do alias Engine.Completion.Candidate alias Expert.CodeIntelligence.Completion.Translatable alias Forge.Ast.Env + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Candidate.MapField do def translate(%Candidate.MapField{} = map_field, builder, %Env{} = env) do builder.text_edit(env, map_field.name, range(env), detail: map_field.name, label: map_field.name, - kind: :field + kind: CompletionItemKind.field() ) end diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/module_attribute.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/module_attribute.ex index 02dfea2a..e80a052d 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/module_attribute.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/module_attribute.ex @@ -6,6 +6,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do alias Forge.Ast alias Forge.Ast.Env alias Forge.Document.Position + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Candidate.ModuleAttribute do def translate(attribute, builder, %Env{} = env) do @@ -25,14 +26,14 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do with_doc = builder.text_edit_snippet(env, doc_snippet, range, detail: "Document public module", - kind: :property, + kind: CompletionItemKind.property(), label: "@moduledoc" ) without_doc = builder.text_edit(env, "@moduledoc false", range, detail: "Mark as private", - kind: :property, + kind: CompletionItemKind.property(), label: "@moduledoc false" ) @@ -55,14 +56,14 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do with_doc = builder.text_edit_snippet(env, doc_snippet, range, detail: "Document public function", - kind: :property, + kind: CompletionItemKind.property(), label: "@doc" ) without_doc = builder.text_edit(env, "@doc false", range, detail: "Mark as private", - kind: :property, + kind: CompletionItemKind.property(), label: "@doc false" ) @@ -91,7 +92,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do {:ok, range} -> builder.text_edit(env, attribute.name, range, detail: "module attribute", - kind: :constant, + kind: CompletionItemKind.constant(), label: attribute.name ) @@ -153,7 +154,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do env |> builder.text_edit_snippet(snippet, range, detail: "Typespec", - kind: :property, + kind: CompletionItemKind.property(), label: "@spec #{name}" ) |> builder.set_sort_scope(SortScope.global(false, 0)) @@ -170,7 +171,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttribute do env |> builder.text_edit_snippet(snippet, range, detail: "Typespec", - kind: :property, + kind: CompletionItemKind.property(), label: "@spec" ) |> builder.set_sort_scope(SortScope.global(false, 1)) diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/module_or_behaviour.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/module_or_behaviour.ex index e9f4e2e6..0d25eda9 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/module_or_behaviour.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/module_or_behaviour.ex @@ -5,6 +5,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviour do alias Expert.CodeIntelligence.Completion.Translations alias Expert.Project.Intelligence alias Forge.Ast.Env + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Candidate.Module do def translate(module, builder, %Env{} = env) do @@ -109,7 +110,11 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviour do detail = builder.fallback(detail, "#{module_name} (Module)") env - |> builder.plain_text(module_name, label: module_name, kind: :module, detail: detail) + |> builder.plain_text(module_name, + label: module_name, + kind: CompletionItemKind.module(), + detail: detail + ) |> builder.set_sort_scope(SortScope.module()) end diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/struct.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/struct.ex index c55ed405..04c8ecd0 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/struct.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/struct.ex @@ -2,6 +2,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Struct do alias Forge.Ast.Env alias Forge.Formats alias Future.Code, as: Code + alias GenLSP.Enumerations.CompletionItemKind def completion(%Env{} = _env, _builder, _module_name, _full_name, 0) do nil @@ -12,7 +13,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Struct do plural = "${count} more structs" builder_opts = [ - kind: :module, + kind: CompletionItemKind.module(), label: "#{module_name}...(#{Formats.plural(more, singular, plural)})", detail: "#{full_name}." ] @@ -25,7 +26,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Struct do def completion(%Env{} = env, builder, struct_name, full_name) do builder_opts = [ - kind: :struct, + kind: CompletionItemKind.struct(), detail: "#{full_name}", label: "#{struct_name}" ] diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/struct_field.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/struct_field.ex index 52403125..f8063bb9 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/struct_field.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/struct_field.ex @@ -5,6 +5,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructField do alias Expert.CodeIntelligence.Completion.Translations alias Forge.Ast.Env alias Future.Code, as: Code + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Candidate.StructField do def translate(field, builder, %Env{} = env) do @@ -21,7 +22,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructField do value = to_string(name) builder_opts = [ - kind: :field, + kind: CompletionItemKind.field(), label: "#{name}: #{value}", filter_text: "#{name}:" ] @@ -38,7 +39,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructField do builder.plain_text(env, struct_field.name, detail: struct_field.type_spec, label: struct_field.name, - kind: :field + kind: CompletionItemKind.field() ) end diff --git a/apps/expert/lib/expert/code_intelligence/completion/translations/variable.ex b/apps/expert/lib/expert/code_intelligence/completion/translations/variable.ex index c19c5cca..5c5f7f3a 100644 --- a/apps/expert/lib/expert/code_intelligence/completion/translations/variable.ex +++ b/apps/expert/lib/expert/code_intelligence/completion/translations/variable.ex @@ -3,13 +3,14 @@ defmodule Expert.CodeIntelligence.Completion.Translations.Variable do alias Expert.CodeIntelligence.Completion.SortScope alias Expert.CodeIntelligence.Completion.Translatable alias Forge.Ast.Env + alias GenLSP.Enumerations.CompletionItemKind defimpl Translatable, for: Candidate.Variable do def translate(variable, builder, %Env{} = env) do env |> builder.plain_text(variable.name, detail: variable.name, - kind: :variable, + kind: CompletionItemKind.variable(), label: variable.name ) |> builder.set_sort_scope(SortScope.variable()) diff --git a/apps/expert/lib/expert/configuration.ex b/apps/expert/lib/expert/configuration.ex index a31c256f..38961642 100644 --- a/apps/expert/lib/expert/configuration.ex +++ b/apps/expert/lib/expert/configuration.ex @@ -5,13 +5,11 @@ defmodule Expert.Configuration do alias Expert.Configuration.Support alias Expert.Dialyzer - alias Expert.Protocol.Id - alias Expert.Protocol.Notifications.DidChangeConfiguration - alias Expert.Protocol.Requests - alias Expert.Protocol.Requests.RegisterCapability - alias Expert.Protocol.Types.ClientCapabilities - alias Expert.Protocol.Types.Registration alias Forge.Project + alias Forge.Protocol.Id + alias GenLSP.Notifications.WorkspaceDidChangeConfiguration + alias GenLSP.Requests + alias GenLSP.Structures defstruct project: nil, support: nil, @@ -32,7 +30,7 @@ defmodule Expert.Configuration do @dialyzer {:nowarn_function, set_dialyzer_enabled: 2} @spec new(Forge.uri(), map(), String.t() | nil) :: t - def new(root_uri, %ClientCapabilities{} = client_capabilities, client_name) do + def new(root_uri, %Structures.ClientCapabilities{} = client_capabilities, client_name) do support = Support.new(client_capabilities) project = Project.new(root_uri) @@ -68,7 +66,7 @@ defmodule Expert.Configuration do @spec default(t | nil) :: {:ok, t} - | {:ok, t, Requests.RegisterCapability.t()} + | {:ok, t, Requests.ClientRegisterCapability.t()} def default(nil) do {:ok, default_config()} end @@ -77,15 +75,15 @@ defmodule Expert.Configuration do apply_config_change(config, default_config()) end - @spec on_change(t, DidChangeConfiguration.t()) :: + @spec on_change(t, WorkspaceDidChangeConfiguration.t()) :: {:ok, t} - | {:ok, t, Requests.RegisterCapability.t()} + | {:ok, t, Requests.ClientRegisterCapability.t()} def on_change(%__MODULE__{} = old_config, :defaults) do apply_config_change(old_config, default_config()) end - def on_change(%__MODULE__{} = old_config, %DidChangeConfiguration{} = change) do - apply_config_change(old_config, change.lsp.settings) + def on_change(%__MODULE__{} = old_config, %WorkspaceDidChangeConfiguration{} = change) do + apply_config_change(old_config, change.params.settings) end defp default_config do @@ -125,13 +123,16 @@ defmodule Expert.Configuration do watchers = Enum.map(extensions, fn ext -> %{"globPattern" => "**/*#{ext}"} end) registration = - Registration.new( + %Structures.Registration{ id: request_id, method: "workspace/didChangeWatchedFiles", register_options: %{"watchers" => watchers} - ) + } - request = RegisterCapability.new(id: register_id, registrations: [registration]) + request = %Requests.ClientRegisterCapability{ + id: register_id, + params: %Structures.RegistrationParams{registrations: [registration]} + } {:ok, old_config, request} end diff --git a/apps/expert/lib/expert/configuration/support.ex b/apps/expert/lib/expert/configuration/support.ex index 53735c3f..6c0a3e84 100644 --- a/apps/expert/lib/expert/configuration/support.ex +++ b/apps/expert/lib/expert/configuration/support.ex @@ -1,10 +1,10 @@ defmodule Expert.Configuration.Support do @moduledoc false - alias Expert.Protocol.Types.ClientCapabilities + alias GenLSP.Structures.ClientCapabilities # To track a new client capability, add a new field and the path to the - # capability in the `Expert.Protocol.Types.ClientCapabilities` struct + # capability in the `GenLSP.Structures.ClientCapabilities` struct # to this mapping: @client_capability_mapping [ code_action_dynamic_registration: [ @@ -58,7 +58,8 @@ defmodule Expert.Configuration.Support do def new(%ClientCapabilities{} = client_capabilities) do defaults = for {key, path} <- @client_capability_mapping do - value = get_in(client_capabilities, path) || false + path = Enum.map(path, &Access.key/1) + value = get_in(Map.from_struct(client_capabilities), path) || false {key, value} end diff --git a/apps/expert/lib/expert/iex/helpers.ex b/apps/expert/lib/expert/iex/helpers.ex index e31c2931..92dfe17b 100644 --- a/apps/expert/lib/expert/iex/helpers.ex +++ b/apps/expert/lib/expert/iex/helpers.ex @@ -1,11 +1,12 @@ defmodule Expert.IEx.Helpers do alias Engine.Search alias Expert.CodeIntelligence - alias Expert.Protocol.Types.Completion alias Forge.Ast alias Forge.Document alias Forge.Document.Position alias Forge.Project + alias GenLSP.Enumerations.CompletionTriggerKind + alias GenLSP.Structures defmacro __using__(_) do quote do @@ -112,7 +113,7 @@ defmodule Expert.IEx.Helpers do def complete(project, %Ast.Analysis{} = analysis, line, character, context) do context = if is_nil(context) do - Completion.Context.new(trigger_kind: :trigger_character) + %Structures.CompletionContext{trigger_kind: CompletionTriggerKind.trigger_character()} else context end diff --git a/apps/expert/lib/expert/project/diagnostics.ex b/apps/expert/lib/expert/project/diagnostics.ex index dd6f00e8..251abfea 100644 --- a/apps/expert/lib/expert/project/diagnostics.ex +++ b/apps/expert/lib/expert/project/diagnostics.ex @@ -1,10 +1,11 @@ defmodule Expert.Project.Diagnostics do alias Engine.Api.Messages alias Expert.Project.Diagnostics.State - alias Expert.Protocol.Notifications.PublishDiagnostics alias Expert.Transport alias Forge.Formats alias Forge.Project + alias GenLSP.Notifications.TextDocumentPublishDiagnostics + alias GenLSP.Structures import Messages require Logger @@ -94,7 +95,10 @@ defmodule Expert.Project.Diagnostics do defp publish_diagnostics(%State{} = state) do Enum.each(state.entries_by_uri, fn {uri, %State.Entry{} = entry} -> diagnostics_list = State.Entry.diagnostics(entry) - notification = PublishDiagnostics.new(uri: uri, diagnostics: diagnostics_list) + + notification = %TextDocumentPublishDiagnostics{ + params: %Structures.PublishDiagnosticsParams{uri: uri, diagnostics: diagnostics_list} + } Transport.write(notification) end) diff --git a/apps/expert/lib/expert/project/progress/percentage.ex b/apps/expert/lib/expert/project/progress/percentage.ex index 61da3ce7..47130e4d 100644 --- a/apps/expert/lib/expert/project/progress/percentage.ex +++ b/apps/expert/lib/expert/project/progress/percentage.ex @@ -2,9 +2,9 @@ defmodule Expert.Project.Progress.Percentage do @moduledoc """ The backing data structure for percentage based progress reports """ - alias Expert.Protocol.Notifications - alias Expert.Protocol.Types.WorkDone alias Forge.Math + alias GenLSP.Notifications + alias GenLSP.Structures @enforce_keys [:token, :kind, :max] defstruct [:token, :kind, :title, :message, :max, current: 0] @@ -35,10 +35,12 @@ defmodule Expert.Project.Progress.Percentage do end def to_protocol(%__MODULE__{kind: :begin} = value) do - Notifications.Progress.new( - token: value.token, - value: WorkDone.Progress.Begin.new(kind: "begin", title: value.title, percentage: 0) - ) + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressBegin{kind: "begin", title: value.title, percentage: 0} + } + } end def to_protocol(%__MODULE__{kind: :report} = value) do @@ -47,21 +49,24 @@ defmodule Expert.Project.Progress.Percentage do |> round() |> Math.clamp(0, 100) - Notifications.Progress.new( - token: value.token, - value: - WorkDone.Progress.Report.new( + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressReport{ kind: "report", message: value.message, percentage: percent_complete - ) - ) + } + } + } end def to_protocol(%__MODULE__{kind: :end} = value) do - Notifications.Progress.new( - token: value.token, - value: WorkDone.Progress.End.new(kind: "end", message: value.message) - ) + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressEnd{kind: "end", message: value.message} + } + } end end diff --git a/apps/expert/lib/expert/project/progress/state.ex b/apps/expert/lib/expert/project/progress/state.ex index c6d96cca..da450326 100644 --- a/apps/expert/lib/expert/project/progress/state.ex +++ b/apps/expert/lib/expert/project/progress/state.ex @@ -2,10 +2,11 @@ defmodule Expert.Project.Progress.State do alias Expert.Configuration alias Expert.Project.Progress.Percentage alias Expert.Project.Progress.Value - alias Expert.Protocol.Id - alias Expert.Protocol.Requests alias Expert.Transport alias Forge.Project + alias Forge.Protocol.Id + alias GenLSP.Requests + alias GenLSP.Structures import Engine.Api.Messages @@ -91,7 +92,11 @@ defmodule Expert.Project.Progress.State do defp write_work_done(token) do if Configuration.client_supports?(:work_done_progress) do - progress = Requests.CreateWorkDoneProgress.new(id: Id.next(), token: token) + progress = %Requests.WindowWorkDoneProgressCreate{ + id: Id.next(), + params: %Structures.WorkDoneProgressCreateParams{token: token} + } + Transport.write(progress) end end diff --git a/apps/expert/lib/expert/project/progress/value.ex b/apps/expert/lib/expert/project/progress/value.ex index c4a18b28..59f3ae3c 100644 --- a/apps/expert/lib/expert/project/progress/value.ex +++ b/apps/expert/lib/expert/project/progress/value.ex @@ -1,6 +1,6 @@ defmodule Expert.Project.Progress.Value do - alias Expert.Protocol.Notifications - alias Expert.Protocol.Types.WorkDone + alias GenLSP.Notifications + alias GenLSP.Structures @enforce_keys [:token, :kind] defstruct [:token, :kind, :title, :message] @@ -23,23 +23,29 @@ defmodule Expert.Project.Progress.Value do end def to_protocol(%__MODULE__{kind: :begin} = value) do - Notifications.Progress.new( - token: value.token, - value: WorkDone.Progress.Begin.new(kind: "begin", title: value.title) - ) + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressBegin{kind: "begin", title: value.title} + } + } end def to_protocol(%__MODULE__{kind: :report} = value) do - Notifications.Progress.new( - token: value.token, - value: WorkDone.Progress.Report.new(kind: "report", message: value.message) - ) + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressReport{kind: "report", message: value.message} + } + } end def to_protocol(%__MODULE__{kind: :end} = value) do - Notifications.Progress.new( - token: value.token, - value: WorkDone.Progress.End.new(kind: "end", message: value.message) - ) + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{ + token: value.token, + value: %Structures.WorkDoneProgressEnd{kind: "end", message: value.message} + } + } end end diff --git a/apps/expert/lib/expert/project/search_listener.ex b/apps/expert/lib/expert/project/search_listener.ex index f069b9da..afa347db 100644 --- a/apps/expert/lib/expert/project/search_listener.ex +++ b/apps/expert/lib/expert/project/search_listener.ex @@ -1,10 +1,10 @@ defmodule Expert.Project.SearchListener do alias Engine.Api - alias Expert.Protocol.Id - alias Expert.Protocol.Requests alias Expert.Window alias Forge.Formats alias Forge.Project + alias Forge.Protocol.Id + alias GenLSP.Requests import Api.Messages @@ -48,7 +48,7 @@ defmodule Expert.Project.SearchListener do end defp send_code_lens_refresh do - request = Requests.CodeLensRefresh.new(id: Id.next()) + request = %Requests.WorkspaceCodeLensRefresh{id: Id.next()} Expert.server_request(request) end end diff --git a/apps/expert/lib/expert/provider/handlers/code_action.ex b/apps/expert/lib/expert/provider/handlers/code_action.ex index 0731511a..be0c637b 100644 --- a/apps/expert/lib/expert/provider/handlers/code_action.ex +++ b/apps/expert/lib/expert/provider/handlers/code_action.ex @@ -1,42 +1,47 @@ defmodule Expert.Provider.Handlers.CodeAction do - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses - alias Expert.Protocol.Types - alias Expert.Protocol.Types.Workspace - alias Engine.CodeAction alias Expert.Configuration - - require Logger - - def handle(%Requests.CodeAction{} = request, %Configuration{} = config) do - diagnostics = Enum.map(request.context.diagnostics, &to_code_action_diagnostic/1) + alias Forge.Protocol.Response + alias GenLSP.Requests + alias GenLSP.Structures + + def handle( + %Requests.TextDocumentCodeAction{params: %Structures.CodeActionParams{} = params} = + request, + %Configuration{} = config + ) do + document = Forge.Document.Container.context_document(params, nil) + diagnostics = Enum.map(params.context.diagnostics, &to_code_action_diagnostic/1) code_actions = Engine.Api.code_actions( config.project, - request.document, - request.range, + document, + params.range, diagnostics, - request.context.only || :all, - request.context.trigger_kind + params.context.only || :all, + params.context.trigger_kind ) results = Enum.map(code_actions, &to_result/1) - reply = Responses.CodeAction.new(request.id, results) + reply = %Response{id: request.id, result: results} {:reply, reply} end - defp to_code_action_diagnostic(%Types.Diagnostic{} = diagnostic) do - CodeAction.Diagnostic.new(diagnostic.range, diagnostic.message, diagnostic.source) + defp to_code_action_diagnostic(%Structures.Diagnostic{} = diagnostic) do + %Structures.Diagnostic{ + range: diagnostic.range, + message: diagnostic.message, + source: diagnostic.source + } end defp to_result(%CodeAction{} = action) do - Types.CodeAction.new( + %Structures.CodeAction{ title: action.title, kind: action.kind, - edit: Workspace.Edit.new(changes: %{action.uri => action.changes}) - ) + edit: %Structures.WorkspaceEdit{changes: %{action.uri => action.changes}} + } end end diff --git a/apps/expert/lib/expert/provider/handlers/code_lens.ex b/apps/expert/lib/expert/provider/handlers/code_lens.ex index f8c7ae07..38650e8f 100644 --- a/apps/expert/lib/expert/provider/handlers/code_lens.ex +++ b/apps/expert/lib/expert/provider/handlers/code_lens.ex @@ -1,25 +1,30 @@ defmodule Expert.Provider.Handlers.CodeLens do alias Expert.Configuration - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses - alias Expert.Protocol.Types.CodeLens alias Expert.Provider.Handlers alias Forge.Document alias Forge.Document.Position alias Forge.Document.Range alias Forge.Project + alias Forge.Protocol.Response + alias GenLSP.Requests + alias GenLSP.Structures import Document.Line require Logger - def handle(%Requests.CodeLens{} = request, %Configuration{} = config) do + def handle( + %Requests.TextDocumentCodeLens{params: %Structures.CodeLensParams{} = params} = request, + %Configuration{} = config + ) do + document = Document.Container.context_document(params, nil) + lenses = - case reindex_lens(config.project, request.document) do + case reindex_lens(config.project, document) do nil -> [] lens -> List.wrap(lens) end - response = Responses.CodeLens.new(request.id, lenses) + response = %Response{id: request.id, result: lenses} {:reply, response} end @@ -28,7 +33,7 @@ defmodule Expert.Provider.Handlers.CodeLens do range = def_project_range(document) command = Handlers.Commands.reindex_command(project) - CodeLens.new(command: command, range: range) + %Structures.CodeLens{command: command, range: range} end end diff --git a/apps/expert/lib/expert/provider/handlers/commands.ex b/apps/expert/lib/expert/provider/handlers/commands.ex index eac449b7..8e37c3ba 100644 --- a/apps/expert/lib/expert/provider/handlers/commands.ex +++ b/apps/expert/lib/expert/provider/handlers/commands.ex @@ -1,13 +1,13 @@ defmodule Expert.Provider.Handlers.Commands do alias Expert.Configuration - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses - alias Expert.Protocol.Types - alias Expert.Protocol.Types.ErrorCodes alias Expert.Window alias Forge.Project + alias Forge.Protocol.ErrorResponse + alias Forge.Protocol.Response + alias GenLSP.Enumerations.ErrorCodes + alias GenLSP.Requests + alias GenLSP.Structures - require ErrorCodes require Logger @reindex_name "Reindex" @@ -19,15 +19,19 @@ defmodule Expert.Provider.Handlers.Commands do def reindex_command(%Project{} = project) do project_name = Project.name(project) - Types.Command.new( + %Structures.Command{ title: "Rebuild #{project_name}'s code search index", command: @reindex_name - ) + } end - def handle(%Requests.ExecuteCommand{} = request, %Configuration{} = config) do + def handle( + %Requests.WorkspaceExecuteCommand{params: %Structures.ExecuteCommandParams{} = params} = + request, + %Configuration{} = config + ) do response = - case request.command do + case params.command do @reindex_name -> Logger.info("Reindex #{Project.name(config.project)}") reindex(config.project, request.id) @@ -43,7 +47,7 @@ defmodule Expert.Provider.Handlers.Commands do defp reindex(%Project{} = project, request_id) do case Engine.Api.reindex(project) do :ok -> - Responses.ExecuteCommand.new(request_id, "ok") + %Response{id: request_id, result: "ok"} error -> Window.show_error_message("Indexing #{Project.name(project)} failed") @@ -54,6 +58,9 @@ defmodule Expert.Provider.Handlers.Commands do end defp internal_error(request_id, message) do - Responses.ExecuteCommand.error(request_id, :internal_error, message) + %ErrorResponse{ + id: request_id, + error: %GenLSP.ErrorResponse{code: ErrorCodes.internal_error(), message: message} + } end end diff --git a/apps/expert/lib/expert/provider/handlers/completion.ex b/apps/expert/lib/expert/provider/handlers/completion.ex index 3e249270..b7d6402a 100644 --- a/apps/expert/lib/expert/provider/handlers/completion.ex +++ b/apps/expert/lib/expert/provider/handlers/completion.ex @@ -1,25 +1,34 @@ defmodule Expert.Provider.Handlers.Completion do alias Expert.CodeIntelligence alias Expert.Configuration - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses - alias Expert.Protocol.Types.Completion alias Forge.Ast alias Forge.Document alias Forge.Document.Position + alias Forge.Protocol.Response + alias GenLSP.Enumerations.CompletionTriggerKind + alias GenLSP.Requests + alias GenLSP.Structures + alias GenLSP.Structures.CompletionContext require Logger - def handle(%Requests.Completion{} = request, %Configuration{} = config) do + def handle( + %Requests.TextDocumentCompletion{ + params: %Structures.CompletionParams{} = params + } = request, + %Configuration{} = config + ) do + document = Document.Container.context_document(params, nil) + completions = CodeIntelligence.Completion.complete( config.project, - document_analysis(request.document, request.position), - request.position, - request.context || Completion.Context.new(trigger_kind: :invoked) + document_analysis(document, params.position), + params.position, + params.context || %CompletionContext{trigger_kind: CompletionTriggerKind.invoked()} ) - response = Responses.Completion.new(request.id, completions) + response = %Response{id: request.id, result: completions} {:reply, response} end diff --git a/apps/expert/lib/expert/provider/handlers/document_symbols.ex b/apps/expert/lib/expert/provider/handlers/document_symbols.ex index ba638709..ed2edd4f 100644 --- a/apps/expert/lib/expert/provider/handlers/document_symbols.ex +++ b/apps/expert/lib/expert/provider/handlers/document_symbols.ex @@ -2,21 +2,21 @@ defmodule Expert.Provider.Handlers.DocumentSymbols do alias Engine.Api alias Engine.CodeIntelligence.Symbols alias Expert.Configuration - alias Expert.Protocol.Requests.DocumentSymbols - alias Expert.Protocol.Responses - alias Expert.Protocol.Types.Document.Symbol - alias Expert.Protocol.Types.Symbol.Kind, as: SymbolKind alias Forge.Document + alias Forge.Protocol.Response + alias GenLSP.Enumerations.SymbolKind + alias GenLSP.Requests + alias GenLSP.Structures - require SymbolKind + def handle(%Requests.TextDocumentDocumentSymbol{} = request, %Configuration{} = config) do + document = Document.Container.context_document(request.params, nil) - def handle(%DocumentSymbols{} = request, %Configuration{} = config) do symbols = config.project - |> Api.document_symbols(request.document) - |> Enum.map(&to_response(&1, request.document)) + |> Api.document_symbols(document) + |> Enum.map(&to_response(&1, document)) - response = Responses.DocumentSymbols.new(request.id, symbols) + response = %Response{id: request.id, result: symbols} {:reply, response} end @@ -31,28 +31,28 @@ defmodule Expert.Provider.Handlers.DocumentSymbols do nil end - Symbol.new( + %Structures.DocumentSymbol{ children: children, detail: root.detail, kind: to_kind(root.type), name: root.name, range: root.range, selection_range: root.detail_range - ) + } end - defp to_kind(:struct), do: :struct - defp to_kind(:module), do: :module - defp to_kind(:variable), do: :variable - defp to_kind({:function, _}), do: :function - defp to_kind({:protocol, _}), do: :module - defp to_kind(:module_attribute), do: :constant - defp to_kind(:ex_unit_test), do: :method - defp to_kind(:ex_unit_describe), do: :method - defp to_kind(:ex_unit_setup), do: :method - defp to_kind(:ex_unit_setup_all), do: :method - defp to_kind(:type), do: :type_parameter - defp to_kind(:spec), do: :interface - defp to_kind(:file), do: :file - defp to_kind(_), do: :string + defp to_kind(:struct), do: SymbolKind.struct() + defp to_kind(:module), do: SymbolKind.module() + defp to_kind(:variable), do: SymbolKind.variable() + defp to_kind({:function, _}), do: SymbolKind.function() + defp to_kind({:protocol, _}), do: SymbolKind.module() + defp to_kind(:module_attribute), do: SymbolKind.constant() + defp to_kind(:ex_unit_test), do: SymbolKind.method() + defp to_kind(:ex_unit_describe), do: SymbolKind.method() + defp to_kind(:ex_unit_setup), do: SymbolKind.method() + defp to_kind(:ex_unit_setup_all), do: SymbolKind.method() + defp to_kind(:type), do: SymbolKind.type_parameter() + defp to_kind(:spec), do: SymbolKind.interface() + defp to_kind(:file), do: SymbolKind.file() + defp to_kind(_), do: SymbolKind.string() end diff --git a/apps/expert/lib/expert/provider/handlers/find_references.ex b/apps/expert/lib/expert/provider/handlers/find_references.ex index 21f37647..4f740247 100644 --- a/apps/expert/lib/expert/provider/handlers/find_references.ex +++ b/apps/expert/lib/expert/provider/handlers/find_references.ex @@ -1,26 +1,31 @@ defmodule Expert.Provider.Handlers.FindReferences do alias Engine.Api alias Expert.Configuration - alias Expert.Protocol.Requests.FindReferences - alias Expert.Protocol.Responses alias Forge.Ast alias Forge.Document + alias Forge.Protocol.Response + alias GenLSP.Requests.TextDocumentReferences + alias GenLSP.Structures require Logger - def handle(%FindReferences{} = request, %Configuration{} = config) do - include_declaration? = !!request.context.include_declaration + def handle( + %TextDocumentReferences{params: %Structures.ReferenceParams{} = params} = request, + %Configuration{} = config + ) do + document = Forge.Document.Container.context_document(params, nil) + include_declaration? = !!params.context.include_declaration locations = - case Document.Store.fetch(request.document.uri, :analysis) do + case Document.Store.fetch(document.uri, :analysis) do {:ok, _document, %Ast.Analysis{} = analysis} -> - Api.references(config.project, analysis, request.position, include_declaration?) + Api.references(config.project, analysis, params.position, include_declaration?) _ -> nil end - response = Responses.FindReferences.new(request.id, locations) + response = %Response{id: request.id, result: locations} {:reply, response} end end diff --git a/apps/expert/lib/expert/provider/handlers/formatting.ex b/apps/expert/lib/expert/provider/handlers/formatting.ex index 3d439835..1ce544de 100644 --- a/apps/expert/lib/expert/provider/handlers/formatting.ex +++ b/apps/expert/lib/expert/provider/handlers/formatting.ex @@ -1,23 +1,27 @@ defmodule Expert.Provider.Handlers.Formatting do alias Expert.Configuration - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses alias Forge.Document.Changes + alias Forge.Protocol.Response + alias GenLSP.Requests + alias GenLSP.Structures require Logger - def handle(%Requests.Formatting{} = request, %Configuration{} = config) do - document = request.document + def handle( + %Requests.TextDocumentFormatting{params: %Structures.DocumentFormattingParams{} = params} = + request, + %Configuration{} = config + ) do + document = Forge.Document.Container.context_document(params, nil) case Engine.Api.format(config.project, document) do {:ok, %Changes{} = document_edits} -> - response = Responses.Formatting.new(request.id, document_edits) - Logger.info("Response #{inspect(response)}") + response = %Response{id: request.id, result: document_edits} {:reply, response} {:error, reason} -> Logger.error("Formatter failed #{inspect(reason)}") - {:reply, Responses.Formatting.new(request.id, nil)} + {:reply, %Response{id: request.id, result: nil}} end end end diff --git a/apps/expert/lib/expert/provider/handlers/go_to_definition.ex b/apps/expert/lib/expert/provider/handlers/go_to_definition.ex index 130500dd..963f9d51 100644 --- a/apps/expert/lib/expert/provider/handlers/go_to_definition.ex +++ b/apps/expert/lib/expert/provider/handlers/go_to_definition.ex @@ -1,19 +1,26 @@ defmodule Expert.Provider.Handlers.GoToDefinition do - alias Expert.Protocol.Requests.GoToDefinition - alias Expert.Protocol.Responses - alias Expert.Configuration + alias Forge.Protocol.Response + alias GenLSP.Requests + alias GenLSP.Structures require Logger - def handle(%GoToDefinition{} = request, %Configuration{} = config) do - case Engine.Api.definition(config.project, request.document, request.position) do + def handle( + %Requests.TextDocumentDefinition{ + params: %Structures.DefinitionParams{} = params + } = request, + %Configuration{} = config + ) do + document = Forge.Document.Container.context_document(params, nil) + + case Engine.Api.definition(config.project, document, params.position) do {:ok, native_location} -> - {:reply, Responses.GoToDefinition.new(request.id, native_location)} + {:reply, %Response{id: request.id, result: native_location}} {:error, reason} -> Logger.error("GoToDefinition failed: #{inspect(reason)}") - {:reply, Responses.GoToDefinition.new(request.id, nil)} + {:reply, %Response{id: request.id, result: nil}} end end end diff --git a/apps/expert/lib/expert/provider/handlers/hover.ex b/apps/expert/lib/expert/provider/handlers/hover.ex index 17a0fe50..0d040ee6 100644 --- a/apps/expert/lib/expert/provider/handlers/hover.ex +++ b/apps/expert/lib/expert/provider/handlers/hover.ex @@ -1,33 +1,40 @@ defmodule Expert.Provider.Handlers.Hover do alias Engine.CodeIntelligence.Docs alias Expert.Configuration - alias Expert.Protocol.Requests - alias Expert.Protocol.Responses - alias Expert.Protocol.Types.Hover alias Expert.Provider.Markdown alias Forge.Ast alias Forge.Ast.Analysis alias Forge.Document alias Forge.Document.Position alias Forge.Project + alias Forge.Protocol.Response + alias GenLSP.Requests + alias GenLSP.Structures require Logger - def handle(%Requests.Hover{} = request, %Configuration{} = config) do + def handle( + %Requests.TextDocumentHover{ + params: %Structures.HoverParams{} = params + } = request, + %Configuration{} = config + ) do + document = Document.Container.context_document(params, nil) + maybe_hover = with {:ok, _document, %Ast.Analysis{} = analysis} <- - Document.Store.fetch(request.document.uri, :analysis), - {:ok, entity, range} <- resolve_entity(config.project, analysis, request.position), + Document.Store.fetch(document.uri, :analysis), + {:ok, entity, range} <- resolve_entity(config.project, analysis, params.position), {:ok, markdown} <- hover_content(entity, config.project) do content = Markdown.to_content(markdown) - %Hover{contents: content, range: range} + %Structures.Hover{contents: content, range: range} else error -> Logger.warning("Could not resolve hover request, got: #{inspect(error)}") nil end - {:reply, Responses.Hover.new(request.id, maybe_hover)} + {:reply, %Response{id: request.id, result: maybe_hover}} end defp resolve_entity(%Project{} = project, %Analysis{} = analysis, %Position{} = position) do diff --git a/apps/expert/lib/expert/provider/handlers/workspace_symbol.ex b/apps/expert/lib/expert/provider/handlers/workspace_symbol.ex index b996484a..d2fb4a3e 100644 --- a/apps/expert/lib/expert/provider/handlers/workspace_symbol.ex +++ b/apps/expert/lib/expert/provider/handlers/workspace_symbol.ex @@ -2,56 +2,59 @@ defmodule Expert.Provider.Handlers.WorkspaceSymbol do alias Engine.Api alias Engine.CodeIntelligence.Symbols alias Expert.Configuration - alias Expert.Protocol.Requests.WorkspaceSymbol - alias Expert.Protocol.Responses - alias Expert.Protocol.Types.Location - alias Expert.Protocol.Types.Symbol.Kind, as: SymbolKind - alias Expert.Protocol.Types.Workspace.Symbol - - require SymbolKind + alias Forge.Protocol.Response + alias GenLSP.Enumerations.SymbolKind + alias GenLSP.Requests + alias GenLSP.Structures require Logger - def handle(%WorkspaceSymbol{} = request, %Configuration{} = config) do + def handle( + %Requests.WorkspaceSymbol{params: %Structures.WorkspaceSymbolParams{} = params} = request, + %Configuration{} = config + ) do symbols = - if String.length(request.query) > 1 do + if String.length(params.query) > 1 do config.project - |> Api.workspace_symbols(request.query) + |> Api.workspace_symbols(params.query) |> tap(fn symbols -> Logger.info("syms #{inspect(Enum.take(symbols, 5))}") end) |> Enum.map(&to_response/1) else [] end - response = Responses.WorkspaceSymbol.new(request.id, symbols) + response = %Response{id: request.id, result: symbols} + + Logger.info("WorkspaceSymbol results: #{inspect(response, pretty: true)}") + {:reply, response} end def to_response(%Symbols.Workspace{} = root) do - Symbol.new( + %Structures.WorkspaceSymbol{ kind: to_kind(root.type), location: to_location(root.link), name: root.name, container_name: root.container_name - ) + } end defp to_location(%Symbols.Workspace.Link{} = link) do - Location.new(uri: link.uri, range: link.detail_range) + %Structures.Location{uri: link.uri, range: link.detail_range} end - defp to_kind(:struct), do: :struct - defp to_kind(:module), do: :module - defp to_kind({:protocol, _}), do: :module - defp to_kind({:xp_protocol, _}), do: :module - defp to_kind(:variable), do: :variable - defp to_kind({:function, _}), do: :function - defp to_kind(:module_attribute), do: :constant - defp to_kind(:ex_unit_test), do: :method - defp to_kind(:ex_unit_describe), do: :method - defp to_kind(:ex_unit_setup), do: :method - defp to_kind(:ex_unit_setup_all), do: :method - defp to_kind(:type), do: :type_parameter - defp to_kind(:spec), do: :interface - defp to_kind(:file), do: :file + defp to_kind(:struct), do: SymbolKind.struct() + defp to_kind(:module), do: SymbolKind.module() + defp to_kind({:protocol, _}), do: SymbolKind.module() + defp to_kind({:xp_protocol, _}), do: SymbolKind.module() + defp to_kind(:variable), do: SymbolKind.variable() + defp to_kind({:function, _}), do: SymbolKind.function() + defp to_kind(:module_attribute), do: SymbolKind.constant() + defp to_kind(:ex_unit_test), do: SymbolKind.method() + defp to_kind(:ex_unit_describe), do: SymbolKind.method() + defp to_kind(:ex_unit_setup), do: SymbolKind.method() + defp to_kind(:ex_unit_setup_all), do: SymbolKind.method() + defp to_kind(:type), do: SymbolKind.type_parameter() + defp to_kind(:spec), do: SymbolKind.interface() + defp to_kind(:file), do: SymbolKind.file() end diff --git a/apps/expert/lib/expert/provider/markdown.ex b/apps/expert/lib/expert/provider/markdown.ex index a3b4d96f..7da4de9b 100644 --- a/apps/expert/lib/expert/provider/markdown.ex +++ b/apps/expert/lib/expert/provider/markdown.ex @@ -3,16 +3,17 @@ defmodule Expert.Provider.Markdown do Utilities for formatting Markdown content. """ - alias Expert.Protocol.Types.Markup + alias GenLSP.Enumerations + alias GenLSP.Structures.MarkupContent @type markdown :: String.t() @doc """ Converts a string of Markdown into LSP markup content. """ - @spec to_content(markdown) :: Markup.Content.t() + @spec to_content(markdown) :: MarkupContent.t() def to_content(markdown) when is_binary(markdown) do - %Markup.Content{kind: :markdown, value: markdown} + %MarkupContent{kind: Enumerations.MarkupKind.markdown(), value: markdown} end @doc """ diff --git a/apps/expert/lib/expert/state.ex b/apps/expert/lib/expert/state.ex index 9de5ee12..ca3926f6 100644 --- a/apps/expert/lib/expert/state.ex +++ b/apps/expert/lib/expert/state.ex @@ -1,28 +1,4 @@ defmodule Expert.State do - alias Expert.Protocol.Id - alias Expert.Protocol.Notifications - alias Expert.Protocol.Notifications.DidChange - alias Expert.Protocol.Notifications.DidChangeConfiguration - alias Expert.Protocol.Notifications.DidClose - alias Expert.Protocol.Notifications.DidOpen - alias Expert.Protocol.Notifications.DidSave - alias Expert.Protocol.Notifications.Exit - alias Expert.Protocol.Notifications.Initialized - alias Expert.Protocol.Requests.Initialize - alias Expert.Protocol.Requests.RegisterCapability - alias Expert.Protocol.Requests.Shutdown - alias Expert.Protocol.Responses - alias Expert.Protocol.Types - alias Expert.Protocol.Types.CodeAction - alias Expert.Protocol.Types.CodeLens - alias Expert.Protocol.Types.Completion - alias Expert.Protocol.Types.DidChangeWatchedFiles - alias Expert.Protocol.Types.ExecuteCommand - alias Expert.Protocol.Types.FileEvent - alias Expert.Protocol.Types.FileSystemWatcher - alias Expert.Protocol.Types.Registration - alias Expert.Protocol.Types.TextDocument - alias Engine.Api alias Expert.CodeIntelligence alias Expert.Configuration @@ -30,8 +6,13 @@ defmodule Expert.State do alias Expert.Provider.Handlers alias Expert.Transport alias Forge.Document + alias Forge.Protocol.Id + alias Forge.Protocol.Response + alias GenLSP.Enumerations + alias GenLSP.Notifications + alias GenLSP.Requests + alias GenLSP.Structures - require CodeAction.Kind require Logger import Api.Messages @@ -42,22 +23,23 @@ defmodule Expert.State do in_flight_requests: %{} @supported_code_actions [ - :quick_fix, - :refactor, - :refactor_extract, - :refactor_inline, - :refactor_rewrite, - :source, - :source_fix_all, - :source_organize_imports + Enumerations.CodeActionKind.quick_fix(), + Enumerations.CodeActionKind.refactor(), + Enumerations.CodeActionKind.refactor_extract(), + Enumerations.CodeActionKind.refactor_inline(), + Enumerations.CodeActionKind.refactor_rewrite(), + Enumerations.CodeActionKind.source(), + Enumerations.CodeActionKind.source_fix_all(), + Enumerations.CodeActionKind.source_organize_imports() ] def new do %__MODULE__{} end - def initialize(%__MODULE__{initialized?: false} = state, %Initialize{ - lsp: %Initialize.LSP{} = event + def initialize(%__MODULE__{initialized?: false} = state, %Requests.Initialize{ + id: event_id, + params: %Structures.InitializeParams{} = event }) do client_name = case event.client_info do @@ -69,8 +51,11 @@ defmodule Expert.State do new_state = %__MODULE__{state | configuration: config, initialized?: true} Logger.info("Starting project at uri #{config.project.root_uri}") - event.id + event_id |> initialize_result() + |> tap(fn result -> + Logger.info("Sending initialize result: #{inspect(result)}") + end) |> Transport.write() Transport.write(registrations()) @@ -79,7 +64,7 @@ defmodule Expert.State do {:ok, new_state} end - def initialize(%__MODULE__{initialized?: true}, %Initialize{}) do + def initialize(%__MODULE__{initialized?: true}, %Requests.Initialize{}) do {:error, :already_initialized} end @@ -125,7 +110,7 @@ defmodule Expert.State do {:error, :not_initialized} end - def apply(%__MODULE__{shutdown_received?: true} = state, %Exit{}) do + def apply(%__MODULE__{shutdown_received?: true} = state, %Notifications.Exit{}) do Logger.warning("Received an Exit notification. Halting the server in 150ms") :timer.apply_after(50, System, :halt, [0]) {:ok, state} @@ -136,7 +121,7 @@ defmodule Expert.State do {:error, :shutting_down} end - def apply(%__MODULE__{} = state, %DidChangeConfiguration{} = event) do + def apply(%__MODULE__{} = state, %Notifications.WorkspaceDidChangeConfiguration{} = event) do case Configuration.on_change(state.configuration, event) do {:ok, config} -> {:ok, %__MODULE__{state | configuration: config}} @@ -149,7 +134,7 @@ defmodule Expert.State do {:ok, state} end - def apply(%__MODULE__{} = state, %DidChange{lsp: event}) do + def apply(%__MODULE__{} = state, %Notifications.TextDocumentDidChange{params: event}) do uri = event.text_document.uri version = event.text_document.version project = state.configuration.project @@ -176,13 +161,13 @@ defmodule Expert.State do end end - def apply(%__MODULE__{} = state, %DidOpen{} = did_open) do - %TextDocument.Item{ + def apply(%__MODULE__{} = state, %Notifications.TextDocumentDidOpen{} = did_open) do + %Structures.TextDocumentItem{ text: text, uri: uri, version: version, language_id: language_id - } = did_open.lsp.text_document + } = did_open.params.text_document case Document.Store.open(uri, text, version, language_id) do :ok -> @@ -195,7 +180,7 @@ defmodule Expert.State do end end - def apply(%__MODULE__{} = state, %DidClose{lsp: event}) do + def apply(%__MODULE__{} = state, %Notifications.TextDocumentDidClose{params: event}) do uri = event.text_document.uri case Document.Store.close(uri) do @@ -211,7 +196,7 @@ defmodule Expert.State do end end - def apply(%__MODULE__{} = state, %DidSave{lsp: event}) do + def apply(%__MODULE__{} = state, %Notifications.TextDocumentDidSave{params: event}) do uri = event.text_document.uri case Document.Store.save(uri) do @@ -225,22 +210,22 @@ defmodule Expert.State do end end - def apply(%__MODULE__{} = state, %Initialized{}) do + def apply(%__MODULE__{} = state, %Notifications.Initialized{}) do Logger.info("Expert Initialized") {:ok, %__MODULE__{state | initialized?: true}} end - def apply(%__MODULE__{} = state, %Shutdown{} = shutdown) do - Transport.write(Responses.Shutdown.new(id: shutdown.id)) + def apply(%__MODULE__{} = state, %Requests.Shutdown{} = shutdown) do + Transport.write(%Response{id: shutdown.id}) Logger.error("Shutting down") {:ok, %__MODULE__{state | shutdown_received?: true}} end - def apply(%__MODULE__{} = state, %Notifications.DidChangeWatchedFiles{lsp: event}) do + def apply(%__MODULE__{} = state, %Notifications.WorkspaceDidChangeWatchedFiles{params: event}) do project = state.configuration.project - Enum.each(event.changes, fn %FileEvent{} = change -> + Enum.each(event.changes, fn %Structures.FileEvent{} = change -> event = filesystem_event(project: Project, uri: change.uri, event_type: change.type) Engine.Api.broadcast(project, event) end) @@ -254,7 +239,12 @@ defmodule Expert.State do end defp registrations do - RegisterCapability.new(id: Id.next(), registrations: [file_watcher_registration()]) + %Requests.ClientRegisterCapability{ + id: Id.next(), + params: %Structures.RegistrationParams{ + registrations: [file_watcher_registration()] + } + } end @did_changed_watched_files_id "-42" @@ -263,33 +253,44 @@ defmodule Expert.State do extension_glob = "{" <> Enum.join(@watched_extensions, ",") <> "}" watchers = [ - FileSystemWatcher.new(glob_pattern: "**/mix.lock"), - FileSystemWatcher.new(glob_pattern: "**/*.#{extension_glob}") + %Structures.FileSystemWatcher{glob_pattern: "**/mix.lock"}, + %Structures.FileSystemWatcher{glob_pattern: "**/*.#{extension_glob}"} ] - Registration.new( + %Structures.Registration{ id: @did_changed_watched_files_id, method: "workspace/didChangeWatchedFiles", - register_options: DidChangeWatchedFiles.Registration.Options.new(watchers: watchers) - ) + register_options: %Structures.DidChangeWatchedFilesRegistrationOptions{watchers: watchers} + } end def initialize_result(event_id) do sync_options = - TextDocument.Sync.Options.new(open_close: true, change: :incremental, save: true) + %Structures.TextDocumentSyncOptions{ + open_close: true, + change: Enumerations.TextDocumentSyncKind.incremental(), + save: true + } code_action_options = - CodeAction.Options.new(code_action_kinds: @supported_code_actions, resolve_provider: false) + %Structures.CodeActionOptions{ + code_action_kinds: @supported_code_actions, + resolve_provider: false + } - code_lens_options = CodeLens.Options.new(resolve_provider: false) + code_lens_options = %Structures.CodeLensOptions{resolve_provider: false} - command_options = ExecuteCommand.Registration.Options.new(commands: Handlers.Commands.names()) + command_options = %Structures.ExecuteCommandOptions{ + commands: Handlers.Commands.names() + } completion_options = - Completion.Options.new(trigger_characters: CodeIntelligence.Completion.trigger_characters()) + %Structures.CompletionOptions{ + trigger_characters: CodeIntelligence.Completion.trigger_characters() + } server_capabilities = - Types.ServerCapabilities.new( + %Structures.ServerCapabilities{ code_action_provider: code_action_options, code_lens_provider: code_lens_options, completion_provider: completion_options, @@ -301,18 +302,17 @@ defmodule Expert.State do references_provider: true, text_document_sync: sync_options, workspace_symbol_provider: true - ) + } result = - Types.Initialize.Result.new( + %Structures.InitializeResult{ capabilities: server_capabilities, - server_info: - Types.Initialize.Result.ServerInfo.new( - name: "Expert", - version: "0.0.1" - ) - ) + server_info: %{ + name: "Expert", + version: "0.0.1" + } + } - Responses.InitializeResult.new(event_id, result) + %Response{id: event_id, result: result} end end diff --git a/apps/expert/lib/expert/task_queue.ex b/apps/expert/lib/expert/task_queue.ex index 518fb4f9..643d376c 100644 --- a/apps/expert/lib/expert/task_queue.ex +++ b/apps/expert/lib/expert/task_queue.ex @@ -1,8 +1,8 @@ defmodule Expert.TaskQueue do defmodule State do - alias Expert.Proto.Convert - alias Expert.Proto.LspTypes.ResponseError alias Expert.Transport + alias Forge.Protocol.Convert + alias GenLSP.Enumerations.ErrorCodes import Forge.Logging require Logger @@ -120,12 +120,24 @@ defmodule Expert.TaskQueue do end end - defp write_error(id, message, code \\ :internal_error) do - error = ResponseError.new(code: code, message: message) + defp write_error(id, message, code \\ ErrorCodes.internal_error()) do + error = %GenLSP.ErrorResponse{code: map_code(code), message: message} Transport.write(%{id: id, error: error}) end + @dialyzer {:nowarn_function, map_code: 1} + + defp map_code(:parse_error), do: ErrorCodes.parse_error() + defp map_code(:invalid_request), do: ErrorCodes.invalid_request() + defp map_code(:method_not_found), do: ErrorCodes.method_not_found() + defp map_code(:invalid_params), do: ErrorCodes.invalid_params() + defp map_code(:internal_error), do: ErrorCodes.internal_error() + defp map_code(:server_not_initialized), do: ErrorCodes.server_not_initialized() + defp map_code(:unknown_error_code), do: ErrorCodes.unknown_error_code() + defp map_code(:request_cancelled), do: -32_800 + defp map_code(code) when is_integer(code), do: code + defp run_task(fun, mfa) when is_function(fun) do task_supervisor_name() |> Task.Supervisor.async_nolink(fun) @@ -165,7 +177,7 @@ defmodule Expert.TaskQueue do GenServer.call(__MODULE__, :size) end - def cancel(%{lsp: %{id: id}}) do + def cancel(%{params: %{id: id}}) do cancel(id) end diff --git a/apps/expert/lib/expert/transport/std_io.ex b/apps/expert/lib/expert/transport/std_io.ex index a8316ab3..d2de6480 100644 --- a/apps/expert/lib/expert/transport/std_io.ex +++ b/apps/expert/lib/expert/transport/std_io.ex @@ -1,5 +1,6 @@ defmodule Expert.Transport.StdIO do - alias Expert.Protocol.JsonRpc + alias Forge.Protocol.Convert + alias Forge.Protocol.JsonRpc require Logger @@ -22,7 +23,7 @@ defmodule Expert.Transport.StdIO do def write(io_device \\ :stdio, payload) def write(io_device, %_{} = payload) do - with {:ok, lsp} <- Expert.Proto.Convert.to_lsp(payload), + with {:ok, lsp} <- encode(payload), {:ok, json} <- Jason.encode(lsp) do write(io_device, json) end @@ -54,7 +55,58 @@ defmodule Expert.Transport.StdIO do def write(_, []) do end - # private + defp encode(%{id: id, result: result}) do + with {:ok, result} <- dump_lsp(result) do + {:ok, + %{ + "jsonrpc" => "2.0", + "id" => id, + "result" => result + }} + end + end + + defp encode(%{id: id, error: error}) do + with {:ok, error} <- dump_lsp(error) do + {:ok, + %{ + "jsonrpc" => "2.0", + "id" => id, + "error" => error + }} + end + end + + defp encode(%_{} = request) do + dump_lsp(request) + end + + # Dialyzer complains about Schematic.dump not existing, but it does + # This will be removed by #20 anyways + @dialyzer {:nowarn_function, dump_lsp: 1} + + defp dump_lsp(%module{} = item) do + with {:ok, item} <- Convert.to_lsp(item) do + Schematic.dump(module.schematic(), item) + end + end + + defp dump_lsp(list) when is_list(list) do + dump = + Enum.map(list, fn item -> + case dump_lsp(item) do + {:ok, dumped} -> dumped + {:error, reason} -> throw({:error, reason}) + end + end) + + {:ok, dump} + catch + {:error, reason} -> + {:error, reason} + end + + defp dump_lsp(other), do: {:ok, other} defp loop(buffer, device, callback) do case IO.binread(device, :line) do diff --git a/apps/expert/lib/expert/window.ex b/apps/expert/lib/expert/window.ex index c73de27e..f78af130 100644 --- a/apps/expert/lib/expert/window.ex +++ b/apps/expert/lib/expert/window.ex @@ -1,13 +1,13 @@ defmodule Expert.Window do - alias Expert.Protocol.Id - alias Expert.Protocol.Notifications.LogMessage - alias Expert.Protocol.Notifications.ShowMessage - alias Expert.Protocol.Requests - alias Expert.Protocol.Types alias Expert.Transport + alias Forge.Protocol.Id + alias GenLSP.Enumerations + alias GenLSP.Notifications + alias GenLSP.Requests + alias GenLSP.Structures @type level :: :error | :warning | :info | :log - @type message_result :: {:errory, term()} | {:ok, nil} | {:ok, Types.Message.ActionItem.t()} + @type message_result :: {:errory, term()} | {:ok, nil} | {:ok, Structures.MessageActionItem.t()} @type on_response_callback :: (message_result() -> any()) @type message :: String.t() @type action :: String.t() @@ -16,7 +16,7 @@ defmodule Expert.Window do @spec log(level, message()) :: :ok def log(level, message) when level in @levels and is_binary(message) do - log_message = apply(LogMessage, level, [message]) + log_message = log_message(level, message) Transport.write(log_message) :ok end @@ -27,16 +27,44 @@ defmodule Expert.Window do end end + # There is a warning introduced somehow in #19 but this file will get removed + # in #20 so we can ignore it for now. + @dialyzer {:nowarn_function, show: 2} + @spec show(level(), message()) :: :ok def show(level, message) when level in @levels and is_binary(message) do - show_message = apply(ShowMessage, level, [message]) + show_message = show_message(level, message) Transport.write(show_message) :ok end + for type <- @levels do + def log_message(unquote(type), message) when is_binary(message) do + %Notifications.WindowLogMessage{ + params: %Structures.ShowMessageParams{ + message: message, + type: Enumerations.MessageType.unquote(type) + } + } + end + + def show_message(unquote(type), message) when is_binary(message) do + %Notifications.WindowShowMessage{ + params: %Structures.ShowMessageParams{ + message: message, + type: Enumerations.MessageType.unquote(type) + } + } + end + end + @spec show_message(level(), message()) :: :ok def show_message(level, message) do - request = Requests.ShowMessageRequest.new(id: Id.next(), message: message, type: level) + request = %Requests.WindowShowMessageRequest{ + id: Id.next(), + params: %Structures.ShowMessageRequestParams{message: message, type: level} + } + Expert.server_request(request) end @@ -62,7 +90,7 @@ defmodule Expert.Window do Displays a message to the user in the UI and waits for a response. The result type handed to the callback function is a - `Expert.Protocol.Types.Message.ActionItem` or nil if there was no response + `GenLSP.Structures.MessageActionItem` or nil if there was no response from the user. The strings passed in as the `actions` command are displayed to the user, and when @@ -73,16 +101,18 @@ defmodule Expert.Window do when is_function(on_response, 1) do action_items = Enum.map(actions, fn action_string -> - Types.Message.ActionItem.new(title: action_string) + %Structures.MessageActionItem{title: action_string} end) request = - Requests.ShowMessageRequest.new( + %Requests.WindowShowMessageRequest{ id: Id.next(), - message: message, - actions: action_items, - type: level - ) + params: %Structures.ShowMessageRequestParams{ + message: message, + actions: action_items, + type: level + } + } Expert.server_request(request, fn _request, response -> on_response.(response) end) end diff --git a/apps/expert/mix.exs b/apps/expert/mix.exs index e309ac58..73fe08d2 100644 --- a/apps/expert/mix.exs +++ b/apps/expert/mix.exs @@ -9,7 +9,7 @@ defmodule Expert.MixProject do elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), - dialyzer: Mix.Dialyzer.config(add_apps: [:jason, :proto]), + dialyzer: Mix.Dialyzer.config(add_apps: [:jason]), aliases: aliases(), elixirc_paths: elixirc_paths(Mix.env()) ] @@ -40,17 +40,18 @@ defmodule Expert.MixProject do defp deps do [ - {:forge, path: "../forge", env: Mix.env()}, Mix.Credo.dependency(), Mix.Dialyzer.dependency(), {:elixir_sense, github: "elixir-lsp/elixir_sense", ref: "73ce7e0d239342fb9527d7ba567203e77dbb9b25"}, + {:engine, path: "../engine", env: Mix.env()}, + {:forge, path: "../forge", env: Mix.env()}, + {:gen_lsp, "~> 0.10"}, {:jason, "~> 1.4"}, {:logger_file_backend, "~> 0.0", only: [:dev, :prod]}, {:patch, "~> 0.15", runtime: false, only: [:dev, :test]}, {:path_glob, "~> 0.2"}, - {:protocol, path: "../protocol", env: Mix.env()}, - {:engine, path: "../engine", env: Mix.env()}, + {:schematic, "~> 0.2"}, {:sourceror, "~> 1.9"} ] end diff --git a/apps/expert/mix.lock b/apps/expert/mix.lock index 7c0c16fa..11140d4e 100644 --- a/apps/expert/mix.lock +++ b/apps/expert/mix.lock @@ -7,14 +7,19 @@ "elixir_sense": {:git, "https://github.com/elixir-lsp/elixir_sense.git", "73ce7e0d239342fb9527d7ba567203e77dbb9b25", [ref: "73ce7e0d239342fb9527d7ba567203e77dbb9b25"]}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "gen_lsp": {:hex, :gen_lsp, "0.10.0", "f6da076b5ccedf937d17aa9743635a2c3d0f31265c853e58b02ab84d71852270", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "768f8f7b5c5e218fb36dcebd30dcd6275b61ca77052c98c3c4c0375158392c4a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "logger_file_backend": {:hex, :logger_file_backend, "0.0.14", "774bb661f1c3fed51b624d2859180c01e386eb1273dc22de4f4a155ef749a602", [:mix], [], "hexpm", "071354a18196468f3904ef09413af20971d55164267427f6257b52cfba03f9e6"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "patch": {:hex, :patch, "0.15.0", "947dd6a8b24a2d2d1137721f20bb96a8feb4f83248e7b4ad88b4871d52807af5", [:mix], [], "hexpm", "e8dadf9b57b30e92f6b2b1ce2f7f57700d14c66d4ed56ee27777eb73fb77e58d"}, "path_glob": {:hex, :path_glob, "0.2.0", "b9e34b5045cac5ecb76ef1aa55281a52bf603bf7009002085de40958064ca312", [:mix], [{:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "be2594cb4553169a1a189f95193d910115f64f15f0d689454bb4e8cfae2e7ebc"}, "refactorex": {:hex, :refactorex, "0.1.51", "74fc4603b31b600d78539ffea9fe170038aa8d471eec5aed261354c9734b4b27", [:mix], [{:sourceror, "~> 1.7", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "aefa150ab2c0d62aa8c01c4d04b932806118790f09c4106e20883281932fba03"}, + "schematic": {:hex, :schematic, "0.2.1", "0b091df94146fd15a0a343d1bd179a6c5a58562527746dadd09477311698dbb1", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0b255d65921e38006138201cd4263fd8bb807d9dfc511074615cd264a571b3b1"}, "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, } diff --git a/apps/expert/test/convertibles/expert.plugin.diagnostic.result_test.exs b/apps/expert/test/convertibles/forge.plugin.diagnostic.result_test.exs similarity index 67% rename from apps/expert/test/convertibles/expert.plugin.diagnostic.result_test.exs rename to apps/expert/test/convertibles/forge.plugin.diagnostic.result_test.exs index afb0e895..86a15800 100644 --- a/apps/expert/test/convertibles/expert.plugin.diagnostic.result_test.exs +++ b/apps/expert/test/convertibles/forge.plugin.diagnostic.result_test.exs @@ -1,7 +1,9 @@ -defmodule Expert.Convertibles.Forge.Plugin.V1.Diagnostic.ResultTest do +defmodule Forge.Protocol.Convertibles.Forge.Plugin.V1.Diagnostic.ResultTest do alias Forge.Document alias Forge.Plugin.V1.Diagnostic - use Expert.Test.Protocol.ConvertibleSupport + alias GenLSP.Enumerations.DiagnosticSeverity + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport import Forge.Test.CodeSigil @@ -28,29 +30,30 @@ defmodule Expert.Convertibles.Forge.Plugin.V1.Diagnostic.ResultTest do setup [:with_an_open_file] test "it should translate a diagnostic with a line as a position", %{uri: uri} do - assert {:ok, %Types.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, 1), uri) + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, 1), uri) assert converted.message == "Broken!" - assert converted.severity == :error + assert converted.severity == DiagnosticSeverity.error() assert converted.source == "Elixir" assert converted.range == range(:lsp, position(:lsp, 0, 0), position(:lsp, 1, 0)) end test "it should translate a diagnostic with a line and a column", %{uri: uri} do - assert {:ok, %Types.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, {1, 1}), uri) + assert {:ok, %Structures.Diagnostic{} = converted} = + to_lsp(plugin_diagnostic(uri, {1, 1}), uri) assert converted.message == "Broken!" assert converted.range == range(:lsp, position(:lsp, 0, 0), position(:lsp, 1, 0)) end test "it should translate a diagnostic with a four-elements tuple position", %{uri: uri} do - assert {:ok, %Types.Diagnostic{} = converted} = + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, {2, 5, 2, 8}), uri) assert converted.message == "Broken!" assert converted.range == range(:lsp, position(:lsp, 1, 4), position(:lsp, 1, 7)) - assert {:ok, %Types.Diagnostic{} = converted} = + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, {1, 0, 3, 0}), uri) assert converted.message == "Broken!" @@ -60,29 +63,30 @@ defmodule Expert.Convertibles.Forge.Plugin.V1.Diagnostic.ResultTest do test "it should translate a diagnostic line that is out of bounds (elixir can do this)", %{ uri: uri } do - assert {:ok, %Types.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, 9), uri) + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, 9), uri) assert converted.message == "Broken!" assert converted.range == range(:lsp, position(:lsp, 7, 0), position(:lsp, 8, 0)) end test "it can translate a diagnostic of a file that isn't open", %{uri: uri} do - assert {:ok, %Types.Diagnostic{}} = to_lsp(plugin_diagnostic(__ENV__.file, 2), uri) + assert {:ok, %Structures.Diagnostic{}} = to_lsp(plugin_diagnostic(__ENV__.file, 2), uri) end test "it can translate a diagnostic that starts after an emoji", %{uri: uri} do - assert {:ok, %Types.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, {6, 10}), uri) + assert {:ok, %Structures.Diagnostic{} = converted} = + to_lsp(plugin_diagnostic(uri, {6, 10}), uri) assert converted.range == range(:lsp, position(:lsp, 5, 10), position(:lsp, 6, 0)) end test "it converts expert positions", %{uri: uri, document: document} do - assert {:ok, %Types.Diagnostic{} = converted} = + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, Document.Position.new(document, 1, 1)), uri) - assert converted.range == %Types.Range{ - start: %Types.Position{line: 0, character: 0}, - end: %Types.Position{line: 1, character: 0} + assert converted.range == %Structures.Range{ + start: %Structures.Position{line: 0, character: 0}, + end: %Structures.Position{line: 1, character: 0} } end @@ -93,10 +97,10 @@ defmodule Expert.Convertibles.Forge.Plugin.V1.Diagnostic.ResultTest do Document.Position.new(document, 2, 8) ) - assert {:ok, %Types.Diagnostic{} = converted} = + assert {:ok, %Structures.Diagnostic{} = converted} = to_lsp(plugin_diagnostic(uri, expert_range), uri) - assert %Types.Range{start: start_pos, end: end_pos} = converted.range + assert %Structures.Range{start: start_pos, end: end_pos} = converted.range assert start_pos.line == 1 assert start_pos.character == 4 assert end_pos.line == 1 diff --git a/apps/expert/test/document_test.exs b/apps/expert/test/document_test.exs index 39d4271f..409dd58d 100644 --- a/apps/expert/test/document_test.exs +++ b/apps/expert/test/document_test.exs @@ -1,14 +1,9 @@ defmodule Forge.DocumentTest do - alias Expert.Protocol.Types.Position - alias Expert.Protocol.Types.Range - alias Expert.Protocol.Types.TextEdit alias Forge.Document - alias Expert.Protocol.Types.TextDocument.ContentChangeEvent.TextDocumentContentChangeEvent, - as: RangedContentChange - - alias Expert.Protocol.Types.TextDocument.ContentChangeEvent.TextDocumentContentChangeEvent1, - as: TextOnlyContentChange + alias GenLSP.Structures.Position + alias GenLSP.Structures.Range + alias GenLSP.Structures.TextEdit use ExUnit.Case use ExUnitProperties @@ -38,11 +33,11 @@ defmodule Forge.DocumentTest do end def edit(text) do - TextEdit.new(new_text: text, range: nil) + %TextEdit{new_text: text, range: nil} end def edit(text, range) do - TextEdit.new(new_text: text, range: range) + %TextEdit{new_text: text, range: range} end describe "new" do @@ -86,16 +81,18 @@ defmodule Forge.DocumentTest do describe "applying protocol content change events" do test "applying a text only change replaces all the test" do - {:ok, doc} = run_changes("hello", [TextOnlyContentChange.new(text: "goodbye")]) + {:ok, doc} = + run_changes("hello", [%{text: "goodbye"}]) + assert "goodbye" = text(doc) end test "applying a range event replaces the range" do range_change = - RangedContentChange.new( + %{ range: new_range(0, 6, 1, 0), text: "people" - ) + } {:ok, doc} = run_changes("hello there", [range_change]) assert "hello people" == text(doc) @@ -164,14 +161,14 @@ defmodule Forge.DocumentTest do high = map_size(line_offsets) if high == 0 do - Position.new(line: 0, character: offset) + %Position{line: 0, character: offset} else low = find_low_high(low, high, offset, line_offsets) # low is the least x for which the line offset is larger than the current offset # or array.length if no line offset is larger than the current offset line = low - 1 - Position.new(line: line, character: offset - line_offsets[line]) + %Position{line: line, character: offset - line_offsets[line]} end end @@ -182,7 +179,7 @@ defmodule Forge.DocumentTest do end def new_position(l, c) do - Position.new(line: l, character: c) + %Position{line: l, character: c} end def position_after_substring(text, sub_text) do @@ -199,19 +196,19 @@ defmodule Forge.DocumentTest do |> String.to_charlist() |> length() - Range.new( + %Range{ start: position_at(doc, index), end: position_at(doc, index + substring_len) - ) + } end def range_after_substring(doc_text, sub_text) do pos = position_after_substring(doc_text, sub_text) - Range.new(start: pos, end: pos) + %Range{start: pos, end: pos} end def new_range(sl, sc, el, ec) do - Range.new(start: new_position(sl, sc), end: new_position(el, ec)) + %Range{start: new_position(sl, sc), end: new_position(el, ec)} end def run_changes(original, changes, opts \\ []) do @@ -539,10 +536,10 @@ defmodule Forge.DocumentTest do event = edit( "", - Range.new( - start: Position.new(character: 0, line: 2), - end: Position.new(character: 22, line: 2) - ) + %Range{ + start: %Position{character: 0, line: 2}, + end: %Position{character: 22, line: 2} + } ) assert {:ok, doc} = run_changes(orig, [event]) @@ -730,8 +727,8 @@ defmodule Forge.DocumentTest do "this is the first line\nthis is the second" |> document() |> Document.fragment( - Position.new(line: 0, character: 5), - Position.new(line: 0, character: 7) + %Position{line: 0, character: 5}, + %Position{line: 0, character: 7} ) assert doc == "is" diff --git a/apps/expert/test/expert/code_intelligence/completion/builder_test.exs b/apps/expert/test/expert/code_intelligence/completion/builder_test.exs index 279ce85b..01c8dca0 100644 --- a/apps/expert/test/expert/code_intelligence/completion/builder_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/builder_test.exs @@ -1,8 +1,8 @@ defmodule Expert.CodeIntelligence.Completion.BuilderTest do alias Expert.CodeIntelligence.Completion.SortScope - alias Expert.Protocol.Types.Completion.Item, as: CompletionItem alias Forge.Ast alias Forge.Ast.Env + alias GenLSP.Structures.CompletionItem use ExUnit.Case, async: true @@ -19,9 +19,10 @@ defmodule Expert.CodeIntelligence.Completion.BuilderTest do end def item(label, opts \\ []) do - opts - |> Keyword.merge(label: label) - |> CompletionItem.new() + fields = Keyword.merge(opts, label: label) + + CompletionItem + |> struct(fields) |> set_sort_scope(SortScope.default()) end diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/bitstring_option_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/bitstring_option_test.exs index 7a86db13..895d634a 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/bitstring_option_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/bitstring_option_test.exs @@ -1,4 +1,5 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest do + alias GenLSP.Enumerations.CompletionItemKind use Expert.Test.Expert.CompletionCase describe "bitstring options" do @@ -6,7 +7,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:ok, completions} = project |> complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) for completion <- completions, completed = apply_completion(completion) do @@ -18,7 +19,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:ok, completions} = project |> complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) for completion <- completions, completed = apply_completion(completion) do @@ -30,7 +31,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:ok, completion} = project |> complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(completion) == "< complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(completion) == "< complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(utf8) == "< complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(completion) == "< complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) for completion <- completions do assert String.starts_with?(completion, "-") @@ -82,7 +83,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:ok, completion} = project |> complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(completion) == "< complete("< fetch_completion(kind: :unit) + |> fetch_completion(CompletionItemKind.unit()) assert apply_completion(utf8) == "< complete(code) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) end test "macros are not included", %{project: project} do @@ -127,7 +128,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:error, :not_found} = project |> complete(code) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) end test "variables are included", %{project: project} do @@ -139,7 +140,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.BitstringOptionsTest d assert {:ok, completion} = project |> complete(code) - |> fetch_completion(kind: :variable) + |> fetch_completion(kind: CompletionItemKind.variable()) assert apply_completion(completion) == ~q[ bin_length = 5 diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/callback_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/callback_test.exs index 2e2a91c6..716c8246 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/callback_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/callback_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.CallbackTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase describe "callback completions" do @@ -13,7 +15,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.CallbackTest do {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :interface) + |> fetch_completion(kind: CompletionItemKind.interface()) assert apply_completion(completion) =~ "@impl true\ndef handle_info(${1:msg}, ${2:state}) do" @@ -30,7 +32,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.CallbackTest do {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :interface) + |> fetch_completion(kind: CompletionItemKind.interface()) assert apply_completion(completion) =~ "@impl true\ndef handle_info(${1:msg}, ${2:state}) do" @@ -48,7 +50,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.CallbackTest do {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :interface) + |> fetch_completion(kind: CompletionItemKind.interface()) assert apply_completion(completion) == """ defmodule MyServer do diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/function_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/function_test.exs index b5bcffa5..ed6f6d45 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/function_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/function_test.exs @@ -1,4 +1,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do + alias GenLSP.Enumerations.CompletionItemKind + alias GenLSP.Enumerations.InsertTextFormat + use Expert.Test.Expert.CompletionCase describe "function completions" do @@ -26,7 +29,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete("Application.loaded_app|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "Application.loaded_applications()" end @@ -35,14 +38,14 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do assert {:error, :not_found} = project |> complete("|> Application.loaded_app|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) end test "arity 1 omits arguments if in a pipeline", %{project: project} do {:ok, [completion, _]} = project |> complete("|> Enum.dedu|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "|> Enum.dedup()" end @@ -51,7 +54,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete("|> Enum.chunk_b|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "|> Enum.chunk_by(${1:fun})" assert completion.label == "chunk_by(fun)" @@ -61,7 +64,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete("Enum.dedup_b|()") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "Enum.dedup_by()" end @@ -84,7 +87,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert completion.label == "fun_1_without_parens arg" assert apply_completion(completion) =~ "Project.Functions.fun_1_without_parens ${1:arg}" @@ -101,7 +104,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert completion.label == "fun_1_without_parens arg" assert apply_completion(completion) =~ "fun_1_without_parens ${1:arg}" @@ -117,7 +120,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :module) + |> fetch_completion(kind: CompletionItemKind.module()) assert completion.label == "Integer" end @@ -169,9 +172,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == ~q[ Enum.map(1..10, Enum.reduce_while(${1:enumerable}, ${2:acc}, ${3:fun})) @@ -195,7 +198,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do assert apply_completion(capture) == "&is_map/1" assert args_capture.detail == "(Capture with arguments)" - assert args_capture.insert_text_format == :snippet + assert args_capture.insert_text_format == InsertTextFormat.snippet() assert apply_completion(args_capture) == "&is_map(${1:term})" end @@ -206,7 +209,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do assert apply_completion(is_map_key_complete) == "&is_map_key/2" assert is_map_key_args.detail == "(Capture with arguments)" - assert is_map_key_args.insert_text_format == :snippet + assert is_map_key_args.insert_text_format == InsertTextFormat.snippet() assert apply_completion(is_map_key_args) == "&is_map_key(${1:map}, ${2:key})" end end @@ -216,7 +219,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, [arity_1, arity_2]} = project |> complete("Project.DefaultArgs.first|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(arity_1) == "Project.DefaultArgs.first_arg(${1:y})" assert apply_completion(arity_2) == "Project.DefaultArgs.first_arg(${1:x}, ${2:y})" @@ -226,7 +229,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, [arity_1, arity_2]} = project |> complete("Project.DefaultArgs.middle|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(arity_1) == "Project.DefaultArgs.middle_arg(${1:a}, ${2:c})" assert apply_completion(arity_2) == "Project.DefaultArgs.middle_arg(${1:a}, ${2:b}, ${3:c})" @@ -236,7 +239,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, [arity_1, arity_2]} = project |> complete("Project.DefaultArgs.last|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(arity_1) == "Project.DefaultArgs.last_arg(${1:x})" assert apply_completion(arity_2) == "Project.DefaultArgs.last_arg(${1:x}, ${2:y})" @@ -246,7 +249,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, [arity_1, arity_2]} = project |> complete("Project.DefaultArgs.opt|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(arity_1) == "Project.DefaultArgs.options(${1:a})" assert apply_completion(arity_2) == "Project.DefaultArgs.options(${1:a}, ${2:opts})" @@ -256,7 +259,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, [arity_1, arity_2]} = project |> complete("Project.DefaultArgs.struct|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(arity_1) == "Project.DefaultArgs.struct_arg(${1:a})" assert apply_completion(arity_2) == "Project.DefaultArgs.struct_arg(${1:a}, ${2:b})" @@ -266,7 +269,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete("Project.DefaultArgs.pattern_match|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "Project.DefaultArgs.pattern_match_arg(${1:user})" end @@ -275,7 +278,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.FunctionTest do {:ok, completion} = project |> complete("Project.DefaultArgs.reverse|") - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert apply_completion(completion) == "Project.DefaultArgs.reverse_pattern_match_arg(${1:user})" diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/interpolation_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/interpolation_test.exs index 38a12254..ec25308d 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/interpolation_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/interpolation_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.InterpolationTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase test "variables are completed inside strings", %{project: project} do @@ -12,7 +14,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.InterpolationTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :variable) + |> fetch_completion(kind: CompletionItemKind.variable()) expected = ~S[ @@ -58,7 +60,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.InterpolationTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert String.trim(apply_completion(completion)) == ~S["#{inspect(%Project.Structs.User{$1})}"] diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs index 0f0eb79a..3d150d27 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/macro_test.exs @@ -1,5 +1,8 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do - alias Expert.Protocol.Types.Completion + alias GenLSP.Enumerations.CompletionItemKind + alias GenLSP.Enumerations.InsertTextFormat + + alias GenLSP.Structures.CompletionItem use Expert.Test.Expert.CompletionCase @@ -30,7 +33,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("def|") |> fetch_completion("def ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion assert completion.detail end @@ -42,7 +45,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "def (define a function)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "def ${1:name}($2) do\n $0\nend" end @@ -128,7 +131,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("defp|") |> fetch_completion("defp ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion end test "defp", %{project: project} do @@ -139,7 +142,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defp (define a private function)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defp ${1:name}($2) do\n $0\nend" end @@ -149,7 +152,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("defmacro|") |> fetch_completion("defmacro ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion assert completion.detail end @@ -161,7 +164,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmacro (define a macro)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defmacro ${1:name}($2) do\n $0\nend" end @@ -171,7 +174,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("defmacrop|") |> fetch_completion("defmacrop ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion assert completion.detail end @@ -183,7 +186,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmacrop (define a private macro)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defmacrop ${1:name}($2) do\n $0\nend" end @@ -194,7 +197,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> fetch_completion("defmodule ") assert completion.detail - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion end test "defmodule for lib paths", %{project: project} do @@ -205,7 +208,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:File} do @@ -222,7 +225,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:Foo.Project.MyTest} do @@ -239,7 +242,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:Path.To.File} do @@ -256,7 +259,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:Path} do @@ -273,7 +276,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:Path.To.My.Module.Test} do @@ -290,7 +293,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defmodule (define a module)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defmodule ${1:My.Module.Test} do @@ -305,7 +308,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("defprotocol|") |> fetch_completion("defprotocol ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion assert completion.detail end @@ -317,7 +320,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defprotocol (define a protocol)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defprotocol ${1:protocol_name} do @@ -332,7 +335,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> complete("defimpl|") |> fetch_completion("defimpl ") - assert %Completion.Item{} = completion + assert %CompletionItem{} = completion end test "defimpl returns a snippet", %{project: project} do @@ -343,7 +346,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defimpl (define a protocol implementation)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ defimpl ${1:protocol_name}, for: ${2:struct_name} do @@ -360,7 +363,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defoverridable (mark a function as overridable)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defoverridable ${1:keyword_or_behaviour}" end @@ -373,7 +376,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defdelegate (define a delegate function)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defdelegate ${1:call}(${2:args}), to: ${3:module}" end @@ -385,7 +388,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defguard (define a guard macro)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defguard ${1:guard}(${2:args}) when $0" end @@ -397,7 +400,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defguardp (define a private guard macro)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defguardp ${1:guard}(${2:args}) when $0" end @@ -409,7 +412,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defexception (define an exception)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defexception [${1::message}]" end @@ -421,7 +424,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "defstruct (define a struct)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "defstruct [${1:fields}]" end @@ -433,7 +436,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "alias (alias a module's name)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "alias $0" end @@ -444,7 +447,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> fetch_completion("use ") assert completion.label == "use (invoke another module's __using__ macro)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "use $0" end @@ -456,7 +459,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "import (import a module's functions)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "import $0" end @@ -468,7 +471,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "require (require a module's macros)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == "require $0" end @@ -480,7 +483,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "quote (quote block)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ quote $1 do @@ -497,7 +500,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "receive (receive block)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ receive do @@ -514,7 +517,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "try (try / catch / rescue block)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ try do @@ -531,7 +534,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "with (with statement)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ with ${1:pattern} <- ${2:expression} do @@ -548,7 +551,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "if (if statement)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ if $1 do @@ -565,7 +568,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "unless (unless statement)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ unless $1 do @@ -582,7 +585,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "case (case statement)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ case $1 do @@ -599,7 +602,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "cond (cond statement)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ cond do @@ -617,7 +620,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "for (comprehension)" - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert apply_completion(completion) == """ for ${1:pattern} <- ${2:enumerable} do @@ -648,7 +651,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "__MODULE__" - assert completion.kind == :constant + assert completion.kind == CompletionItemKind.constant() end test "__DIR__ is suggested", %{project: project} do @@ -659,7 +662,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "__DIR__" - assert completion.kind == :constant + assert completion.kind == CompletionItemKind.constant() end test "__ENV__ is suggested", %{project: project} do @@ -670,7 +673,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "__ENV__" - assert completion.kind == :constant + assert completion.kind == CompletionItemKind.constant() end test "__CALLER__ is suggested", %{project: project} do @@ -681,7 +684,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "__CALLER__" - assert completion.kind == :constant + assert completion.kind == CompletionItemKind.constant() end test "__STACKTRACE__ is suggested", %{project: project} do @@ -692,7 +695,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert completion.detail assert completion.label == "__STACKTRACE__" - assert completion.kind == :constant + assert completion.kind == CompletionItemKind.constant() end test "__aliases__ is hidden", %{project: project} do @@ -746,10 +749,10 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) - assert completion.kind == :function - assert completion.insert_text_format == :snippet + assert completion.kind == CompletionItemKind.function() + assert completion.insert_text_format == InsertTextFormat.snippet() assert completion.label == "macro_add(a, b)" assert apply_completion(completion) =~ "macro_add(${1:a}, ${2:b})" @@ -765,10 +768,10 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) - assert completion.kind == :function - assert completion.insert_text_format == :snippet + assert completion.kind == CompletionItemKind.function() + assert completion.insert_text_format == InsertTextFormat.snippet() assert completion.label == "macro_add(a, b)" assert apply_completion(completion) =~ "Project.Macros.macro_add(${1:a}, ${2:b})" @@ -785,10 +788,10 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) - assert completion.kind == :function - assert completion.insert_text_format == :snippet + assert completion.kind == CompletionItemKind.function() + assert completion.insert_text_format == InsertTextFormat.snippet() assert completion.label == "macro_add(a, b)" assert apply_completion(completion) =~ "Macros.macro_add(${1:a}, ${2:b})" @@ -805,7 +808,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert completion.label == "macro_1_without_parens arg" assert apply_completion(completion) =~ "macro_1_without_parens ${1:arg}" @@ -822,7 +825,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert completion.label == "macro_1_without_parens arg" assert apply_completion(completion) =~ "Project.Macros.macro_1_without_parens ${1:arg}" @@ -838,7 +841,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :function) + |> fetch_completion(kind: CompletionItemKind.function()) assert completion.label == "macro_2_without_parens arg1, arg2, arg3, arg4" @@ -906,7 +909,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MacroTest do |> fetch_completion("describe ") assert describe.label == "describe \"message\"" - assert describe.insert_text_format == :snippet + assert describe.insert_text_format == InsertTextFormat.snippet() assert apply_completion(describe) == inside_exunit_context("describe \"${1:message}\" do\n $0\nend") diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/map_field_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/map_field_test.exs index 137086a6..7cdb7cd7 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/map_field_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/map_field_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MapFieldTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase test "a map's fields are completed", %{project: project} do @@ -10,7 +12,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MapFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "first_name" assert apply_completion(completion) =~ "user.first_name" @@ -25,7 +27,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.MapFieldTest do assert {:ok, [first_name, last_name]} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert apply_completion(first_name) =~ "user.first_name" assert apply_completion(last_name) =~ "user.last_name" diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/module_attribute_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/module_attribute_test.exs index 2deb6438..5a807ff4 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/module_attribute_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/module_attribute_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase describe "module attributes" do @@ -45,11 +47,11 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert {:ok, [snippet_completion, empty_completion]} = project |> complete(source) - |> fetch_completion(kind: :property) + |> fetch_completion(kind: CompletionItemKind.property()) assert snippet_completion.detail assert snippet_completion.label == "@doc" - assert snippet_completion.kind == :property + assert snippet_completion.kind == CompletionItemKind.property() # note: indentation should be correctly adjusted by editor assert apply_completion(snippet_completion) == ~q[ @@ -64,7 +66,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert empty_completion.detail assert empty_completion.label == "@doc false" - assert empty_completion.kind == :property + assert empty_completion.kind == CompletionItemKind.property() assert apply_completion(empty_completion) == ~q[ defmodule MyModule do @@ -90,11 +92,11 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert {:ok, [_snippet_completion, empty_completion]} = project |> complete(source) - |> fetch_completion(kind: :property) + |> fetch_completion(kind: CompletionItemKind.property()) assert empty_completion.detail assert empty_completion.label == "@doc" - assert empty_completion.kind == :property + assert empty_completion.kind == CompletionItemKind.property() assert apply_completion(empty_completion) == ~q[ defmodule MyModule do @@ -184,7 +186,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert {:ok, [spec_my_function, spec]} = project |> complete(source) - |> fetch_completion(kind: :property) + |> fetch_completion(kind: CompletionItemKind.property()) assert spec_my_function.label == "@spec my_function" @@ -225,7 +227,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert {:ok, [spec_my_function, spec]} = project |> complete(source) - |> fetch_completion(kind: :property) + |> fetch_completion(kind: CompletionItemKind.property()) assert spec_my_function.label == "@spec my_function" @@ -266,7 +268,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleAttributeTest do assert {:ok, [spec_my_function, _spec]} = project |> complete(source) - |> fetch_completion(kind: :property) + |> fetch_completion(kind: CompletionItemKind.property()) assert spec_my_function.label == "@spec my_function" diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/module_or_behaviour_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/module_or_behaviour_test.exs index f9aa36ca..c3914c13 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/module_or_behaviour_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/module_or_behaviour_test.exs @@ -1,4 +1,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest do + alias GenLSP.Enumerations.CompletionItemKind + alias GenLSP.Enumerations.InsertTextFormat + use Expert.Test.Expert.CompletionCase describe "module completions" do @@ -6,9 +9,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete("Enu|") - |> fetch_completion(label: "Enum", kind: :module) + |> fetch_completion(label: "Enum", kind: CompletionItemKind.module()) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert completion.label == "Enum" assert completion.detail end @@ -17,9 +20,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete("Projec|") - |> fetch_completion(kind: :module) + |> fetch_completion(kind: CompletionItemKind.module()) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert completion.label == "Project" assert completion.detail =~ "Project" end @@ -28,9 +31,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete("Project.Structs.Us|") - |> fetch_completion(kind: :module) + |> fetch_completion(kind: CompletionItemKind.module()) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert completion.label == "User" assert completion.detail =~ "Project.Structs.User" end @@ -38,10 +41,10 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest test "behaviours should emit a completion", %{project: project} do assert {:ok, completion} = project - |> complete("GenS|") - |> fetch_completion(kind: :module) + |> complete("GenSer|") + |> fetch_completion(kind: CompletionItemKind.module()) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert completion.label == "GenServer" assert completion.detail =~ "A behaviour module" end @@ -50,9 +53,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete("Enumer|") - |> fetch_completion(kind: :module) + |> fetch_completion(kind: CompletionItemKind.module()) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert completion.label == "Enumerable" assert completion.detail =~ "Enumerable protocol" end @@ -70,7 +73,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest |> complete(code, trigger_character: ".") |> fetch_completion("Foo") - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() end end @@ -81,7 +84,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest |> complete(":erla|") |> fetch_completion(":erlang") - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert apply_completion(completion) == ":erlang" end end @@ -95,9 +98,9 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) - assert completion.insert_text_format == :snippet + assert completion.insert_text_format == InsertTextFormat.snippet() assert completion.label == "MapSet" assert completion.detail == "MapSet" assert apply_completion(completion) == "%MapSet{$1}\n" @@ -117,7 +120,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert apply_completion(completion) == expected end @@ -140,7 +143,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert completion.detail == "Project.Structs.User" assert apply_completion(completion) == expected @@ -160,7 +163,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert apply_completion(completion) == expected end @@ -179,7 +182,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert completion.label == "Account" assert apply_completion(completion) == expected @@ -197,7 +200,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert completion.label == "Account" assert apply_completion(completion) == expected @@ -221,7 +224,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert completion.detail == "Project.Structs.User" assert apply_completion(completion) == expected @@ -247,11 +250,11 @@ defmodule Expert.CodeIntelligence.Completion.Translations.ModuleOrBehaviourTest [order, order_line] = complete(project, source) assert order_line.label == "Order...(1 more struct)" - assert order_line.kind == :module + assert order_line.kind == CompletionItemKind.module() assert apply_completion(order_line) =~ "%Order." assert order.label == "Order" - assert order.kind == :struct + assert order.kind == CompletionItemKind.struct() assert apply_completion(order) =~ "%Order{$1}" end diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/struct_field_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/struct_field_test.exs index c86e1379..131d86bc 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/struct_field_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/struct_field_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase test "a struct's fields are completed", %{project: project} do @@ -10,7 +12,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "String.t()" assert completion.label == "first_name" @@ -26,7 +28,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "String.t()" assert completion.label == "first_name" @@ -42,7 +44,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "String.t()" assert completion.label == "first_name" @@ -59,7 +61,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "String.t()" assert completion.label == "first_name" @@ -79,7 +81,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) assert completion.detail == "String.t()" assert completion.label == "first_name" @@ -103,7 +105,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do {:ok, completions} = project |> complete(wrap_with_module("%Project.Structs.Account{|}")) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) completion = find_by_label(completions, "last_login_at") expected = "%Project.Structs.Account{last_login_at: ${1:last_login_at}}" @@ -114,7 +116,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do {:ok, completions} = project |> complete(wrap_with_module("%Project.Structs.Account{la|}")) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) completion = find_by_label(completions, "last_login_at") expected = "%Project.Structs.Account{last_login_at: ${1:last_login_at}}" @@ -125,7 +127,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do {:ok, completions} = project |> complete(wrap_with_module("%Project.Structs.Account{last_login_at: nil, |}")) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) completion = find_by_label(completions, "user") @@ -137,7 +139,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:error, :not_found} == project |> complete(wrap_with_module("%Project.Structs.Account{last_login_at: |}")) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) end test "should complete when typed a field character after the comma", %{ @@ -166,7 +168,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do {:ok, completions} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) completion = find_by_label(completions, "user") assert apply_completion(completion) == expected @@ -196,7 +198,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do {:ok, completions} = project |> complete(source) - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) completion = find_by_label(completions, "last_login_at") assert apply_completion(completion) == expected @@ -206,21 +208,21 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructFieldTest do assert {:error, :not_found} == project |> complete("%Project.Structs.Account{last_login_at: |}") - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) end test "complete nothing when the prefix is invalid", %{project: project} do assert {:error, :not_found} == project |> complete("%Project.Structs.Account{l.|}") - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) end test "complete nothing when the module is not a struct", %{project: project} do assert {:error, :not_found} == project |> complete("%Project.Structs.NotAStruct{|}") - |> fetch_completion(kind: :field) + |> fetch_completion(kind: CompletionItemKind.field()) end end end diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/struct_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/struct_test.exs index 12a1185b..a940c7dc 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/struct_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/struct_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase describe "structs" do @@ -6,7 +8,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert {:ok, [_, _, _] = account_and_user_and_order} = project |> complete("%Project.Structs.|") - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert Enum.find(account_and_user_and_order, &(&1.label == "User")) account = Enum.find(account_and_user_and_order, &(&1.label == "Account")) @@ -20,7 +22,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert {:ok, account} = project |> complete("%Project.Structs.A|") - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert account assert account.detail == "Project.Structs.Account" @@ -41,7 +43,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) == expected end @@ -53,7 +55,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do ] assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) =~ " %Project.Structs.Account{$1}" end @@ -66,7 +68,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do ] assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) =~ " %Account{$1}" end @@ -83,7 +85,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) == expected end @@ -106,7 +108,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) == expected end @@ -121,7 +123,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do ] assert [completion] = complete(project, source) - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() assert apply_completion(completion) == ~q[ defmodule TestModule do @@ -143,7 +145,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) == expected end @@ -159,7 +161,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do ] assert [completion] = complete(project, source) - assert completion.kind == :struct + assert completion.kind == CompletionItemKind.struct() assert apply_completion(completion) == expected end @@ -226,7 +228,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert apply_completion(completion) == expected end @@ -249,7 +251,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert apply_completion(completion) == expected end @@ -272,7 +274,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.StructTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :struct) + |> fetch_completion(kind: CompletionItemKind.struct()) assert apply_completion(completion) == expected end diff --git a/apps/expert/test/expert/code_intelligence/completion/translations/variable_test.exs b/apps/expert/test/expert/code_intelligence/completion/translations/variable_test.exs index 60f573c8..5bda4971 100644 --- a/apps/expert/test/expert/code_intelligence/completion/translations/variable_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion/translations/variable_test.exs @@ -1,4 +1,6 @@ defmodule Expert.CodeIntelligence.Completion.Translations.VariableTest do + alias GenLSP.Enumerations.CompletionItemKind + use Expert.Test.Expert.CompletionCase test "variables are completed", %{project: project} do @@ -12,7 +14,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.VariableTest do assert {:ok, completion} = project |> complete(source) - |> fetch_completion(kind: :variable) + |> fetch_completion(kind: CompletionItemKind.variable()) assert completion.label == "stinky" assert completion.detail == "stinky" @@ -37,7 +39,7 @@ defmodule Expert.CodeIntelligence.Completion.Translations.VariableTest do assert {:ok, [c1, c2]} = project |> complete(source) - |> fetch_completion(kind: :variable) + |> fetch_completion(kind: CompletionItemKind.variable()) assert c1.label == "var_1" assert c2.label == "var_2" diff --git a/apps/expert/test/expert/code_intelligence/completion_test.exs b/apps/expert/test/expert/code_intelligence/completion_test.exs index 29551d0d..0b0051d0 100644 --- a/apps/expert/test/expert/code_intelligence/completion_test.exs +++ b/apps/expert/test/expert/code_intelligence/completion_test.exs @@ -1,8 +1,10 @@ defmodule Expert.CodeIntelligence.CompletionTest do alias Engine.Completion.Candidate alias Expert.CodeIntelligence.Completion.SortScope - alias Expert.Protocol.Types.Completion - alias Expert.Protocol.Types.Completion.Item, as: CompletionItem + alias GenLSP.Enumerations.CompletionItemKind + + alias GenLSP.Structures.CompletionItem + alias GenLSP.Structures.CompletionList use Expert.Test.Expert.CompletionCase use Patch @@ -51,7 +53,7 @@ defmodule Expert.CodeIntelligence.CompletionTest do assert [_ | _] = completions = complete(project, "E|") for completion <- completions do - assert completion.kind == :module + assert completion.kind == CompletionItemKind.module() end end @@ -62,7 +64,7 @@ defmodule Expert.CodeIntelligence.CompletionTest do describe "ignoring things" do test "returns an incomplete completion list when the context is empty", %{project: project} do - assert %Completion.List{is_incomplete: true, items: []} = + assert %CompletionList{is_incomplete: true, items: []} = complete(project, " ", as_list: false) end @@ -98,7 +100,7 @@ defmodule Expert.CodeIntelligence.CompletionTest do test "only modules that are behaviuors are completed in an @impl", %{project: project} do assert [behaviour] = complete(project, "@impl U|") assert behaviour.label == "Unary" - assert behaviour.kind == :module + assert behaviour.kind == CompletionItemKind.module() end end @@ -222,7 +224,8 @@ defmodule Expert.CodeIntelligence.CompletionTest do completions = complete(project, "alias Foo.") for completion <- complete(project, "alias Foo.") do - assert %_{kind: :module} = completion + module_kind = CompletionItemKind.module() + assert %_{kind: ^module_kind} = completion end assert {:ok, _} = fetch_completion(completions, label: "Foo-behaviour") diff --git a/apps/expert/test/expert/project/diagnostics_test.exs b/apps/expert/test/expert/project/diagnostics_test.exs index 89082602..2f3106c4 100644 --- a/apps/expert/test/expert/project/diagnostics_test.exs +++ b/apps/expert/test/expert/project/diagnostics_test.exs @@ -1,9 +1,10 @@ defmodule Expert.Project.DiagnosticsTest do - alias Expert.Protocol.Notifications.PublishDiagnostics alias Expert.Test.DispatchFake alias Expert.Transport alias Forge.Document alias Forge.Plugin.V1.Diagnostic + alias GenLSP.Notifications.TextDocumentPublishDiagnostics + alias GenLSP.Structures.PublishDiagnosticsParams use ExUnit.Case use Patch @@ -64,13 +65,17 @@ defmodule Expert.Project.DiagnosticsTest do file_diagnostics(diagnostics: [diagnostic(document.uri)], uri: document.uri) Engine.Api.broadcast(project, file_diagnostics_message) - assert_receive {:transport, %PublishDiagnostics{}} + assert_receive {:transport, %TextDocumentPublishDiagnostics{}} Document.Store.get_and_update(document.uri, &Document.mark_clean/1) + Engine.Api.broadcast(project, project_compile_requested()) Engine.Api.broadcast(project, project_diagnostics(diagnostics: [])) - assert_receive {:transport, %PublishDiagnostics{diagnostics: nil}} + assert_receive {:transport, + %TextDocumentPublishDiagnostics{ + params: %PublishDiagnosticsParams{diagnostics: []} + }} end test "it clears a file's diagnostics if it has been closed", %{ @@ -82,12 +87,17 @@ defmodule Expert.Project.DiagnosticsTest do file_diagnostics(diagnostics: [diagnostic(document.uri)], uri: document.uri) Engine.Api.broadcast(project, file_diagnostics_message) - assert_receive {:transport, %PublishDiagnostics{}}, 500 + assert_receive {:transport, %TextDocumentPublishDiagnostics{}}, 500 Document.Store.close(document.uri) + + Engine.Api.broadcast(project, project_compile_requested()) Engine.Api.broadcast(project, project_diagnostics(diagnostics: [])) - assert_receive {:transport, %PublishDiagnostics{diagnostics: nil}} + assert_receive {:transport, + %TextDocumentPublishDiagnostics{ + params: %PublishDiagnosticsParams{diagnostics: []} + }} end test "it adds a diagnostic to the last line if they're out of bounds", %{project: project} do @@ -102,7 +112,12 @@ defmodule Expert.Project.DiagnosticsTest do file_diagnostics_message = file_diagnostics(diagnostics: [diagnostic], uri: document.uri) Engine.Api.broadcast(project, file_diagnostics_message) - assert_receive {:transport, %PublishDiagnostics{lsp: %{diagnostics: [diagnostic]}}}, 500 + + assert_receive {:transport, + %TextDocumentPublishDiagnostics{ + params: %PublishDiagnosticsParams{diagnostics: [diagnostic]} + }}, + 500 assert %Diagnostic.Result{} = diagnostic assert diagnostic.position == {4, 1} diff --git a/apps/expert/test/expert/project/progress_test.exs b/apps/expert/test/expert/project/progress_test.exs index 56549ef1..0f4e91a8 100644 --- a/apps/expert/test/expert/project/progress_test.exs +++ b/apps/expert/test/expert/project/progress_test.exs @@ -1,10 +1,11 @@ defmodule Expert.Project.ProgressTest do alias Expert.Configuration alias Expert.Project - alias Expert.Protocol.Notifications - alias Expert.Protocol.Requests alias Expert.Test.DispatchFake alias Expert.Transport + alias GenLSP.Notifications + alias GenLSP.Requests + alias GenLSP.Structures import Engine.Test.Fixtures import Engine.Api.Messages @@ -67,12 +68,20 @@ defmodule Expert.Project.ProgressTest do begin_message = progress(:begin, "mix compile") Engine.Api.broadcast(project, begin_message) - assert_receive {:transport, %Requests.CreateWorkDoneProgress{lsp: %{token: token}}} - assert_receive {:transport, %Notifications.Progress{}} + assert_receive {:transport, + %Requests.WindowWorkDoneProgressCreate{ + params: %Structures.WorkDoneProgressCreateParams{token: token} + }} + + assert_receive {:transport, %Notifications.DollarProgress{}} report_message = progress(:report, "mix compile", "lib/file.ex") Engine.Api.broadcast(project, report_message) - assert_receive {:transport, %Notifications.Progress{lsp: %{token: ^token, value: value}}} + + assert_receive {:transport, + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{token: ^token, value: value} + }} assert value.kind == "report" assert value.message == "lib/file.ex" @@ -86,7 +95,7 @@ defmodule Expert.Project.ProgressTest do begin_message = progress(:begin, "mix compile") Engine.Api.broadcast(project, begin_message) - refute_receive {:transport, %Requests.CreateWorkDoneProgress{lsp: %{}}} + refute_receive {:transport, %Requests.WindowWorkDoneProgressCreate{params: %{}}} end end @@ -96,29 +105,37 @@ defmodule Expert.Project.ProgressTest do test "it should be able to increment the percentage", %{project: project} do percent_begin(project, "indexing", 400) - assert_receive {:transport, %Requests.CreateWorkDoneProgress{lsp: %{token: token}}} - assert_receive {:transport, %Notifications.Progress{} = progress} + assert_receive {:transport, %Requests.WindowWorkDoneProgressCreate{params: %{token: token}}} + assert_receive {:transport, %Notifications.DollarProgress{} = progress} - assert progress.lsp.value.kind == "begin" - assert progress.lsp.value.title == "indexing" - assert progress.lsp.value.percentage == 0 + assert progress.params.value.kind == "begin" + assert progress.params.value.title == "indexing" + assert progress.params.value.percentage == 0 percent_report(project, "indexing", 100) - assert_receive {:transport, %Notifications.Progress{lsp: %{token: ^token, value: value}}} + assert_receive {:transport, + %Notifications.DollarProgress{ + params: %Structures.ProgressParams{token: ^token, value: value} + }} + assert value.kind == "report" assert value.percentage == 25 assert value.message == nil percent_report(project, "indexing", 260, "Almost done") - assert_receive {:transport, %Notifications.Progress{lsp: %{token: ^token, value: value}}} + assert_receive {:transport, + %Notifications.DollarProgress{params: %{token: ^token, value: value}}} + assert value.percentage == 90 assert value.message == "Almost done" percent_complete(project, "indexing", "Indexing Complete") - assert_receive {:transport, %Notifications.Progress{lsp: %{token: ^token, value: value}}} + assert_receive {:transport, + %Notifications.DollarProgress{params: %{token: ^token, value: value}}} + assert value.kind == "end" assert value.message == "Indexing Complete" end @@ -126,29 +143,34 @@ defmodule Expert.Project.ProgressTest do test "it caps the percentage at 100", %{project: project} do percent_begin(project, "indexing", 100) percent_report(project, "indexing", 1000) - assert_receive {:transport, %Notifications.Progress{lsp: %{value: %{kind: "begin"}}}} - assert_receive {:transport, %Notifications.Progress{lsp: %{value: value}}} + + assert_receive {:transport, + %Notifications.DollarProgress{params: %{value: %{kind: "begin"}}}} + + assert_receive {:transport, %Notifications.DollarProgress{params: %{value: value}}} assert value.kind == "report" assert value.percentage == 100 end test "it only allows the percentage to grow", %{project: project} do percent_begin(project, "indexing", 100) - assert_receive {:transport, %Notifications.Progress{lsp: %{value: %{kind: "begin"}}}} + + assert_receive {:transport, + %Notifications.DollarProgress{params: %{value: %{kind: "begin"}}}} percent_report(project, "indexing", 10) - assert_receive {:transport, %Notifications.Progress{lsp: %{value: value}}} + assert_receive {:transport, %Notifications.DollarProgress{params: %{value: value}}} assert value.kind == "report" assert value.percentage == 10 percent_report(project, "indexing", -10) - assert_receive {:transport, %Notifications.Progress{lsp: %{value: value}}} + assert_receive {:transport, %Notifications.DollarProgress{params: %{value: value}}} assert value.kind == "report" assert value.percentage == 10 percent_report(project, "indexing", 5) - assert_receive {:transport, %Notifications.Progress{lsp: %{value: value}}} + assert_receive {:transport, %Notifications.DollarProgress{params: %{value: value}}} assert value.kind == "report" assert value.percentage == 15 end diff --git a/apps/expert/test/expert/provider/handlers/code_lens_test.exs b/apps/expert/test/expert/provider/handlers/code_lens_test.exs index 2ecfdfb1..df300b6c 100644 --- a/apps/expert/test/expert/provider/handlers/code_lens_test.exs +++ b/apps/expert/test/expert/provider/handlers/code_lens_test.exs @@ -1,12 +1,12 @@ defmodule Expert.Provider.Handlers.CodeLensTest do - alias Expert.Proto.Convert - alias Expert.Protocol.Requests.CodeLens - alias Expert.Protocol.Types alias Expert.Provider.Handlers alias Forge.Document alias Forge.Project + alias Forge.Protocol.Convert + alias Forge.Protocol.Id + alias GenLSP.Requests.TextDocumentCodeLens + alias GenLSP.Structures - import Expert.Test.Protocol.Fixtures.LspProtocol import Engine.Api.Messages import Engine.Test.Fixtures import Forge.Test.RangeSupport @@ -42,12 +42,15 @@ defmodule Expert.Provider.Handlers.CodeLensTest do def build_request(path) do uri = Document.Path.ensure_uri(path) - params = [ - text_document: [uri: uri] - ] + with {:ok, _} <- Document.Store.open_temporary(uri) do + req = + %TextDocumentCodeLens{ + id: Id.next(), + params: %Structures.CodeLensParams{ + text_document: %Structures.TextDocumentIdentifier{uri: uri} + } + } - with {:ok, _} <- Document.Store.open_temporary(uri), - {:ok, req} <- build(CodeLens, params) do Convert.to_native(req) end end @@ -67,7 +70,7 @@ defmodule Expert.Provider.Handlers.CodeLensTest do {:ok, request} = build_request(mix_exs_path) {:reply, %{result: lenses}} = handle(request, project) - assert [%Types.CodeLens{} = code_lens] = lenses + assert [%Structures.CodeLens{} = code_lens] = lenses assert extract(mix_exs, code_lens.range) =~ "def project" assert code_lens.command == Handlers.Commands.reindex_command(project) diff --git a/apps/expert/test/expert/provider/handlers/find_references_test.exs b/apps/expert/test/expert/provider/handlers/find_references_test.exs index f9f1622d..aace5b6a 100644 --- a/apps/expert/test/expert/provider/handlers/find_references_test.exs +++ b/apps/expert/test/expert/provider/handlers/find_references_test.exs @@ -1,13 +1,13 @@ defmodule Expert.Provider.Handlers.FindReferencesTest do - alias Expert.Proto.Convert - alias Expert.Protocol.Requests.FindReferences - alias Expert.Protocol.Responses alias Expert.Provider.Handlers alias Forge.Ast.Analysis alias Forge.Document alias Forge.Document.Location + alias Forge.Protocol.Convert + alias Forge.Protocol.Response + alias GenLSP.Requests.TextDocumentReferences + alias GenLSP.Structures - import Expert.Test.Protocol.Fixtures.LspProtocol import Engine.Test.Fixtures use ExUnit.Case, async: false @@ -28,13 +28,18 @@ defmodule Expert.Provider.Handlers.FindReferencesTest do def build_request(path, line, char) do uri = Document.Path.ensure_uri(path) - params = [ - text_document: [uri: uri], - position: [line: line, character: char] - ] + with {:ok, _} <- Document.Store.open_temporary(uri) do + req = %TextDocumentReferences{ + id: Forge.Protocol.Id.next(), + params: %Structures.ReferenceParams{ + context: %Structures.ReferenceContext{ + include_declaration: true + }, + text_document: %Structures.TextDocumentIdentifier{uri: uri}, + position: %Structures.Position{line: line, character: char} + } + } - with {:ok, _} <- Document.Store.open_temporary(uri), - {:ok, req} <- build(FindReferences, params) do Convert.to_native(req) end end @@ -62,7 +67,7 @@ defmodule Expert.Provider.Handlers.FindReferencesTest do {:ok, request} = build_request(uri, 5, 6) - assert {:reply, %Responses.FindReferences{} = response} = handle(request, project) + assert {:reply, %Response{} = response} = handle(request, project) assert [%Location{} = location] = response.result assert location.uri =~ "file.ex" end @@ -72,7 +77,7 @@ defmodule Expert.Provider.Handlers.FindReferencesTest do {:ok, request} = build_request(uri, 1, 5) - assert {:reply, %Responses.FindReferences{} = response} = handle(request, project) + assert {:reply, %Response{} = response} = handle(request, project) assert response.result == nil end end diff --git a/apps/expert/test/expert/provider/handlers/go_to_definition_test.exs b/apps/expert/test/expert/provider/handlers/go_to_definition_test.exs index 84f891c6..407b1fca 100644 --- a/apps/expert/test/expert/provider/handlers/go_to_definition_test.exs +++ b/apps/expert/test/expert/provider/handlers/go_to_definition_test.exs @@ -1,11 +1,11 @@ defmodule Expert.Provider.Handlers.GoToDefinitionTest do - alias Expert.Proto.Convert - alias Expert.Protocol.Requests.GoToDefinition alias Expert.Provider.Handlers alias Forge.Document alias Forge.Document.Location + alias Forge.Protocol.Convert + alias GenLSP.Requests.TextDocumentDefinition + alias GenLSP.Structures - import Expert.Test.Protocol.Fixtures.LspProtocol import Engine.Api.Messages import Engine.Test.Fixtures @@ -38,13 +38,15 @@ defmodule Expert.Provider.Handlers.GoToDefinitionTest do def build_request(path, line, char) do uri = Document.Path.ensure_uri(path) - params = [ - text_document: [uri: uri], - position: [line: line, character: char] - ] + with {:ok, _} <- Document.Store.open_temporary(uri) do + req = %TextDocumentDefinition{ + id: Forge.Protocol.Id.next(), + params: %Structures.DefinitionParams{ + text_document: %Structures.TextDocumentIdentifier{uri: uri}, + position: %Structures.Position{line: line, character: char} + } + } - with {:ok, _} <- Document.Store.open_temporary(uri), - {:ok, req} <- build(GoToDefinition, params) do Convert.to_native(req) end end diff --git a/apps/expert/test/expert/provider/handlers/hover_test.exs b/apps/expert/test/expert/provider/handlers/hover_test.exs index 249d6320..03c22256 100644 --- a/apps/expert/test/expert/provider/handlers/hover_test.exs +++ b/apps/expert/test/expert/provider/handlers/hover_test.exs @@ -1,15 +1,12 @@ defmodule Expert.Provider.Handlers.HoverTest do alias Engine.Api.Messages alias Engine.Test.Fixtures - - alias Expert.Proto.Convert - alias Expert.Protocol.Requests - alias Expert.Protocol.Types alias Expert.Provider.Handlers - alias Expert.Test.Protocol.Fixtures.LspProtocol - alias Forge.Document alias Forge.Document.Position + alias Forge.Protocol.Convert + alias GenLSP.Requests + alias GenLSP.Structures import Forge.Test.CodeSigil import Forge.Test.CursorSupport @@ -100,8 +97,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«HoverWithDoc»" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -167,8 +164,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«HoverBehaviour»" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -224,8 +221,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«HoverBehaviour»" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -264,8 +261,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "%«StructWithDoc»{}" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -302,8 +299,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "%«StructWithDoc»{}" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -331,8 +328,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "%«StructWithDoc»{}" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -364,8 +361,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«CallHover.my_fun»(1, 2)" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -392,8 +389,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«CallHover.my_fun»(1, 2)" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -432,8 +429,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«CallHover.my_fun»(1, 2)" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -458,8 +455,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«CallHover.my_fun»" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -501,8 +498,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«CallHover.my_fun»(1)" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -529,8 +526,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "«MacroHover.my_macro»(:foo)" = hovered |> strip_cursor() |> decorate(result.range) end) @@ -557,8 +554,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected end) end @@ -588,8 +585,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "@type foo :: «TypeHover.my_type»()" = @@ -615,8 +612,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "@type foo :: «TypeHover.my_type»()" = @@ -642,8 +639,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "@type foo :: «TypeHover.my_type»(:foo)" = @@ -669,8 +666,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected assert "@type foo :: «TypeHover.my_type»(:foo)" = @@ -713,8 +710,8 @@ defmodule Expert.Provider.Handlers.HoverTest do """ with_compiled_in(project, code, fn -> - assert {:reply, %{result: %Types.Hover{} = result}} = hover(project, hovered) - assert result.contents.kind == :markdown + assert {:reply, %{result: %Structures.Hover{} = result}} = hover(project, hovered) + assert result.contents.kind == "markdown" assert result.contents.value == expected end) end @@ -755,14 +752,16 @@ defmodule Expert.Provider.Handlers.HoverTest do defp hover_request(path, line, char) do uri = Document.Path.ensure_uri(path) - # convert line and char to zero-based - params = [ - position: [line: line - 1, character: char - 1], - text_document: [uri: uri] - ] + with {:ok, _} <- Document.Store.open_temporary(uri) do + req = %Requests.TextDocumentHover{ + id: Forge.Protocol.Id.next(), + params: %Structures.HoverParams{ + # convert line and char to zero-based + position: %Structures.Position{line: line - 1, character: char - 1}, + text_document: %Structures.TextDocumentIdentifier{uri: uri} + } + } - with {:ok, _} <- Document.Store.open_temporary(uri), - {:ok, req} <- LspProtocol.build(Requests.Hover, params) do Convert.to_native(req) end end diff --git a/apps/expert/test/expert/task_queue_test.exs b/apps/expert/test/expert/task_queue_test.exs index 0dfe94cd..89e0e566 100644 --- a/apps/expert/test/expert/task_queue_test.exs +++ b/apps/expert/test/expert/task_queue_test.exs @@ -1,11 +1,13 @@ defmodule Expert.TaskQueueTest do alias Engine.Test.Fixtures alias Expert.Configuration - alias Expert.Protocol.Notifications - alias Expert.Protocol.Requests alias Expert.Provider.Handlers alias Expert.TaskQueue alias Expert.Transport + alias GenLSP.Enumerations.ErrorCodes + alias GenLSP.Notifications + alias GenLSP.Requests + alias GenLSP.Structures use ExUnit.Case use Patch @@ -33,9 +35,12 @@ defmodule Expert.TaskQueueTest do func.(request, config) end) - patch(Requests.Completion, :to_elixir, fn req -> {:ok, req} end) + patch(Requests.TextDocumentCompletion, :to_elixir, fn req -> {:ok, req} end) - request = Requests.Completion.new(id: id, text_document: nil, position: nil, context: nil) + request = %Requests.TextDocumentCompletion{ + id: id, + params: %Structures.CompletionParams{text_document: nil, position: nil, context: nil} + } {id, {Handlers.Completion, :handle, [request, config]}} end @@ -62,7 +67,8 @@ defmodule Expert.TaskQueueTest do assert_receive %{id: ^id, error: error} assert TaskQueue.size() == 0 - assert error.code == :request_cancelled + # ErrorCodes.request_cancelled() + assert error.code == -32_800 assert error.message == "Request cancelled" end @@ -74,7 +80,8 @@ defmodule Expert.TaskQueueTest do assert_receive %{id: ^id, error: error} assert TaskQueue.size() == 0 - assert error.code == :request_cancelled + # ErrorCodes.request_cancelled() + assert error.code == -32_800 assert error.message == "Request cancelled" end @@ -87,19 +94,18 @@ defmodule Expert.TaskQueueTest do {id, mfa} = request(config, fn _, _ -> Process.sleep(500) end) assert :ok = TaskQueue.add(id, mfa) - {:ok, notif} = - Notifications.Cancel.parse(%{ - "method" => "$/cancelRequest", - "jsonrpc" => "2.0", - "params" => %{ - "id" => id + notif = + %Notifications.DollarCancelRequest{ + params: %{ + id: id } - }) + } assert :ok = TaskQueue.cancel(notif) assert_receive %{id: ^id, error: error} assert TaskQueue.size() == 0 - assert error.code == :request_cancelled + # ErrorCodes.request_cancelled() + assert error.code == -32_800 assert error.message == "Request cancelled" end @@ -107,20 +113,18 @@ defmodule Expert.TaskQueueTest do {id, mfa} = request(config, fn _, _ -> Process.sleep(500) end) assert :ok = TaskQueue.add(id, mfa) - {:ok, req} = - Requests.Cancel.parse(%{ - "method" => "$/cancelRequest", - "jsonrpc" => "2.0", - "id" => "50", - "params" => %{ - "id" => id + req = + %Notifications.DollarCancelRequest{ + params: %{ + id: id } - }) + } assert :ok = TaskQueue.cancel(req) assert_receive %{id: ^id, error: error} assert TaskQueue.size() == 0 - assert error.code == :request_cancelled + # ErrorCodes.request_cancelled() + assert error.code == -32_800 assert error.message == "Request cancelled" end @@ -157,7 +161,7 @@ defmodule Expert.TaskQueueTest do assert :ok = TaskQueue.add(id, mfa) assert_receive %{id: ^id, error: error} - assert error.code == :internal_error + assert error.code == ErrorCodes.internal_error() assert error.message =~ "Boom!" end end diff --git a/apps/expert/test/expert/transport/std_io_test.exs b/apps/expert/test/expert/transport/std_io_test.exs index f3e9a5a5..975f7cb6 100644 --- a/apps/expert/test/expert/transport/std_io_test.exs +++ b/apps/expert/test/expert/transport/std_io_test.exs @@ -1,6 +1,6 @@ defmodule Expert.Transport.StdIoTest do - alias Expert.Protocol.JsonRpc alias Expert.Transport.StdIO + alias Forge.Protocol.JsonRpc use ExUnit.Case @@ -41,7 +41,7 @@ defmodule Expert.Transport.StdIoTest do # This series of requests is specially crafted to cause the original failure. Removing # a single « from the string will break the setup. request([ - %{method: "textDocument/doesSomething", body: "««««««««««««««««««««««"}, + %{method: "workspace/symbol", id: 1, params: %{query: "««««««««««««««««««««««"}}, %{method: "$/cancelRequest", id: 2}, %{method: "$/cancelRequest", id: 3} ]) diff --git a/apps/expert/test/support/test/completion_case.ex b/apps/expert/test/support/test/completion_case.ex index bd8c8570..5ad8f316 100644 --- a/apps/expert/test/support/test/completion_case.ex +++ b/apps/expert/test/support/test/completion_case.ex @@ -1,13 +1,13 @@ defmodule Expert.Test.Expert.CompletionCase do alias Expert.CodeIntelligence.Completion - alias Expert.Protocol.Types.Completion.Context, as: CompletionContext - alias Expert.Protocol.Types.Completion.Item, as: CompletionItem - alias Expert.Protocol.Types.Completion.List, as: CompletionList - alias Forge.Ast alias Forge.Document alias Forge.Project alias Forge.Test.CodeSigil + alias GenLSP.Enumerations.CompletionTriggerKind + alias GenLSP.Structures.CompletionContext + alias GenLSP.Structures.CompletionItem + alias GenLSP.Structures.CompletionList use ExUnit.CaseTemplate import Forge.Test.CursorSupport @@ -67,12 +67,12 @@ defmodule Expert.Test.Expert.CompletionCase do context = if is_binary(trigger_character) do - CompletionContext.new( - trigger_kind: :trigger_character, + %CompletionContext{ + trigger_kind: CompletionTriggerKind.trigger_character(), trigger_character: trigger_character - ) + } else - CompletionContext.new(trigger_kind: :invoked) + %CompletionContext{trigger_kind: CompletionTriggerKind.invoked()} end analysis = Ast.analyze(document) @@ -95,6 +95,18 @@ defmodule Expert.Test.Expert.CompletionCase do end end + def fetch_completion(completions, kind) when is_integer(kind) do + matcher = fn completion -> + Map.get(completion, :kind) == kind + end + + case completions |> completion_items() |> Enum.filter(matcher) do + [] -> {:error, :not_found} + [found] -> {:ok, found} + found when is_list(found) -> {:ok, found} + end + end + def fetch_completion(completions, opts) when is_list(opts) do matcher = fn completion -> Enum.reduce_while(opts, false, fn {key, value}, _ -> diff --git a/apps/expert_credo/mix.lock b/apps/expert_credo/mix.lock index 03faf221..817951f9 100644 --- a/apps/expert_credo/mix.lock +++ b/apps/expert_credo/mix.lock @@ -8,13 +8,18 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.37.2", "2a3aa7014094f0e4e286a82aa5194a34dd17057160988b8509b15aa6c292720c", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "4dfa56075ce4887e4e8b1dcc121cd5fcb0f02b00391fd367ff5336d98fa49049"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "gen_lsp": {:hex, :gen_lsp, "0.10.0", "f6da076b5ccedf937d17aa9743635a2c3d0f31265c853e58b02ab84d71852270", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "768f8f7b5c5e218fb36dcebd30dcd6275b61ca77052c98c3c4c0375158392c4a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, + "schematic": {:hex, :schematic, "0.2.1", "0b091df94146fd15a0a343d1bd179a6c5a58562527746dadd09477311698dbb1", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0b255d65921e38006138201cd4263fd8bb807d9dfc511074615cd264a571b3b1"}, "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "1.1.3", "15fdb14c64e84437901258bb56fc7d80aaf6ceaf85b9324f359e219241353bfb", [:mix], [], "hexpm", "859eb2be72d74be26c1c4f272905667672a52e44f743839c57c7ee73a1a66420"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, } diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.document.changes.ex b/apps/forge/lib/forge/convertibles/forge.document.changes.ex similarity index 57% rename from apps/protocol/lib/expert/protocol/convertibles/expert.document.changes.ex rename to apps/forge/lib/forge/convertibles/forge.document.changes.ex index fbef3f52..3b1a483f 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.document.changes.ex +++ b/apps/forge/lib/forge/convertibles/forge.document.changes.ex @@ -1,8 +1,8 @@ -defimpl Forge.Convertible, for: Forge.Document.Changes do +defimpl Forge.Protocol.Convertible, for: Forge.Document.Changes do alias Forge.Document def to_lsp(%Document.Changes{} = changes) do - Forge.Convertible.to_lsp(changes.edits) + Forge.Protocol.Convertible.to_lsp(changes.edits) end def to_native(%Document.Changes{} = changes, _) do diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.document.edit.ex b/apps/forge/lib/forge/convertibles/forge.document.edit.ex similarity index 53% rename from apps/protocol/lib/expert/protocol/convertibles/expert.document.edit.ex rename to apps/forge/lib/forge/convertibles/forge.document.edit.ex index 53922035..594e5edc 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.document.edit.ex +++ b/apps/forge/lib/forge/convertibles/forge.document.edit.ex @@ -1,15 +1,15 @@ -defimpl Forge.Convertible, for: Forge.Document.Edit do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types +defimpl Forge.Protocol.Convertible, for: Forge.Document.Edit do + alias Forge.Protocol.Conversions alias Forge.Document + alias GenLSP.Structures.TextEdit def to_lsp(%Document.Edit{range: nil} = edit) do - {:ok, Types.TextEdit.new(new_text: edit.text, range: nil)} + {:ok, %TextEdit{new_text: edit.text, range: nil}} end def to_lsp(%Document.Edit{} = edit) do with {:ok, range} <- Conversions.to_lsp(edit.range) do - {:ok, Types.TextEdit.new(new_text: edit.text, range: range)} + {:ok, %TextEdit{new_text: edit.text, range: range}} end end diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.document.location.ex b/apps/forge/lib/forge/convertibles/forge.document.location.ex similarity index 61% rename from apps/protocol/lib/expert/protocol/convertibles/expert.document.location.ex rename to apps/forge/lib/forge/convertibles/forge.document.location.ex index 8fc353d9..6d9be44d 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.document.location.ex +++ b/apps/forge/lib/forge/convertibles/forge.document.location.ex @@ -1,12 +1,12 @@ -defimpl Forge.Convertible, for: Forge.Document.Location do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types +defimpl Forge.Protocol.Convertible, for: Forge.Document.Location do + alias Forge.Protocol.Conversions alias Forge.Document + alias GenLSP.Structures def to_lsp(%Document.Location{} = location) do with {:ok, range} <- Conversions.to_lsp(location.range) do uri = Document.Location.uri(location) - {:ok, Types.Location.new(uri: uri, range: range)} + {:ok, %Structures.Location{uri: uri, range: range}} end end diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.document.position.ex b/apps/forge/lib/forge/convertibles/forge.document.position.ex similarity index 67% rename from apps/protocol/lib/expert/protocol/convertibles/expert.document.position.ex rename to apps/forge/lib/forge/convertibles/forge.document.position.ex index b2a251af..ecf15678 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.document.position.ex +++ b/apps/forge/lib/forge/convertibles/forge.document.position.ex @@ -1,5 +1,5 @@ -defimpl Forge.Convertible, for: Forge.Document.Position do - alias Expert.Protocol.Conversions +defimpl Forge.Protocol.Convertible, for: Forge.Document.Position do + alias Forge.Protocol.Conversions alias Forge.Document def to_lsp(%Document.Position{} = position) do diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.document.range.ex b/apps/forge/lib/forge/convertibles/forge.document.range.ex similarity index 66% rename from apps/protocol/lib/expert/protocol/convertibles/expert.document.range.ex rename to apps/forge/lib/forge/convertibles/forge.document.range.ex index f653a855..36b1eb3e 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.document.range.ex +++ b/apps/forge/lib/forge/convertibles/forge.document.range.ex @@ -1,5 +1,5 @@ -defimpl Forge.Convertible, for: Forge.Document.Range do - alias Expert.Protocol.Conversions +defimpl Forge.Protocol.Convertible, for: Forge.Document.Range do + alias Forge.Protocol.Conversions alias Forge.Document def to_lsp(%Document.Range{} = range) do diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.location.ex b/apps/forge/lib/forge/convertibles/gen_lsp.structures.location.ex similarity index 54% rename from apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.location.ex rename to apps/forge/lib/forge/convertibles/gen_lsp.structures.location.ex index 8f5e8da0..4c5a6456 100644 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.location.ex +++ b/apps/forge/lib/forge/convertibles/gen_lsp.structures.location.ex @@ -1,16 +1,16 @@ -defimpl Forge.Convertible, for: Expert.Protocol.Types.Location do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types - alias Forge.Document.Container +defimpl Forge.Protocol.Convertible, for: GenLSP.Structures.Location do alias Forge.Document + alias Forge.Document.Container + alias Forge.Protocol.Conversions + alias GenLSP.Structures - def to_lsp(%Types.Location{} = location) do + def to_lsp(%Structures.Location{} = location) do with {:ok, range} <- Conversions.to_lsp(location.range) do - {:ok, %Types.Location{location | range: range}} + {:ok, %Structures.Location{location | range: range}} end end - def to_native(%Types.Location{} = location, context_document) do + def to_native(%Structures.Location{} = location, context_document) do context_document = Container.context_document(location, context_document) with {:ok, range} <- Conversions.to_elixir(location.range, context_document) do diff --git a/apps/forge/lib/forge/convertibles/gen_lsp.structures.position.ex b/apps/forge/lib/forge/convertibles/gen_lsp.structures.position.ex new file mode 100644 index 00000000..de80f109 --- /dev/null +++ b/apps/forge/lib/forge/convertibles/gen_lsp.structures.position.ex @@ -0,0 +1,12 @@ +defimpl Forge.Protocol.Convertible, for: GenLSP.Structures.Position do + alias GenLSP.Structures.Position + alias Forge.Protocol.Conversions + + def to_lsp(%Position{} = position) do + Conversions.to_lsp(position) + end + + def to_native(%Position{} = position, context_document) do + Conversions.to_elixir(position, context_document) + end +end diff --git a/apps/forge/lib/forge/convertibles/gen_lsp.structures.range.ex b/apps/forge/lib/forge/convertibles/gen_lsp.structures.range.ex new file mode 100644 index 00000000..a82e57dc --- /dev/null +++ b/apps/forge/lib/forge/convertibles/gen_lsp.structures.range.ex @@ -0,0 +1,24 @@ +defimpl Forge.Protocol.Convertible, for: GenLSP.Structures.Range do + alias GenLSP.Structures.Range + alias GenLSP.Structures.Position + alias Forge.Protocol.Conversions + + def to_lsp(%Range{} = range) do + Conversions.to_lsp(range) + end + + def to_native( + %Range{ + start: %Position{line: start_line, character: start_character}, + end: %Position{line: end_line, character: end_character} + } = range, + _context_document + ) + when start_line < 0 or start_character < 0 or end_line < 0 or end_character < 0 do + {:error, {:invalid_range, range}} + end + + def to_native(%Range{} = range, context_document) do + Conversions.to_elixir(range, context_document) + end +end diff --git a/apps/forge/lib/forge/convertibles/gen_lsp.structures.text_edit.ex b/apps/forge/lib/forge/convertibles/gen_lsp.structures.text_edit.ex new file mode 100644 index 00000000..5586ead3 --- /dev/null +++ b/apps/forge/lib/forge/convertibles/gen_lsp.structures.text_edit.ex @@ -0,0 +1,22 @@ +defimpl Forge.Protocol.Convertible, for: GenLSP.Structures.TextEdit do + alias Forge.Document + alias Forge.Protocol.Conversions + alias GenLSP.Structures + + def to_lsp(%Structures.TextEdit{} = text_edit) do + with {:ok, range} <- Conversions.to_lsp(text_edit.range) do + {:ok, %Structures.TextEdit{text_edit | range: range}} + end + end + + def to_native(%Structures.TextEdit{range: nil} = text_edit, _context_document) do + {:ok, Document.Edit.new(text_edit.new_text)} + end + + def to_native(%Structures.TextEdit{} = text_edit, context_document) do + with {:ok, %Document.Range{} = range} <- + Conversions.to_elixir(text_edit.range, context_document) do + {:ok, Document.Edit.new(text_edit.new_text, range)} + end + end +end diff --git a/apps/forge/lib/forge/document.ex b/apps/forge/lib/forge/document.ex index 099826c5..63da346c 100644 --- a/apps/forge/lib/forge/document.ex +++ b/apps/forge/lib/forge/document.ex @@ -6,13 +6,13 @@ defmodule Forge.Document do All language server documents are represented and backed by documents, which provide functionality for fetching lines, applying changes, and tracking versions. """ - alias Forge.Convertible alias Forge.Document.Edit alias Forge.Document.Line alias Forge.Document.Lines alias Forge.Document.Position alias Forge.Document.Range alias Forge.Math + alias Forge.Protocol.Convertible import Forge.Document.Line @@ -129,7 +129,7 @@ defmodule Forge.Document do Builds a string that represents the text of the document from the two positions given. The from position, defaults to `:beginning` meaning the start of the document. Positions can be a `Document.Position.t` or anything that will convert to a position using - `Forge.Convertible.to_native/2`. + `Forge.Protocol.Convertible.to_native/2`. """ @spec fragment(t, fragment_position() | :beginning, fragment_position()) :: String.t() @spec fragment(t, fragment_position()) :: String.t() @@ -304,6 +304,10 @@ defmodule Forge.Document do end end + defp apply_change(%__MODULE__{} = document, %{text: text}) do + apply_change(document, Edit.new(text, nil)) + end + defp apply_change(%__MODULE__{} = document, convertable_edit) do with {:ok, edit} <- Convertible.to_native(convertable_edit, document) do apply_change(document, edit) diff --git a/apps/protocol/lib/expert/protocol/conversions.ex b/apps/forge/lib/forge/protocol/conversions.ex similarity index 93% rename from apps/protocol/lib/expert/protocol/conversions.ex rename to apps/forge/lib/forge/protocol/conversions.ex index 7b0b03de..dbc77fc8 100644 --- a/apps/protocol/lib/expert/protocol/conversions.ex +++ b/apps/forge/lib/forge/protocol/conversions.ex @@ -1,4 +1,4 @@ -defmodule Expert.Protocol.Conversions do +defmodule Forge.Protocol.Conversions do @moduledoc """ Functions to convert between language server representations and elixir-native representations. @@ -7,8 +7,6 @@ defmodule Expert.Protocol.Conversions do the line contains non-ascii characters. If it's a pure ascii line, then the positions are the same in both utf-8 and utf-16, since they reference characters and not bytes. """ - alias Expert.Protocol.Types.Position, as: LSPosition - alias Expert.Protocol.Types.Range, as: LSRange alias Forge.CodeUnit alias Forge.Document alias Forge.Document.Line @@ -16,6 +14,8 @@ defmodule Expert.Protocol.Conversions do alias Forge.Document.Position, as: ElixirPosition alias Forge.Document.Range, as: ElixirRange alias Forge.Math + alias GenLSP.Structures.Position, as: LSPosition + alias GenLSP.Structures.Range, as: LSRange import Line @@ -90,7 +90,7 @@ defmodule Expert.Protocol.Conversions do def to_lsp(%LSRange{} = ls_range) do with {:ok, start_pos} <- to_lsp(ls_range.start), {:ok, end_pos} <- to_lsp(ls_range.end) do - {:ok, LSRange.new(start: start_pos, end: end_pos)} + {:ok, %LSRange{start: start_pos, end: end_pos}} end end @@ -111,18 +111,18 @@ defmodule Expert.Protocol.Conversions do # allow a line one more than the document size, as long as the character is 0. # that means we're operating on the last line of the document - {:ok, LSPosition.new(line: document_line_number, character: 0)} + {:ok, %LSPosition{line: document_line_number, character: 0}} position.line > line_count -> - {:ok, LSPosition.new(line: line_count, character: 0)} + {:ok, %LSPosition{line: line_count, character: 0}} true -> with {:ok, lsp_character} <- extract_lsp_character(position) do ls_pos = - LSPosition.new( + %LSPosition{ character: lsp_character, line: position.line - position.starting_index - ) + } {:ok, ls_pos} end diff --git a/apps/proto/lib/expert/proto/convert.ex b/apps/forge/lib/forge/protocol/convert.ex similarity index 69% rename from apps/proto/lib/expert/proto/convert.ex rename to apps/forge/lib/forge/protocol/convert.ex index 8c44d1fb..0a841066 100644 --- a/apps/proto/lib/expert/proto/convert.ex +++ b/apps/forge/lib/forge/protocol/convert.ex @@ -1,6 +1,6 @@ -defmodule Expert.Proto.Convert do - alias Forge.Convertible +defmodule Forge.Protocol.Convert do alias Forge.Document + alias Forge.Protocol.Convertible def to_lsp(%_{result: result} = response) do case Convertible.to_lsp(result) do @@ -16,17 +16,17 @@ defmodule Expert.Proto.Convert do Convertible.to_lsp(other) end - def to_native(%{lsp: request_or_notification} = original_request) do + def to_native(%{params: request_or_notification} = original_request) do context_document = Document.Container.context_document(request_or_notification, nil) with {:ok, native_request} <- Convertible.to_native(request_or_notification, context_document) do updated_request = - case Map.merge(original_request, Map.from_struct(native_request)) do + case Map.merge(request_or_notification, Map.from_struct(native_request)) do %_{document: _} = updated -> Map.put(updated, :document, context_document) updated -> updated end - {:ok, updated_request} + {:ok, %{original_request | params: updated_request}} end end end diff --git a/apps/forge/lib/forge/convertible.ex b/apps/forge/lib/forge/protocol/convertible.ex similarity index 91% rename from apps/forge/lib/forge/convertible.ex rename to apps/forge/lib/forge/protocol/convertible.ex index 3a58df3f..380b71a8 100644 --- a/apps/forge/lib/forge/convertible.ex +++ b/apps/forge/lib/forge/protocol/convertible.ex @@ -1,4 +1,4 @@ -defmodule Forge.Convertible.Helpers do +defmodule Forge.Protocol.Convertible.Helpers do @moduledoc false alias Forge.Document @@ -83,7 +83,7 @@ defmodule Forge.Convertible.Helpers do end end -defprotocol Forge.Convertible do +defprotocol Forge.Protocol.Convertible do @moduledoc """ A protocol that details conversions to and from Language Server idioms @@ -133,9 +133,9 @@ defprotocol Forge.Convertible do def to_lsp(t) end -defimpl Forge.Convertible, for: List do - alias Forge.Convertible - alias Forge.Convertible.Helpers +defimpl Forge.Protocol.Convertible, for: List do + alias Forge.Protocol.Convertible + alias Forge.Protocol.Convertible.Helpers def to_native(l, context_document) do case Helpers.apply(l, &Convertible.to_native/2, context_document) do @@ -152,9 +152,9 @@ defimpl Forge.Convertible, for: List do end end -defimpl Forge.Convertible, for: Map do - alias Forge.Convertible - alias Forge.Convertible.Helpers +defimpl Forge.Protocol.Convertible, for: Map do + alias Forge.Protocol.Convertible + alias Forge.Protocol.Convertible.Helpers def to_native(map, context_document) do case Helpers.apply(map, &Convertible.to_native/2, context_document) do @@ -168,9 +168,9 @@ defimpl Forge.Convertible, for: Map do end end -defimpl Forge.Convertible, for: Any do - alias Forge.Convertible - alias Forge.Convertible.Helpers +defimpl Forge.Protocol.Convertible, for: Any do + alias Forge.Protocol.Convertible + alias Forge.Protocol.Convertible.Helpers alias Forge.Document def to_native(%_struct_module{} = struct, context_document) do diff --git a/apps/forge/lib/forge/protocol/error_response.ex b/apps/forge/lib/forge/protocol/error_response.ex new file mode 100644 index 00000000..0c4d6fb5 --- /dev/null +++ b/apps/forge/lib/forge/protocol/error_response.ex @@ -0,0 +1,21 @@ +defmodule Forge.Protocol.ErrorResponse do + import Schematic + + alias GenLSP.ErrorResponse + + @type t :: %__MODULE__{ + id: integer(), + error: ErrorResponse.t(), + jsonrpc: String.t() + } + + defstruct [:id, :error, jsonrpc: "2.0"] + + def schematic do + schema(__MODULE__, %{ + id: int(), + error: ErrorResponse.schematic(), + jsonrpc: "2.0" + }) + end +end diff --git a/apps/protocol/lib/expert/protocol/id.ex b/apps/forge/lib/forge/protocol/id.ex similarity index 61% rename from apps/protocol/lib/expert/protocol/id.ex rename to apps/forge/lib/forge/protocol/id.ex index 220f0fe0..e5a49881 100644 --- a/apps/protocol/lib/expert/protocol/id.ex +++ b/apps/forge/lib/forge/protocol/id.ex @@ -1,7 +1,6 @@ -defmodule Expert.Protocol.Id do +defmodule Forge.Protocol.Id do def next do [:monotonic, :positive] |> System.unique_integer() - |> to_string() end end diff --git a/apps/protocol/lib/expert/protocol/json_rpc.ex b/apps/forge/lib/forge/protocol/json_rpc.ex similarity index 77% rename from apps/protocol/lib/expert/protocol/json_rpc.ex rename to apps/forge/lib/forge/protocol/json_rpc.ex index 5f0139ae..b8f499c0 100644 --- a/apps/protocol/lib/expert/protocol/json_rpc.ex +++ b/apps/forge/lib/forge/protocol/json_rpc.ex @@ -1,7 +1,4 @@ -defmodule Expert.Protocol.JsonRpc do - alias Expert.Protocol.Notifications - alias Expert.Protocol.Requests - +defmodule Forge.Protocol.JsonRpc do require Logger @crlf "\r\n" @@ -38,10 +35,6 @@ defmodule Expert.Protocol.JsonRpc do {:error, :empty_response} end - defp do_decode(%{"method" => method, "id" => _id} = request) do - Requests.decode(method, request) - end - defp do_decode(%{"id" => _id, "result" => _result} = response) do # this is due to a client -> server message, but we can't decode it properly yet. # since we can't match up the response type to the message. @@ -49,7 +42,11 @@ defmodule Expert.Protocol.JsonRpc do {:ok, response} end - defp do_decode(%{"method" => method} = notification) do - Notifications.decode(method, notification) + defp do_decode(%{"method" => _, "id" => _id} = request) do + GenLSP.Requests.new(request) + end + + defp do_decode(%{"method" => _} = notification) do + GenLSP.Notifications.new(notification) end end diff --git a/apps/forge/lib/forge/protocol/response.ex b/apps/forge/lib/forge/protocol/response.ex new file mode 100644 index 00000000..9cc9eda3 --- /dev/null +++ b/apps/forge/lib/forge/protocol/response.ex @@ -0,0 +1,19 @@ +defmodule Forge.Protocol.Response do + import Schematic + + defstruct [:id, :result, jsonrpc: "2.0"] + + @type t() :: %__MODULE__{ + id: integer(), + result: any(), + jsonrpc: String.t() + } + + def schematic do + schema(__MODULE__, %{ + id: int(), + result: any(), + jsonrpc: "2.0" + }) + end +end diff --git a/apps/forge/mix.exs b/apps/forge/mix.exs index b2c63c05..f90c65aa 100644 --- a/apps/forge/mix.exs +++ b/apps/forge/mix.exs @@ -34,6 +34,9 @@ defmodule Forge.MixProject do {:benchee, "~> 1.3", only: :test}, Mix.Credo.dependency(), Mix.Dialyzer.dependency(), + {:gen_lsp, "~> 0.10"}, + {:jason, "~> 1.4"}, + {:schematic, "~> 0.2"}, {:snowflake, "~> 1.0"}, {:sourceror, "~> 1.9"}, {:stream_data, "~> 1.1", only: [:test], runtime: false}, diff --git a/apps/forge/mix.lock b/apps/forge/mix.lock index 79ae9a96..b0c0efb1 100644 --- a/apps/forge/mix.lock +++ b/apps/forge/mix.lock @@ -6,10 +6,15 @@ "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "gen_lsp": {:hex, :gen_lsp, "0.10.0", "f6da076b5ccedf937d17aa9743635a2c3d0f31265c853e58b02ab84d71852270", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "768f8f7b5c5e218fb36dcebd30dcd6275b61ca77052c98c3c4c0375158392c4a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "patch": {:hex, :patch, "0.15.0", "947dd6a8b24a2d2d1137721f20bb96a8feb4f83248e7b4ad88b4871d52807af5", [:mix], [], "hexpm", "e8dadf9b57b30e92f6b2b1ce2f7f57700d14c66d4ed56ee27777eb73fb77e58d"}, + "schematic": {:hex, :schematic, "0.2.1", "0b091df94146fd15a0a343d1bd179a6c5a58562527746dadd09477311698dbb1", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0b255d65921e38006138201cd4263fd8bb807d9dfc511074615cd264a571b3b1"}, "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "1.1.3", "15fdb14c64e84437901258bb56fc7d80aaf6ceaf85b9324f359e219241353bfb", [:mix], [], "hexpm", "859eb2be72d74be26c1c4f272905667672a52e44f743839c57c7ee73a1a66420"}, + "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, } diff --git a/apps/protocol/test/expert/protocol/conversions_test.exs b/apps/forge/test/forge/conversions_test.exs similarity index 95% rename from apps/protocol/test/expert/protocol/conversions_test.exs rename to apps/forge/test/forge/conversions_test.exs index d3f483de..774e34ce 100644 --- a/apps/protocol/test/expert/protocol/conversions_test.exs +++ b/apps/forge/test/forge/conversions_test.exs @@ -1,13 +1,13 @@ defmodule Expert.Protocol.ConversionsTest do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types.Position, as: LSPosition alias Forge.Document alias Forge.Document.Position, as: ExPosition + alias Forge.Protocol.Conversions + alias GenLSP.Structures.Position, as: LSPosition use ExUnit.Case defp lsp_position(line, char) do - LSPosition.new(line: line, character: char) + %LSPosition{line: line, character: char} end defp ex_position(document, line, char) do diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.document.changes_test.exs b/apps/forge/test/forge/convertibles/forge.document.changes_test.exs similarity index 78% rename from apps/protocol/test/expert/protocol/convertibles/expert.document.changes_test.exs rename to apps/forge/test/forge/convertibles/forge.document.changes_test.exs index c592659b..3d721631 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.document.changes_test.exs +++ b/apps/forge/test/forge/convertibles/forge.document.changes_test.exs @@ -1,5 +1,6 @@ -defmodule Forge.Convertible.Document.ChangesTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule Forge.Protocol.Convertible.Document.ChangesTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] @@ -8,7 +9,7 @@ defmodule Forge.Convertible.Document.ChangesTest do edit = Document.Edit.new("hi", valid_range(:native, document)) document_edits = Document.Changes.new(document, [edit]) - assert {:ok, [%Types.TextEdit{}]} = to_lsp(document_edits, uri) + assert {:ok, [%Structures.TextEdit{}]} = to_lsp(document_edits, uri) end test "uses the uri from the document edits", %{uri: uri} do @@ -25,7 +26,7 @@ defmodule Forge.Convertible.Document.ChangesTest do document_edits = Document.Changes.new(document, [edit]) - assert {:ok, [%Types.TextEdit{}]} = to_lsp(document_edits, uri) + assert {:ok, [%Structures.TextEdit{}]} = to_lsp(document_edits, uri) end end diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.document.edit_test.exs b/apps/forge/test/forge/convertibles/forge.document.edit_test.exs similarity index 69% rename from apps/protocol/test/expert/protocol/convertibles/expert.document.edit_test.exs rename to apps/forge/test/forge/convertibles/forge.document.edit_test.exs index 842519dc..7ba08260 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.document.edit_test.exs +++ b/apps/forge/test/forge/convertibles/forge.document.edit_test.exs @@ -1,5 +1,6 @@ -defmodule Expert.Protocol.Convertibles.EditTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule Forge.Protocol.Convertibles.EditTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport defmodule Inner do defstruct [:position] @@ -13,22 +14,23 @@ defmodule Expert.Protocol.Convertibles.EditTest do setup [:with_an_open_file] test "leaves protocol text edits alone", %{uri: uri} do - lsp_text_edit = Types.TextEdit.new(new_text: "hi", range: valid_range(:lsp)) + lsp_text_edit = %Structures.TextEdit{new_text: "hi", range: valid_range(:lsp)} {:ok, ^lsp_text_edit} = to_lsp(lsp_text_edit, uri) end test "converts with no range", %{uri: uri} do - assert {:ok, %Types.TextEdit{new_text: "hi"}} = to_lsp(Document.Edit.new("hi"), uri) + assert {:ok, %Structures.TextEdit{new_text: "hi"}} = to_lsp(Document.Edit.new("hi"), uri) end test "converts with a filled in range", %{uri: uri, document: document} do ex_range = range(:native, valid_position(:native, document), position(:native, document, 1, 3)) - assert {:ok, %Types.TextEdit{} = text_edit} = to_lsp(Document.Edit.new("hi", ex_range), uri) + assert {:ok, %Structures.TextEdit{} = text_edit} = + to_lsp(Document.Edit.new("hi", ex_range), uri) assert text_edit.new_text == "hi" - assert %Types.Range{} = range = text_edit.range + assert %Structures.Range{} = range = text_edit.range assert range.start.line == 0 assert range.start.character == 0 assert range.end.line == 0 @@ -40,7 +42,7 @@ defmodule Expert.Protocol.Convertibles.EditTest do setup [:with_an_open_file] test "converts a text edit with no range", %{uri: uri} do - proto_edit = Types.TextEdit.new(new_text: "hi", range: nil) + proto_edit = %Structures.TextEdit{new_text: "hi", range: nil} assert {:ok, %Document.Edit{} = edit} = to_native(proto_edit, uri) diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.document.location_test.exs b/apps/forge/test/forge/convertibles/forge.document.location_test.exs similarity index 73% rename from apps/protocol/test/expert/protocol/convertibles/expert.document.location_test.exs rename to apps/forge/test/forge/convertibles/forge.document.location_test.exs index 195db11c..a7677f82 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.document.location_test.exs +++ b/apps/forge/test/forge/convertibles/forge.document.location_test.exs @@ -1,5 +1,6 @@ -defmodule Expert.Protocol.Convertibles.LocationTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule Forge.Protocol.Convertibles.LocationTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] @@ -9,9 +10,9 @@ defmodule Expert.Protocol.Convertibles.LocationTest do assert {:ok, converted} = to_lsp(location, uri) assert converted.uri == uri - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end test "converts a location with a source file", %{uri: uri, document: document} do @@ -19,9 +20,9 @@ defmodule Expert.Protocol.Convertibles.LocationTest do assert {:ok, converted} = to_lsp(location, uri) assert converted.uri == document.uri - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end test "uses the location's uri", %{uri: uri, document: document} do diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.document.position_test.exs b/apps/forge/test/forge/convertibles/forge.document.position_test.exs similarity index 84% rename from apps/protocol/test/expert/protocol/convertibles/expert.document.position_test.exs rename to apps/forge/test/forge/convertibles/forge.document.position_test.exs index 0e054b72..5f7f0a9a 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.document.position_test.exs +++ b/apps/forge/test/forge/convertibles/forge.document.position_test.exs @@ -1,5 +1,6 @@ -defmodule Expert.Protocol.Convertibles.PositionTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule Forge.Protocol.Convertibles.PositionTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport defmodule Inner do defstruct [:position] @@ -13,7 +14,7 @@ defmodule Expert.Protocol.Convertibles.PositionTest do setup [:with_an_open_file] test "converts valid positions", %{uri: uri, document: document} do - assert {:ok, %Types.Position{} = pos} = to_lsp(valid_position(:native, document), uri) + assert {:ok, %Structures.Position{} = pos} = to_lsp(valid_position(:native, document), uri) assert pos.line == 0 assert pos.character == 0 end @@ -25,7 +26,7 @@ defmodule Expert.Protocol.Convertibles.PositionTest do assert {:ok, converted} = to_lsp(nested, uri) - assert %Types.Position{} = converted.inner.position + assert %Structures.Position{} = converted.inner.position end test "leaves protocol positions alone", %{uri: uri} do diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.document.range_test.exs b/apps/forge/test/forge/convertibles/forge.document.range_test.exs similarity index 71% rename from apps/protocol/test/expert/protocol/convertibles/expert.document.range_test.exs rename to apps/forge/test/forge/convertibles/forge.document.range_test.exs index dfc845bf..be3e3bcf 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.document.range_test.exs +++ b/apps/forge/test/forge/convertibles/forge.document.range_test.exs @@ -1,5 +1,6 @@ -defmodule Expert.Protocol.Convertibles.RangeTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule Forge.Protocol.Convertibles.RangeTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] @@ -8,9 +9,9 @@ defmodule Expert.Protocol.Convertibles.RangeTest do native_range = range(:native, position(:native, document, 1, 1), position(:native, document, 1, 3)) - assert {:ok, %Types.Range{} = range} = to_lsp(native_range, uri) - assert %Types.Position{} = range.start - assert %Types.Position{} = range.end + assert {:ok, %Structures.Range{} = range} = to_lsp(native_range, uri) + assert %Structures.Position{} = range.start + assert %Structures.Position{} = range.end end test "leaves protocol ranges alone", %{uri: uri} do @@ -24,9 +25,9 @@ defmodule Expert.Protocol.Convertibles.RangeTest do assert %Document.Position{} = lsp_range.start - assert {:ok, %Types.Range{} = converted} = to_lsp(lsp_range, uri) - assert %Types.Position{} = converted.start - assert %Types.Position{} = converted.end + assert {:ok, %Structures.Range{} = converted} = to_lsp(lsp_range, uri) + assert %Structures.Position{} = converted.start + assert %Structures.Position{} = converted.end end end diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.location_test.exs b/apps/forge/test/forge/convertibles/gen_lsp.structures.location_test.exs similarity index 57% rename from apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.location_test.exs rename to apps/forge/test/forge/convertibles/gen_lsp.structures.location_test.exs index c8065353..df27b1b8 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.location_test.exs +++ b/apps/forge/test/forge/convertibles/gen_lsp.structures.location_test.exs @@ -1,5 +1,6 @@ -defmodule Expert.Protocol.Types.Convertibles.LocationTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule GenLsp.Structures.Convertibles.LocationTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] @@ -7,47 +8,47 @@ defmodule Expert.Protocol.Types.Convertibles.LocationTest do test "converts a native location", %{uri: uri, document: document} do native_loc = Document.Location.new(valid_range(:native, document), uri) - assert {:ok, %Types.Location{} = converted} = to_lsp(native_loc, uri) + assert {:ok, %Structures.Location{} = converted} = to_lsp(native_loc, uri) assert converted.uri == uri - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end test "uses the location's uri", %{uri: uri, document: document} do other_uri = "file:///other.ex" native_loc = Document.Location.new(valid_range(:native, document), other_uri) - assert {:ok, %Types.Location{} = converted} = to_lsp(native_loc, uri) + assert {:ok, %Structures.Location{} = converted} = to_lsp(native_loc, uri) assert converted.uri == other_uri end test "converts a lsp location with a native range", %{uri: uri, document: document} do - lsp_loc = Types.Location.new(range: valid_range(:native, document), uri: uri) + lsp_loc = %Structures.Location{range: valid_range(:native, document), uri: uri} - assert {:ok, %Types.Location{} = converted} = to_lsp(lsp_loc, uri) + assert {:ok, %Structures.Location{} = converted} = to_lsp(lsp_loc, uri) assert converted.uri == uri - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end test "converts a lsp location with a native position", %{uri: uri, document: document} do lsp_loc = - Types.Location.new( + %Structures.Location{ range: range(:lsp, valid_position(:native, document), valid_position(:lsp)), uri: uri - ) + } - assert {:ok, %Types.Location{} = converted} = to_lsp(lsp_loc, uri) + assert {:ok, %Structures.Location{} = converted} = to_lsp(lsp_loc, uri) assert converted.uri == uri - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end end @@ -55,7 +56,7 @@ defmodule Expert.Protocol.Types.Convertibles.LocationTest do setup [:with_an_open_file] test "converts an lsp location", %{uri: uri} do - lsp_loc = Types.Location.new(range: valid_range(:lsp), uri: uri) + lsp_loc = %Structures.Location{range: valid_range(:lsp), uri: uri} assert {:ok, %Document.Location{} = converted} = to_native(lsp_loc, uri) @@ -67,7 +68,7 @@ defmodule Expert.Protocol.Types.Convertibles.LocationTest do test "uses the location's uri", %{uri: uri} do other_uri = "file:///other.ex" - lsp_loc = Types.Location.new(range: valid_range(:lsp), uri: other_uri) + lsp_loc = %Structures.Location{range: valid_range(:lsp), uri: other_uri} assert {:ok, %Document.Location{} = converted} = to_native(lsp_loc, uri) diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.position_test.exs b/apps/forge/test/forge/convertibles/gen_lsp.structures.position_test.exs similarity index 80% rename from apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.position_test.exs rename to apps/forge/test/forge/convertibles/gen_lsp.structures.position_test.exs index 570a62d1..01f9fd8f 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.position_test.exs +++ b/apps/forge/test/forge/convertibles/gen_lsp.structures.position_test.exs @@ -1,12 +1,13 @@ -defmodule Expert.Protocol.Types.Convertibles.PositionTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule GenLSP.Structures.Convertibles.PositionTest do + alias GenLSP.Structures + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] test "converts native position", %{uri: uri, document: document} do native_pos = valid_position(:native, document) - assert {:ok, %Types.Position{}} = to_lsp(native_pos, uri) + assert {:ok, %Structures.Position{}} = to_lsp(native_pos, uri) end test "leaves protocol ranges alone", %{uri: uri} do diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.range_test.exs b/apps/forge/test/forge/convertibles/gen_lsp.structures.range_test.exs similarity index 87% rename from apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.range_test.exs rename to apps/forge/test/forge/convertibles/gen_lsp.structures.range_test.exs index 62124eb0..0755c7c8 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.range_test.exs +++ b/apps/forge/test/forge/convertibles/gen_lsp.structures.range_test.exs @@ -1,5 +1,5 @@ -defmodule Expert.Protocol.Types.Convertibles.RangeTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule GenLSP.Structures.Convertibles.RangeTest do + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2" do setup [:with_an_open_file] @@ -8,10 +8,10 @@ defmodule Expert.Protocol.Types.Convertibles.RangeTest do native_range = range(:native, position(:native, document, 1, 1), position(:native, document, 1, 3)) - assert {:ok, %Types.Range{} = range} = to_lsp(native_range, uri) + assert {:ok, %Structures.Range{} = range} = to_lsp(native_range, uri) - assert %Types.Position{} = range.start - assert %Types.Position{} = range.end + assert %Structures.Position{} = range.start + assert %Structures.Position{} = range.end end test "leaves protocol ranges alone", %{uri: uri} do @@ -25,7 +25,7 @@ defmodule Expert.Protocol.Types.Convertibles.RangeTest do assert %Document.Position{} = lsp_range.start assert {:ok, converted} = to_lsp(lsp_range, uri) - assert %Types.Position{} = converted.start + assert %Structures.Position{} = converted.start end end diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_edit_test.exs b/apps/forge/test/forge/convertibles/gen_lsp.structures.text_edit_test.exs similarity index 67% rename from apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_edit_test.exs rename to apps/forge/test/forge/convertibles/gen_lsp.structures.text_edit_test.exs index ef8668f8..891f14f9 100644 --- a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_edit_test.exs +++ b/apps/forge/test/forge/convertibles/gen_lsp.structures.text_edit_test.exs @@ -1,34 +1,34 @@ -defmodule Expert.Protocol.Convertibles.TextEditTest do - use Expert.Test.Protocol.ConvertibleSupport +defmodule GenLSP.Structures.Convertibles.TextEditTest do + use Forge.Test.Protocol.ConvertibleSupport describe "to_lsp/2)" do setup [:with_an_open_file] test "leaves text edits alone", %{uri: uri} do - native_text_edit = Types.TextEdit.new(new_text: "hi", range: valid_range(:lsp)) + native_text_edit = %Structures.TextEdit{new_text: "hi", range: valid_range(:lsp)} assert {:ok, ^native_text_edit} = to_lsp(native_text_edit, uri) end test "converts native positions in text edits", %{uri: uri, document: document} do text_edit = - Types.TextEdit.new( + %Structures.TextEdit{ new_text: "hi", range: range(:lsp, valid_position(:native, document), valid_position(:lsp)) - ) + } assert %Document.Position{} = text_edit.range.start assert {:ok, converted} = to_lsp(text_edit, uri) - assert %Types.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.start end test "converts native ranges in text edits", %{uri: uri, document: document} do - text_edit = Types.TextEdit.new(new_text: "hi", range: valid_range(:native, document)) + text_edit = %Structures.TextEdit{new_text: "hi", range: valid_range(:native, document)} assert %Document.Range{} = text_edit.range assert {:ok, converted} = to_lsp(text_edit, uri) - assert %Types.Range{} = converted.range - assert %Types.Position{} = converted.range.start - assert %Types.Position{} = converted.range.end + assert %Structures.Range{} = converted.range + assert %Structures.Position{} = converted.range.start + assert %Structures.Position{} = converted.range.end end end @@ -36,7 +36,7 @@ defmodule Expert.Protocol.Convertibles.TextEditTest do setup [:with_an_open_file] test "converts to edits", %{uri: uri} do - text_edit = Types.TextEdit.new(new_text: "Hi", range: valid_range(:lsp)) + text_edit = %Structures.TextEdit{new_text: "Hi", range: valid_range(:lsp)} {:ok, converted} = to_native(text_edit, uri) @@ -49,10 +49,10 @@ defmodule Expert.Protocol.Convertibles.TextEditTest do test "fails conversion gracefully", %{uri: uri} do edit = - Types.TextEdit.new( + %Structures.TextEdit{ new_text: "hi", range: range(:lsp, position(:lsp, -1, 0), valid_position(:lsp)) - ) + } assert {:error, {:invalid_range, _}} = to_native(edit, uri) end diff --git a/apps/protocol/test/support/test/convertible_support.ex b/apps/forge/test/support/test/convertible_support.ex similarity index 82% rename from apps/protocol/test/support/test/convertible_support.ex rename to apps/forge/test/support/test/convertible_support.ex index 90993dc0..05675200 100644 --- a/apps/protocol/test/support/test/convertible_support.ex +++ b/apps/forge/test/support/test/convertible_support.ex @@ -1,12 +1,12 @@ -defmodule Expert.Test.Protocol.ConvertibleSupport do - alias Forge.Convertible +defmodule Forge.Test.Protocol.ConvertibleSupport do alias Forge.Document + alias Forge.Protocol.Convertible use ExUnit.CaseTemplate using do quote location: :keep do - alias Expert.Protocol.Types + alias GenLSP.Structures use Forge.Test.DocumentSupport def open_file_contents do @@ -36,7 +36,7 @@ defmodule Expert.Test.Protocol.ConvertibleSupport do def valid_range(:lsp) do start_pos = end_pos = valid_position(:lsp) - Types.Range.new(start: start_pos, end: end_pos) + %Structures.Range{start: start_pos, end: end_pos} end def range(:native, start_pos, end_pos) do @@ -44,7 +44,7 @@ defmodule Expert.Test.Protocol.ConvertibleSupport do end def range(:lsp, start_pos, end_pos) do - Types.Range.new(start: start_pos, end: end_pos) + %Structures.Range{start: start_pos, end: end_pos} end def valid_position(:native, document) do @@ -60,7 +60,7 @@ defmodule Expert.Test.Protocol.ConvertibleSupport do end def position(:lsp, line, character) do - Types.Position.new(line: line, character: character) + %Structures.Position{line: line, character: character} end end end diff --git a/apps/proto/.credo.exs b/apps/proto/.credo.exs deleted file mode 100644 index 0e9ed7f4..00000000 --- a/apps/proto/.credo.exs +++ /dev/null @@ -1,3 +0,0 @@ -Code.require_file("../../mix_credo.exs") - -Mix.Credo.config() diff --git a/apps/proto/.formatter.exs b/apps/proto/.formatter.exs deleted file mode 100644 index ff1e1790..00000000 --- a/apps/proto/.formatter.exs +++ /dev/null @@ -1,21 +0,0 @@ -# Used by "mix format" -proto_dsl = [ - defalias: 1, - defenum: 1, - defnotification: 1, - defnotification: 2, - defrequest: 1, - defrequest: 2, - defresponse: 1, - deftype: 1, - server_request: 2, - server_request: 3 -] - -[ - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"], - locals_without_parens: proto_dsl, - export: [ - locals_without_parens: proto_dsl - ] -] diff --git a/apps/proto/.gitignore b/apps/proto/.gitignore deleted file mode 100644 index 1b920c35..00000000 --- a/apps/proto/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# The directory Mix will write compiled artifacts to. -/_build/ - -# If you run "mix test --cover", coverage assets end up here. -/cover/ - -# The directory Mix downloads your dependencies sources to. -/deps/ - -# Where third-party dependencies like ExDoc output generated docs. -/doc/ - -# Ignore .fetch files in case you like to edit your project deps locally. -/.fetch - -# If the VM crashes, it generates a dump, let's ignore it too. -erl_crash.dump - -# Also ignore archive artifacts (built via "mix archive.build"). -*.ez - -# Ignore package tarball (built via "mix hex.build"). -proto-*.tar - -# Temporary files, for example, from tests. -/tmp/ diff --git a/apps/proto/README.md b/apps/proto/README.md deleted file mode 100644 index b33d96d3..00000000 --- a/apps/proto/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Proto - -A library used to generate and implement data structures for the Language Server Protocol diff --git a/apps/proto/lib/expert/proto.ex b/apps/proto/lib/expert/proto.ex deleted file mode 100644 index b45dda7b..00000000 --- a/apps/proto/lib/expert/proto.ex +++ /dev/null @@ -1,51 +0,0 @@ -defmodule Expert.Proto do - alias Expert.Proto.Decoders - - defmacro __using__([]) do - quote location: :keep do - alias Expert.Proto - alias Expert.Proto.LspTypes - - import Expert.Proto.TypeFunctions - import Proto.Alias, only: [defalias: 1] - import Proto.Enum, only: [defenum: 1] - import Proto.Notification, only: [defnotification: 1, defnotification: 2] - - import Proto.Request, - only: [defrequest: 1, defrequest: 2, server_request: 2, server_request: 3] - - import Proto.Response, only: [defresponse: 1] - import Proto.Type, only: [deftype: 1] - end - end - - defmacro __using__(opts) when is_list(opts) do - function_name = - case Keyword.get(opts, :decoders) do - :notifications -> - :for_notifications - - :requests -> - :for_requests - - _ -> - invalid_decoder!(__CALLER__) - end - - quote do - @before_compile {Decoders, unquote(function_name)} - end - end - - defmacro __using__(_) do - invalid_decoder!(__CALLER__) - end - - defp invalid_decoder!(caller) do - raise CompileError.exception( - description: "Invalid decoder type. Must be either :notifications or :requests", - file: caller.file, - line: caller.line - ) - end -end diff --git a/apps/proto/lib/expert/proto/alias.ex b/apps/proto/lib/expert/proto/alias.ex deleted file mode 100644 index 0d844da1..00000000 --- a/apps/proto/lib/expert/proto/alias.ex +++ /dev/null @@ -1,38 +0,0 @@ -defmodule Expert.Proto.Alias do - alias Expert.Proto.CompileMetadata - alias Expert.Proto.Field - alias Expert.Proto.Macros.Typespec - - defmacro defalias(alias_definition) do - caller_module = __CALLER__.module - CompileMetadata.add_type_alias_module(caller_module) - - quote location: :keep do - @type t :: unquote(Typespec.typespec(alias_definition, __CALLER__)) - - def parse(lsp_map) do - Field.extract(unquote(alias_definition), :alias, lsp_map) - end - - def definition do - unquote(alias_definition) - end - - def __meta__(:type) do - :type_alias - end - - def __meta__(:param_names) do - [] - end - - def __meta__(:definition) do - unquote(alias_definition) - end - - def __meta__(:raw_definition) do - unquote(Macro.escape(alias_definition)) - end - end - end -end diff --git a/apps/proto/lib/expert/proto/compile_metadata.ex b/apps/proto/lib/expert/proto/compile_metadata.ex deleted file mode 100644 index 60270a02..00000000 --- a/apps/proto/lib/expert/proto/compile_metadata.ex +++ /dev/null @@ -1,62 +0,0 @@ -defmodule Expert.Proto.CompileMetadata do - @moduledoc """ - Compile-time storage of protocol metadata - """ - - @notification_modules_key {__MODULE__, :notification_modules} - @type_modules_key {__MODULE__, :type_modules} - @type_alias_modules_key {__MODULE__, :type_alias_modules} - @request_modules_key {__MODULE__, :request_modules} - @response_modules_key {__MODULE__, :response_modules} - - def notification_modules do - :persistent_term.get(@notification_modules_key, []) - end - - def request_modules do - :persistent_term.get(@request_modules_key, []) - end - - def response_modules do - :persistent_term.get(@response_modules_key, []) - end - - def type_alias_modules do - :persistent_term.get(@type_alias_modules_key) - end - - def type_modules do - :persistent_term.get(@type_modules_key) - end - - def add_notification_module(module) do - add_module(@notification_modules_key, module) - end - - def add_request_module(module) do - add_module(@request_modules_key, module) - end - - def add_response_module(module) do - add_module(@response_modules_key, module) - end - - def add_type_module(module) do - add_module(@type_modules_key, module) - end - - def add_type_alias_module(module) do - add_module(@type_alias_modules_key, module) - end - - defp update(key, initial_value, update_fn) do - case :persistent_term.get(key, :not_found) do - :not_found -> :persistent_term.put(key, initial_value) - found -> :persistent_term.put(key, update_fn.(found)) - end - end - - defp add_module(key, module) do - update(key, [module], fn old_list -> [module | old_list] end) - end -end diff --git a/apps/proto/lib/expert/proto/decoders.ex b/apps/proto/lib/expert/proto/decoders.ex deleted file mode 100644 index 2c2fe4b1..00000000 --- a/apps/proto/lib/expert/proto/decoders.ex +++ /dev/null @@ -1,136 +0,0 @@ -defmodule Expert.Proto.Decoders do - alias Expert.Proto.CompileMetadata - alias Expert.Proto.Typespecs - - defmacro for_notifications(_) do - notification_modules = CompileMetadata.notification_modules() - notification_matchers = Enum.map(notification_modules, &build_notification_matcher_macro/1) - notification_decoders = Enum.map(notification_modules, &build_notifications_decoder/1) - - quote do - defmacro notification(method) do - quote do - %{"method" => unquote(method), "jsonrpc" => "2.0"} - end - end - - defmacro notification(method, params) do - quote do - %{"method" => unquote(method), "params" => unquote(params), "jsonrpc" => "2.0"} - end - end - - use Typespecs, for: :notifications - - unquote_splicing(notification_matchers) - - @spec decode(String.t(), map()) :: {:ok, notification} | {:error, any} - unquote_splicing(notification_decoders) - - def decode(method, _) do - {:error, {:unknown_notification, method}} - end - - def __meta__(:events) do - unquote(notification_modules) - end - - def __meta__(:notifications) do - unquote(notification_modules) - end - end - end - - defmacro for_requests(_) do - request_modules = CompileMetadata.request_modules() - request_matchers = Enum.map(request_modules, &build_request_matcher_macro/1) - request_decoders = Enum.map(request_modules, &build_request_decoder/1) - - quote do - def __meta__(:requests) do - unquote(request_modules) - end - - defmacro request(id, method) do - quote do - %{"method" => unquote(method), "id" => unquote(id), "jsonrpc" => "2.0"} - end - end - - defmacro request(id, method, params) do - quote do - %{"method" => unquote(method), "id" => unquote(id), "params" => unquote(params)} - end - end - - use Typespecs, for: :requests - - unquote_splicing(request_matchers) - - @spec decode(String.t(), map()) :: {:ok, request} | {:error, any} - unquote_splicing(request_decoders) - - def decode(method, _) do - {:error, {:unknown_request, method}} - end - end - end - - defp build_notification_matcher_macro(notification_module) do - macro_name = module_to_macro_name(notification_module) - method_name = notification_module.__meta__(:method_name) - - quote do - defmacro unquote(macro_name)() do - method_name = unquote(method_name) - - quote do - %{"method" => unquote(method_name), "jsonrpc" => "2.0"} - end - end - end - end - - defp build_notifications_decoder(notification_module) do - method_name = notification_module.__meta__(:method_name) - - quote do - def decode(unquote(method_name), request) do - unquote(notification_module).parse(request) - end - end - end - - defp build_request_matcher_macro(notification_module) do - macro_name = module_to_macro_name(notification_module) - method_name = notification_module.__meta__(:method_name) - - quote do - defmacro unquote(macro_name)(id) do - method_name = unquote(method_name) - - quote do - %{"method" => unquote(method_name), "id" => unquote(id), "jsonrpc" => "2.0"} - end - end - end - end - - defp build_request_decoder(request_module) do - method_name = request_module.__meta__(:method_name) - - quote do - def decode(unquote(method_name), request) do - unquote(request_module).parse(request) - end - end - end - - defp module_to_macro_name(module) do - module - |> Module.split() - |> List.last() - |> Macro.underscore() - |> String.to_atom() - end -end diff --git a/apps/proto/lib/expert/proto/enum.ex b/apps/proto/lib/expert/proto/enum.ex deleted file mode 100644 index 9db5e43a..00000000 --- a/apps/proto/lib/expert/proto/enum.ex +++ /dev/null @@ -1,89 +0,0 @@ -defmodule Expert.Proto.Enum do - alias Expert.Proto.Macros.Typespec - - defmacro defenum(opts) do - names = - opts - |> Keyword.keys() - |> Enum.map(&{:literal, [], &1}) - - value_type = - opts - |> Keyword.values() - |> List.first() - |> Macro.expand(__CALLER__) - |> determine_type() - - name_type = Typespec.choice(names, __CALLER__) - - quote location: :keep do - @type name :: unquote(name_type) - @type value :: unquote(value_type) - @type t :: name() | value() - - unquote(parse_functions(opts)) - - def parse(unknown) do - {:error, {:invalid_constant, unknown}} - end - - unquote_splicing(encoders(opts)) - - def encode(val) do - {:error, {:invalid_value, __MODULE__, val}} - end - - unquote_splicing(enum_macros(opts)) - - def __meta__(:types) do - {:constant, __MODULE__} - end - - def __meta__(:type) do - :enum - end - end - end - - defp determine_type(i) when is_integer(i) do - quote do - integer() - end - end - - defp determine_type(s) when is_binary(s) do - quote do - String.t() - end - end - - defp parse_functions(opts) do - for {name, value} <- opts do - quote location: :keep do - def parse(unquote(value)) do - {:ok, unquote(name)} - end - end - end - end - - defp enum_macros(opts) do - for {name, value} <- opts do - quote location: :keep do - defmacro unquote(name)() do - unquote(value) - end - end - end - end - - defp encoders(opts) do - for {name, value} <- opts do - quote location: :keep do - def encode(unquote(name)) do - {:ok, unquote(value)} - end - end - end - end -end diff --git a/apps/proto/lib/expert/proto/field.ex b/apps/proto/lib/expert/proto/field.ex deleted file mode 100644 index e90b7cba..00000000 --- a/apps/proto/lib/expert/proto/field.ex +++ /dev/null @@ -1,291 +0,0 @@ -defmodule Expert.Proto.Field do - alias Expert.Proto.Text - - def extract(:any, _, value) do - {:ok, value} - end - - def extract({:literal, same_value}, _name, same_value) do - {:ok, same_value} - end - - def extract({:optional, _}, _name, nil) do - {:ok, nil} - end - - def extract({:optional, type}, name, orig_val) do - extract(type, name, orig_val) - end - - def extract({:one_of, type_list}, name, value) do - result = - Enum.reduce_while(type_list, nil, fn type, _acc -> - case extract(type, name, value) do - {:ok, _} = success -> {:halt, success} - error -> {:cont, error} - end - end) - - case result do - {:ok, _} = success -> success - _error -> {:error, {:incorrect_type, type_list, value}} - end - end - - def extract({:list, list_type}, name, orig_value) when is_list(orig_value) do - result = - Enum.reduce_while(orig_value, [], fn orig, acc -> - case extract(list_type, name, orig) do - {:ok, value} -> {:cont, [value | acc]} - error -> {:halt, error} - end - end) - - case result do - value_list when is_list(value_list) -> {:ok, Enum.reverse(value_list)} - error -> error - end - end - - def extract(:integer, _name, orig_value) when is_integer(orig_value) do - {:ok, orig_value} - end - - def extract(:float, _name, orig_value) when is_float(orig_value) do - {:ok, orig_value} - end - - def extract(:string, _name, orig_value) when is_binary(orig_value) do - {:ok, orig_value} - end - - def extract(:boolean, _name, orig_value) when is_boolean(orig_value) do - {:ok, orig_value} - end - - def extract({:type_alias, alias_module}, name, orig_value) do - extract(alias_module.definition(), name, orig_value) - end - - def extract(nil, _name, orig_value) do - {:ok, orig_value} - end - - def extract(module, _name, orig_value) - when is_atom(module) and module not in [:integer, :string, :boolean, :float] do - module.parse(orig_value) - end - - def extract({:map, type, _opts}, field_name, field_value) - when is_map(field_value) do - result = - Enum.reduce_while(field_value, [], fn {k, v}, acc -> - case extract(type, field_name, v) do - {:ok, value} -> {:cont, [{k, value} | acc]} - error -> {:halt, error} - end - end) - - case result do - values when is_list(values) -> {:ok, Map.new(values)} - error -> error - end - end - - def extract({:tuple, tuple_types}, field_name, field_value) when is_list(field_value) do - result = - field_value - |> Enum.zip(tuple_types) - |> Enum.reduce_while([], fn {value, type}, acc -> - case extract(type, field_name, value) do - {:ok, value} -> {:cont, [value | acc]} - error -> {:halt, error} - end - end) - - case result do - value when is_list(value) -> - value_as_tuple = - value - |> Enum.reverse() - |> List.to_tuple() - - {:ok, value_as_tuple} - - error -> - error - end - end - - def extract({:params, param_defs}, _field_name, field_value) - when is_map(field_value) do - result = - Enum.reduce_while(param_defs, [], fn {param_name, param_type}, acc -> - value = Map.get(field_value, Text.camelize(param_name)) - - case extract(param_type, param_name, value) do - {:ok, value} -> {:cont, [{param_name, value} | acc]} - error -> {:halt, error} - end - end) - - case result do - values when is_list(values) -> {:ok, Map.new(values)} - error -> error - end - end - - def extract(_type, name, orig_value) do - {:error, {:invalid_value, name, orig_value}} - end - - def encode(:any, field_value) do - {:ok, field_value} - end - - def encode({:literal, value}, _) do - {:ok, value} - end - - def encode({:optional, _}, nil) do - {:ok, :"$__drop__"} - end - - def encode({:optional, field_type}, field_value) do - encode(field_type, field_value) - end - - def encode({:one_of, types}, field_value) do - encoded = - Enum.reduce_while(types, nil, fn type, _ -> - case encode(type, field_value) do - {:ok, _} = success -> {:halt, success} - error -> {:cont, error} - end - end) - - case encoded do - encoded_list when is_list(encoded_list) -> {:ok, encoded_list} - error -> error - end - end - - def encode({:list, list_type}, field_value) when is_list(field_value) do - encoded = - Enum.reduce_while(field_value, [], fn element, acc -> - case encode(list_type, element) do - {:ok, encoded} -> {:cont, [encoded | acc]} - error -> {:halt, error} - end - end) - - case encoded do - encoded_list when is_list(encoded_list) -> - {:ok, Enum.reverse(encoded_list)} - - error -> - error - end - end - - def encode(:integer, field_value) when is_integer(field_value) do - {:ok, field_value} - end - - def encode(:integer, string_value) when is_binary(string_value) do - case Integer.parse(string_value) do - {int_value, ""} -> {:ok, int_value} - _ -> {:error, {:invalid_integer, string_value}} - end - end - - def encode(:float, float_value) when is_float(float_value) do - {:ok, float_value} - end - - def encode(:float, field_value) when is_float(field_value) do - field_value - end - - def encode(:string, field_value) when is_binary(field_value) do - {:ok, field_value} - end - - def encode(:boolean, field_value) when is_boolean(field_value) do - {:ok, field_value} - end - - def encode({:map, value_type, _}, field_value) when is_map(field_value) do - map_fields = - Enum.reduce_while(field_value, [], fn {key, value}, acc -> - case encode(value_type, value) do - {:ok, encoded_value} -> {:cont, [{key, encoded_value} | acc]} - error -> {:halt, error} - end - end) - - case map_fields do - fields when is_list(fields) -> {:ok, Map.new(fields)} - error -> error - end - end - - def encode({:tuple, types}, field_value) when is_tuple(field_value) do - encoded = - field_value - |> Tuple.to_list() - |> Enum.zip(types) - |> Enum.reduce_while([], fn {value, type}, acc -> - case encode(type, value) do - {:ok, encoded} -> {:cont, [encoded | acc]} - error -> {:halt, error} - end - end) - - case encoded do - encoded_list when is_list(encoded_list) -> {:ok, Enum.reverse(encoded_list)} - error -> error - end - end - - def encode({:params, param_defs}, field_value) when is_map(field_value) do - param_fields = - Enum.reduce_while(param_defs, [], fn {param_name, param_type}, acc -> - unencoded = Map.get(field_value, param_name) - - case encode(param_type, unencoded) do - {:ok, encoded_value} -> {:cont, [{param_name, encoded_value} | acc]} - error -> {:halt, error} - end - end) - - case param_fields do - fields when is_list(fields) -> {:ok, Map.new(fields)} - error -> error - end - end - - def encode({:constant, constant_module}, field_value) do - {:ok, constant_module.encode(field_value)} - end - - def encode({:type_alias, alias_module}, field_value) do - encode(alias_module.definition(), field_value) - end - - def encode(module, field_value) when is_atom(module) do - if function_exported?(module, :encode, 1) do - module.encode(field_value) - else - {:ok, field_value} - end - end - - def encode(_, nil) do - nil - end - - def encode(type, value) do - {:error, {:invalid_type, type, value}} - end -end diff --git a/apps/proto/lib/expert/proto/lsp_types.ex b/apps/proto/lib/expert/proto/lsp_types.ex deleted file mode 100644 index db3180b6..00000000 --- a/apps/proto/lib/expert/proto/lsp_types.ex +++ /dev/null @@ -1,41 +0,0 @@ -defmodule Expert.Proto.LspTypes do - alias Expert.Proto - use Proto - - defmodule ErrorCodes do - use Proto - - defenum parse_error: -32_700, - invalid_request: -32_600, - method_not_found: -32_601, - invalid_params: -32_602, - internal_error: -32_603, - server_not_initialized: -32_002, - unknown_error_code: -32_001, - request_failed: -32_803, - server_cancelled: -32_802, - content_modified: -32_801, - request_cancelled: -32_800 - end - - defmodule ResponseError do - use Proto - deftype code: ErrorCodes, message: string(), data: optional(any()) - end - - defmodule ClientInfo do - use Proto - deftype name: string(), version: optional(string()) - end - - defmodule TraceValue do - use Proto - defenum off: "off", messages: "messages", verbose: "verbose" - end - - defmodule Registration do - use Proto - - deftype id: string(), method: string(), register_options: optional(any()) - end -end diff --git a/apps/proto/lib/expert/proto/macros/access.ex b/apps/proto/lib/expert/proto/macros/access.ex deleted file mode 100644 index c5c8b351..00000000 --- a/apps/proto/lib/expert/proto/macros/access.ex +++ /dev/null @@ -1,34 +0,0 @@ -defmodule Expert.Proto.Macros.Access do - def build do - quote location: :keep do - def fetch(proto, key) when is_map_key(proto, key) do - {:ok, Map.get(proto, key)} - end - - def fetch(_, _) do - :error - end - - def get_and_update(proto, key, function) when is_map_key(proto, key) do - old_value = Map.get(proto, key) - - case function.(old_value) do - {current_value, updated_value} -> {current_value, Map.put(proto, key, updated_value)} - :pop -> {old_value, Map.put(proto, key, nil)} - end - end - - def get_and_update(proto, key, function) do - {{:error, {:nonexistent_key, key}}, proto} - end - - def pop(proto, key) when is_map_key(proto, key) do - {Map.get(proto, key), proto} - end - - def pop(proto, _key) do - {nil, proto} - end - end - end -end diff --git a/apps/proto/lib/expert/proto/macros/inspect.ex b/apps/proto/lib/expert/proto/macros/inspect.ex deleted file mode 100644 index a82cc5a7..00000000 --- a/apps/proto/lib/expert/proto/macros/inspect.ex +++ /dev/null @@ -1,40 +0,0 @@ -defmodule Expert.Proto.Macros.Inspect do - def build(dest_module) do - trimmed_name = trim_module_name(dest_module) - - quote location: :keep do - defimpl Inspect, for: unquote(dest_module) do - import Inspect.Algebra - - def inspect(proto_type, opts) do - proto_key_values = - proto_type - |> Map.from_struct() - |> Enum.reject(fn {k, v} -> is_nil(v) end) - - concat(["##{unquote(trimmed_name)}<", Inspect.List.inspect(proto_key_values, opts), ">"]) - end - end - end - end - - def trim_module_name(long_name) do - {sub_modules, _} = - long_name - |> Module.split() - |> Enum.reduce({[], false}, fn - "Protocol", _ -> - {["Protocol"], true} - - _ignored_module, {_, false} = state -> - state - - submodule, {mod_list, true} -> - {[submodule | mod_list], true} - end) - - sub_modules - |> Enum.reverse() - |> Enum.join(".") - end -end diff --git a/apps/proto/lib/expert/proto/macros/json.ex b/apps/proto/lib/expert/proto/macros/json.ex deleted file mode 100644 index 6e0193ff..00000000 --- a/apps/proto/lib/expert/proto/macros/json.ex +++ /dev/null @@ -1,46 +0,0 @@ -defmodule Expert.Proto.Macros.Json do - alias Expert.Proto.Field - - def build(dest_module) do - quote location: :keep do - defimpl Jason.Encoder, for: unquote(dest_module) do - def encode(%struct_module{} = value, opts) do - encoded_pairs = - for {field_name, field_type} <- unquote(dest_module).__meta__(:types), - field_value = get_field_value(value, field_name), - {:ok, encoded_value} = Field.encode(field_type, field_value), - encoded_value != :"$__drop__" do - {field_name, encoded_value} - end - - encoded_pairs - |> Enum.flat_map(fn - # flatten the spread into the current map - {:.., value} when is_map(value) -> Enum.to_list(value) - {k, v} -> [{camelize(k), v}] - end) - |> Jason.Encode.keyword(opts) - end - - defp get_field_value(%struct_module{} = struct, :..) do - get_field_value(struct, struct_module.__meta__(:spread_alias)) - end - - defp get_field_value(struct, field_name) do - Map.get(struct, field_name) - end - - def camelize(field_name) do - field_name - |> to_string() - |> Macro.camelize() - |> downcase_first() - end - - defp downcase_first(<>) do - String.downcase(c) <> rest - end - end - end - end -end diff --git a/apps/proto/lib/expert/proto/macros/match.ex b/apps/proto/lib/expert/proto/macros/match.ex deleted file mode 100644 index 38ad34d8..00000000 --- a/apps/proto/lib/expert/proto/macros/match.ex +++ /dev/null @@ -1,20 +0,0 @@ -defmodule Expert.Proto.Macros.Match do - def build(field_types, dest_module) do - macro_name = - dest_module - |> Macro.underscore() - |> String.replace("/", "_") - |> String.to_atom() - - quote location: :keep do - defmacro unquote(macro_name)(opts \\ []) do - cond do - Keyword.keyword?(opts) -> - %unquote(dest_module){unquote_splicing(field_types)} - end - end - end - - nil - end -end diff --git a/apps/proto/lib/expert/proto/macros/message.ex b/apps/proto/lib/expert/proto/macros/message.ex deleted file mode 100644 index bed22ce1..00000000 --- a/apps/proto/lib/expert/proto/macros/message.ex +++ /dev/null @@ -1,61 +0,0 @@ -defmodule Expert.Proto.Macros.Message do - alias Forge.Document - - alias Expert.Proto.Macros.{ - Access, - Meta, - Parse, - Struct, - Typespec - } - - def build(meta_type, method, types, param_names, env, opts \\ []) do - parse_fn = - if Keyword.get(opts, :include_parse?, true) do - Parse.build(types) - end - - quote do - unquote(Struct.build(types, env)) - unquote(Access.build()) - unquote(parse_fn) - unquote(Meta.build(types)) - - @type t :: unquote(Typespec.typespec(types, env)) - - def method do - unquote(method) - end - - def __meta__(:method_name) do - unquote(method) - end - - def __meta__(:type) do - unquote(meta_type) - end - - def __meta__(:param_names) do - unquote(param_names) - end - end - end - - def generate_elixir_types(caller_module, message_types) do - message_types - |> Enum.reduce(message_types, fn - {:text_document, _}, types -> - Keyword.put(types, :document, quote(do: Document)) - - {:position, _}, types -> - Keyword.put(types, :position, quote(do: Document.Position)) - - {:range, _}, types -> - Keyword.put(types, :range, quote(do: Document.Range)) - - _, types -> - types - end) - |> Keyword.put(:lsp, quote(do: unquote(caller_module).LSP)) - end -end diff --git a/apps/proto/lib/expert/proto/macros/meta.ex b/apps/proto/lib/expert/proto/macros/meta.ex deleted file mode 100644 index 8460ee8c..00000000 --- a/apps/proto/lib/expert/proto/macros/meta.ex +++ /dev/null @@ -1,41 +0,0 @@ -defmodule Expert.Proto.Macros.Meta do - def build(opts) do - field_types = - for {field_name, field_type} <- opts do - field_meta(field_name, field_type) - end - - quote location: :keep do - unquote_splicing(field_types) - - def __meta__(:types) do - %{unquote_splicing(opts)} - end - - def __meta__(:raw_types) do - unquote(Macro.escape(opts)) - end - end - end - - defp field_meta(:.., {:map_of, ctx, [key_type, [as: key_alias]]}) do - # a spread operator, generate meta for both the spread name and the aliased name - - quote do - def __meta__(:spread_alias) do - unquote(key_alias) - end - - unquote(field_meta(:.., {:map_of, ctx, [key_type]})) - unquote(field_meta(key_alias, {:map_of, ctx, [key_type]})) - end - end - - defp field_meta(field_name, field_type) do - quote location: :keep do - def __meta__(:type, unquote(field_name)) do - unquote(field_type) - end - end - end -end diff --git a/apps/proto/lib/expert/proto/macros/parse.ex b/apps/proto/lib/expert/proto/macros/parse.ex deleted file mode 100644 index aa26f8c7..00000000 --- a/apps/proto/lib/expert/proto/macros/parse.ex +++ /dev/null @@ -1,140 +0,0 @@ -defmodule Expert.Proto.Macros.Parse do - alias Expert.Proto.Field - alias Expert.Proto.Text - - def build(opts) do - {optional_opts, required_opts} = - Enum.split_with(opts, fn - {_key, {:optional, _, _}} -> true - {:.., _} -> true - _ -> false - end) - - {splat_opt, optional_opts} = Keyword.pop(optional_opts, :..) - - required_keys = Keyword.keys(required_opts) - - map_parameter_var = - if Enum.empty?(optional_opts) && is_nil(splat_opt) do - Macro.var(:_, nil) - else - Macro.var(:json_rpc_message, nil) - end - - struct_keys = Keyword.keys(opts) - - map_vars = Map.new(struct_keys, fn k -> {k, Macro.var(k, nil)} end) - - map_keys = Enum.map(required_keys, &Text.camelize/1) - - map_pairs = - map_vars - |> Map.take(required_keys) - |> Enum.map(fn {k, v} -> {Text.camelize(k), v} end) - - map_extractors = map_extractor(map_pairs) - - required_extractors = - for {field_name, field_type} <- required_opts do - quote location: :keep do - {unquote(field_name), - Field.extract( - unquote(field_type), - unquote(field_name), - unquote(Map.get(map_vars, field_name)) - )} - end - end - - optional_extractors = - for {field_name, field_type} <- optional_opts do - quote location: :keep do - {unquote(field_name), - Field.extract( - unquote(field_type), - unquote(field_name), - Map.get(unquote(map_parameter_var), unquote(Text.camelize(field_name))) - )} - end - end - - splat_extractors = - if splat_opt do - known_keys = opts |> Keyword.keys() |> Enum.map(&Text.camelize/1) - - quoted_extractor = - quote location: :keep do - {(fn -> - {:map, _, field_name} = unquote(splat_opt) - field_name - end).(), - Field.extract( - unquote(splat_opt), - :.., - unquote(map_parameter_var) - |> Enum.reject(fn {k, _} -> k in unquote(known_keys) end) - |> Map.new() - )} - end - - [quoted_extractor] - else - [] - end - - all_extractors = required_extractors ++ optional_extractors ++ splat_extractors - error_parse = maybe_build_error_parse(required_extractors, map_keys) - - quote location: :keep do - def parse(unquote(map_extractors) = unquote(map_parameter_var)) do - result = - unquote(all_extractors) - |> Enum.reduce_while([], fn - {field, {:ok, result}}, acc -> - {:cont, [{field, result} | acc]} - - {field, {:error, _} = err}, acc -> - {:halt, err} - end) - - case result do - {:error, _} = err -> err - keyword when is_list(keyword) -> {:ok, struct(__MODULE__, keyword)} - end - end - - unquote(error_parse) - - def parse(not_map) do - {:error, {:invalid_map, not_map}} - end - end - end - - defp maybe_build_error_parse([], _) do - end - - defp maybe_build_error_parse(_, map_keys) do - # this is only built if there are required fields - quote do - def parse(%{} = unmatched) do - missing_keys = - Enum.reduce(unquote(map_keys), [], fn key, acc -> - if Map.has_key?(unmatched, key) do - acc - else - [key | acc] - end - end) - - {:error, {:missing_keys, missing_keys, __MODULE__}} - end - end - end - - defp map_extractor(map_pairs) do - quote location: :keep do - %{unquote_splicing(map_pairs)} - end - end -end diff --git a/apps/proto/lib/expert/proto/macros/struct.ex b/apps/proto/lib/expert/proto/macros/struct.ex deleted file mode 100644 index fba57123..00000000 --- a/apps/proto/lib/expert/proto/macros/struct.ex +++ /dev/null @@ -1,55 +0,0 @@ -defmodule Expert.Proto.Macros.Struct do - alias Expert.Proto.Macros.Typespec - - def build(opts, env) do - keys = Keyword.keys(opts) - required_keys = required_keys(opts) - - keys = - if :.. in keys do - {splat_def, rest} = Keyword.pop(opts, :..) - - quote location: :keep do - [ - (fn -> - {_, _, field_name} = unquote(splat_def) - field_name - end).() - | unquote(rest) - ] - end - else - keys - end - - quote location: :keep do - @enforce_keys unquote(required_keys) - defstruct unquote(keys) - @type option :: unquote(Typespec.keyword_constructor_options(opts, env)) - @type options :: [option] - - @spec new() :: t() - @spec new(options()) :: t() - def new(opts \\ []) do - struct!(__MODULE__, opts) - end - - defoverridable new: 0, new: 1 - end - end - - defp required_keys(opts) do - opts - |> Enum.filter(fn - # ignore the splat, it's always optional - {:.., _} -> false - # an optional signifier tuple - {_, {:optional, _}} -> false - # ast for an optional signifier tuple - {_, {:optional, _, _}} -> false - # everything else is required - _ -> true - end) - |> Keyword.keys() - end -end diff --git a/apps/proto/lib/expert/proto/macros/typespec.ex b/apps/proto/lib/expert/proto/macros/typespec.ex deleted file mode 100644 index 6aa552a1..00000000 --- a/apps/proto/lib/expert/proto/macros/typespec.ex +++ /dev/null @@ -1,202 +0,0 @@ -defmodule Expert.Proto.Macros.Typespec do - def typespec(opts \\ [], env \\ nil) - - def typespec([], _) do - quote do - %__MODULE__{} - end - end - - def typespec(opts, env) when is_list(opts) do - typespecs = - for {name, type} <- opts, - name != :.. do - {name, do_typespec(type, env)} - end - - quote do - %__MODULE__{unquote_splicing(typespecs)} - end - end - - def typespec(typespec, env) do - do_typespec(typespec, env) - end - - def choice(options, env) do - do_typespec({:one_of, [], [options]}, env) - end - - def keyword_constructor_options(opts, env) do - for {name, type} <- opts, - name != :.. do - {name, do_typespec(type, env)} - end - |> or_types() - end - - defp do_typespec([], _env) do - # This is what's presented to typespec when a response has no results, as in the Shutdown response - nil - end - - defp do_typespec(nil, _env) do - quote(do: nil) - end - - defp do_typespec({:boolean, _, _}, _env) do - quote(do: boolean()) - end - - defp do_typespec({:string, _, _}, _env) do - quote(do: String.t()) - end - - defp do_typespec({:integer, _, _}, _env) do - quote(do: integer()) - end - - defp do_typespec({:float, _, _}, _env) do - quote(do: float()) - end - - defp do_typespec({:__MODULE__, _, nil}, env) do - env.module - end - - defp do_typespec({:optional, _, [optional_type]}, env) do - quote do - unquote(do_typespec(optional_type, env)) | nil - end - end - - defp do_typespec({:__aliases__, _, raw_alias} = aliased_module, env) do - expanded_alias = Macro.expand(aliased_module, env) - - case List.last(raw_alias) do - :Position -> - other_alias = - case expanded_alias do - Forge.Document.Range -> - Expert.Protocol.Types.Range - - _ -> - Forge.Document.Range - end - - quote do - unquote(expanded_alias).t() | unquote(other_alias).t() - end - - :Range -> - other_alias = - case expanded_alias do - Forge.Document.Range -> - Expert.Protocol.Types.Range - - _ -> - Forge.Document.Range - end - - quote do - unquote(expanded_alias).t() | unquote(other_alias).t() - end - - _ -> - quote do - unquote(expanded_alias).t() - end - end - end - - defp do_typespec({:literal, _, value}, _env) when is_atom(value) do - value - end - - defp do_typespec({:literal, _, [value]}, _env) do - literal_type(value) - end - - defp do_typespec({:type_alias, _, [alias_dest]}, env) do - do_typespec(alias_dest, env) - end - - defp do_typespec({:one_of, _, [type_list]}, env) do - type_list - |> Enum.map(&do_typespec(&1, env)) - |> or_types() - end - - defp do_typespec({:list_of, _, items}, env) do - refined = - items - |> Enum.map(&do_typespec(&1, env)) - |> or_types() - - quote do - [unquote(refined)] - end - end - - defp do_typespec({:tuple_of, _, [items]}, env) do - refined = Enum.map(items, &do_typespec(&1, env)) - - quote do - {unquote_splicing(refined)} - end - end - - defp do_typespec({:map_of, _, items}, env) do - value_types = - items - |> Enum.map(&do_typespec(&1, env)) - |> or_types() - - quote do - %{String.t() => unquote(value_types)} - end - end - - defp do_typespec({:any, _, _}, _env) do - quote do - any() - end - end - - defp or_types(list_of_types) do - Enum.reduce(list_of_types, nil, fn - type, nil -> - type - - type, acc -> - quote do - unquote(type) | unquote(acc) - end - end) - end - - defp literal_type(thing) do - case thing do - string when is_binary(string) -> - quote(do: String.t()) - - integer when is_integer(integer) -> - quote(do: integer()) - - float when is_binary(float) -> - quote(do: float()) - - boolean when is_boolean(boolean) -> - quote(do: boolean()) - - atom when is_atom(atom) -> - atom - - [] -> - quote(do: []) - - [elem | _] -> - quote(do: [unquote(literal_type(elem))]) - end - end -end diff --git a/apps/proto/lib/expert/proto/notification.ex b/apps/proto/lib/expert/proto/notification.ex deleted file mode 100644 index 54cd10fa..00000000 --- a/apps/proto/lib/expert/proto/notification.ex +++ /dev/null @@ -1,96 +0,0 @@ -defmodule Expert.Proto.Notification do - alias Expert.Proto.CompileMetadata - alias Expert.Proto.Macros.Message - - defmacro defnotification(method) do - do_defnotification(method, [], __CALLER__) - end - - defmacro defnotification(method, params_module_ast) do - params_module = - params_module_ast - |> Macro.expand(__CALLER__) - |> Code.ensure_compiled!() - - types = params_module.__meta__(:raw_types) - do_defnotification(method, types, __CALLER__) - end - - defp do_defnotification(method, types, caller) do - CompileMetadata.add_notification_module(caller.module) - - jsonrpc_types = [ - jsonrpc: quote(do: literal("2.0")), - method: quote(do: literal(unquote(method))) - ] - - param_names = Keyword.keys(types) - lsp_types = Keyword.merge(jsonrpc_types, types) - elixir_types = Message.generate_elixir_types(caller.module, lsp_types) - lsp_module_name = Module.concat(caller.module, LSP) - - quote location: :keep do - defmodule LSP do - unquote(Message.build({:notification, :lsp}, method, lsp_types, param_names, caller)) - - def new(opts \\ []) do - opts - |> Keyword.merge(method: unquote(method), jsonrpc: "2.0") - |> super() - end - end - - unquote( - Message.build({:notification, :elixir}, method, elixir_types, param_names, caller, - include_parse?: false - ) - ) - - unquote(build_parse(method)) - - def new(opts \\ []) do - opts = Keyword.merge(opts, method: unquote(method), jsonrpc: "2.0") - - # use struct here because initially, the non-lsp struct doesn't have - # to be filled out. Calling to_elixir fills it out. - struct(__MODULE__, lsp: LSP.new(opts), method: unquote(method), jsonrpc: "2.0") - end - - defimpl Jason.Encoder, for: unquote(caller.module) do - def encode(notification, opts) do - Jason.Encoder.encode(notification.lsp, opts) - end - end - - defimpl Jason.Encoder, for: unquote(lsp_module_name) do - def encode(notification, opts) do - %{ - jsonrpc: "2.0", - method: unquote(method), - params: Map.take(notification, unquote(param_names)) - } - |> Jason.Encode.map(opts) - end - end - end - end - - defp build_parse(method) do - quote do - def parse(%{"method" => unquote(method), "jsonrpc" => "2.0"} = request) do - params = Map.get(request, "params") || %{} - flattened_notificaiton = Map.merge(request, params) - - case LSP.parse(flattened_notificaiton) do - {:ok, raw_lsp} -> - struct_opts = [method: unquote(method), jsonrpc: "2.0", lsp: raw_lsp] - notification = struct(__MODULE__, struct_opts) - {:ok, notification} - - error -> - error - end - end - end - end -end diff --git a/apps/proto/lib/expert/proto/request.ex b/apps/proto/lib/expert/proto/request.ex deleted file mode 100644 index be98645c..00000000 --- a/apps/proto/lib/expert/proto/request.ex +++ /dev/null @@ -1,143 +0,0 @@ -defmodule Expert.Proto.Request do - alias Expert.Proto.CompileMetadata - alias Expert.Proto.Macros.Message - alias Expert.Proto.TypeFunctions - - import TypeFunctions, only: [optional: 1, literal: 1] - - defmacro defrequest(method) do - do_defrequest(method, [], __CALLER__) - end - - defmacro defrequest(method, params_module_ast) do - types = fetch_types(params_module_ast, __CALLER__) - do_defrequest(method, types, __CALLER__) - end - - defmacro server_request(method, params_module_ast, response_module_ast) do - types = fetch_types(params_module_ast, __CALLER__) - - quote do - unquote(do_defrequest(method, types, __CALLER__)) - - def parse_response(response) do - unquote(response_module_ast).parse(response) - end - end - end - - defmacro server_request(method, response_module_ast) do - quote do - unquote(do_defrequest(method, [], __CALLER__)) - - def parse_response(response) do - unquote(response_module_ast).parse(response) - end - end - end - - defp fetch_types(params_module_ast, env) do - params_module = - params_module_ast - |> Macro.expand(env) - |> Code.ensure_compiled!() - - params_module.__meta__(:raw_types) - end - - defp do_defrequest(method, types, caller) do - CompileMetadata.add_request_module(caller.module) - # id is optional so we can resuse the parse function. If it's required, - # it will go in the pattern match for the params, which won't work. - - jsonrpc_types = [ - id: quote(do: optional(one_of([string(), integer()]))), - jsonrpc: quote(do: literal("2.0")), - method: quote(do: literal(unquote(method))) - ] - - lsp_types = Keyword.merge(jsonrpc_types, types) - elixir_types = Message.generate_elixir_types(caller.module, lsp_types) - param_names = Keyword.keys(types) - lsp_module_name = Module.concat(caller.module, LSP) - - Message.build({:request, :elixir}, method, elixir_types, param_names, caller, - include_parse?: false - ) - - quote location: :keep do - defmodule LSP do - unquote(Message.build({:request, :lsp}, method, lsp_types, param_names, caller)) - - def new(opts \\ []) do - opts - |> Keyword.merge(method: unquote(method), jsonrpc: "2.0") - |> super() - end - end - - alias Expert.Proto.Convert - alias Expert.Protocol.Types - - unquote( - Message.build({:request, :elixir}, method, elixir_types, param_names, caller, - include_parse?: false - ) - ) - - unquote(build_parse(method)) - - def new(opts \\ []) do - opts = Keyword.merge(opts, method: unquote(method), jsonrpc: "2.0") - - raw = LSP.new(opts) - # use struct here because initially, the non-lsp struct doesn't have - # to be filled out. Calling to_elixir fills it out. - struct(__MODULE__, lsp: raw, id: raw.id, method: unquote(method), jsonrpc: "2.0") - end - - defimpl Jason.Encoder, for: unquote(caller.module) do - def encode(request, opts) do - Jason.Encoder.encode(request.lsp, opts) - end - end - - defimpl Jason.Encoder, for: unquote(lsp_module_name) do - def encode(request, opts) do - params = - case Map.take(request, unquote(param_names)) do - empty when map_size(empty) == 0 -> nil - params -> params - end - - %{ - id: request.id, - jsonrpc: "2.0", - method: unquote(method), - params: params - } - |> Jason.Encode.map(opts) - end - end - end - end - - defp build_parse(method) do - quote do - def parse(%{"method" => unquote(method), "id" => id, "jsonrpc" => "2.0"} = request) do - params = Map.get(request, "params") || %{} - flattened_request = Map.merge(request, params) - - case LSP.parse(flattened_request) do - {:ok, raw_lsp} -> - struct_opts = [id: id, method: unquote(method), jsonrpc: "2.0", lsp: raw_lsp] - request = struct(__MODULE__, struct_opts) - {:ok, request} - - error -> - error - end - end - end - end -end diff --git a/apps/proto/lib/expert/proto/response.ex b/apps/proto/lib/expert/proto/response.ex deleted file mode 100644 index b8c70999..00000000 --- a/apps/proto/lib/expert/proto/response.ex +++ /dev/null @@ -1,83 +0,0 @@ -defmodule Expert.Proto.Response do - alias Expert.Proto.CompileMetadata - - alias Expert.Proto.Macros.{ - Access, - Meta, - Parse, - Struct, - Typespec - } - - defmacro defresponse(response_type) do - CompileMetadata.add_response_module(__CALLER__.module) - - jsonrpc_types = [ - id: quote(do: optional(one_of([integer(), string()]))), - error: quote(do: optional(Expert.Proto.LspTypes.ResponseError)), - result: quote(do: optional(unquote(response_type))) - ] - - quote location: :keep do - alias Expert.Proto.LspTypes - unquote(Access.build()) - unquote(Struct.build(jsonrpc_types, __CALLER__)) - @type t :: unquote(Typespec.typespec()) - unquote(Meta.build(jsonrpc_types)) - unquote(constructors()) - unquote(Parse.build(result: response_type)) - - defimpl Jason.Encoder, for: unquote(__CALLER__.module) do - def encode(%_{error: nil} = response, opts) do - %{ - jsonrpc: "2.0", - id: response.id, - result: response.result - } - |> Jason.Encode.map(opts) - end - - def encode(response, opts) do - %{ - jsonrpc: "2.0", - id: response.id, - error: response.error - } - |> Jason.Encode.map(opts) - end - end - end - end - - defp constructors do - quote do - def new(id, result) do - struct(__MODULE__, result: result, id: id) - end - - def error(id, error_code) when is_integer(error_code) do - %__MODULE__{id: id, error: LspTypes.ResponseError.new(code: error_code)} - end - - def error(id, error_code) when is_atom(error_code) do - %__MODULE__{id: id, error: LspTypes.ResponseError.new(code: error_code)} - end - - def error(id, error_code, error_message) - when is_integer(error_code) and is_binary(error_message) do - %__MODULE__{ - id: id, - error: LspTypes.ResponseError.new(code: error_code, message: error_message) - } - end - - def error(id, error_code, error_message) - when is_atom(error_code) and is_binary(error_message) do - %__MODULE__{ - id: id, - error: LspTypes.ResponseError.new(code: error_code, message: error_message) - } - end - end - end -end diff --git a/apps/proto/lib/expert/proto/text.ex b/apps/proto/lib/expert/proto/text.ex deleted file mode 100644 index c6c8195e..00000000 --- a/apps/proto/lib/expert/proto/text.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule Expert.Proto.Text do - def camelize(atom) when is_atom(atom) do - atom |> Atom.to_string() |> camelize() - end - - def camelize(string) do - <> = Macro.camelize(string) - String.downcase(first) <> rest - end -end diff --git a/apps/proto/lib/expert/proto/type.ex b/apps/proto/lib/expert/proto/type.ex deleted file mode 100644 index 38cf6ad4..00000000 --- a/apps/proto/lib/expert/proto/type.ex +++ /dev/null @@ -1,40 +0,0 @@ -defmodule Expert.Proto.Type do - alias Expert.Proto.CompileMetadata - - alias Expert.Proto.Macros.{ - Access, - Inspect, - Json, - Match, - Meta, - Parse, - Struct, - Typespec - } - - defmacro deftype(types) do - caller_module = __CALLER__.module - CompileMetadata.add_type_module(caller_module) - - quote location: :keep do - unquote(Json.build(caller_module)) - unquote(Inspect.build(caller_module)) - unquote(Access.build()) - unquote(Struct.build(types, __CALLER__)) - - @type t :: unquote(Typespec.typespec(types, __CALLER__)) - - unquote(Parse.build(types)) - unquote(Match.build(types, caller_module)) - unquote(Meta.build(types)) - - def __meta__(:type) do - :type - end - - def __meta__(:param_names) do - unquote(Keyword.keys(types)) - end - end - end -end diff --git a/apps/proto/lib/expert/proto/type_functions.ex b/apps/proto/lib/expert/proto/type_functions.ex deleted file mode 100644 index 86137dc0..00000000 --- a/apps/proto/lib/expert/proto/type_functions.ex +++ /dev/null @@ -1,58 +0,0 @@ -defmodule Expert.Proto.TypeFunctions do - def integer do - :integer - end - - def float do - :float - end - - def string do - :string - end - - def boolean do - :boolean - end - - def uri do - :string - end - - def type_alias(alias_module) do - {:type_alias, alias_module} - end - - def literal(what) do - {:literal, what} - end - - def list_of(type) do - {:list, type} - end - - def tuple_of(types) when is_list(types) do - {:tuple, types} - end - - def map_of(type, opts \\ []) do - field_name = Keyword.get(opts, :as) - {:map, type, field_name} - end - - def one_of(options) when is_list(options) do - {:one_of, options} - end - - def optional(type) do - {:optional, type} - end - - def params(opts) do - {:params, opts} - end - - def any do - :any - end -end diff --git a/apps/proto/lib/expert/proto/typespecs.ex b/apps/proto/lib/expert/proto/typespecs.ex deleted file mode 100644 index 552a911c..00000000 --- a/apps/proto/lib/expert/proto/typespecs.ex +++ /dev/null @@ -1,54 +0,0 @@ -defmodule Expert.Proto.Typespecs do - alias Expert.Proto.CompileMetadata - - defmacro __using__(opts) do - group_name = Keyword.fetch!(opts, :for) - - quote do - unquote(for_group(group_name)) - end - end - - defp for_group(group_name) do - modules = - case group_name do - :notifications -> CompileMetadata.notification_modules() - :requests -> CompileMetadata.request_modules() - :responses -> CompileMetadata.response_modules() - :types -> CompileMetadata.type_modules() - end - - quote do - unquote(build_typespec(singular(group_name), modules)) - end - end - - def build_typespec(type_name, modules) do - spec_name = {type_name, [], nil} - - spec = - Enum.reduce(modules, nil, fn - module, nil -> - quote do - unquote(module).t() - end - - module, spec -> - quote do - unquote(module).t() | unquote(spec) - end - end) - - quote do - @type unquote(spec_name) :: unquote(spec) - end - end - - defp singular(atom) when is_atom(atom) do - atom |> Atom.to_string() |> singular() |> String.to_atom() - end - - defp singular(s) when is_binary(s) do - String.replace(s, ~r/(\w+)+s/, "\\1") - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model.ex b/apps/proto/lib/mix/tasks/lsp/data_model.ex deleted file mode 100644 index 284a4094..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model.ex +++ /dev/null @@ -1,133 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel do - alias Mix.Tasks.Lsp.DataModel.Enumeration - alias Mix.Tasks.Lsp.DataModel.Structure - alias Mix.Tasks.Lsp.DataModel.TypeAlias - - defstruct names_to_types: %{}, - notifications: %{}, - requests: %{}, - structures: %{}, - type_aliases: %{}, - enumerations: %{} - - @type t :: %__MODULE__{} - - def new do - with {:ok, root_meta} <- load_meta_model() do - names_to_types = - root_meta - |> Map.take(~w(structures enumerations typeAliases)) - |> Enum.flat_map(fn {type, list_of_things} -> - Enum.map(list_of_things, fn %{"name" => name} -> {name, type_name(type)} end) - end) - |> Map.new() - - type_aliases = load_from_meta(root_meta, "typeAliases", &TypeAlias.new/1) - enumerations = load_from_meta(root_meta, "enumerations", &Enumeration.new/1) - structures = load_from_meta(root_meta, "structures", &Structure.new/1) - - data_model = %__MODULE__{ - names_to_types: names_to_types, - enumerations: enumerations, - type_aliases: type_aliases, - structures: structures - } - - {:ok, data_model} - end - end - - def all_types(%__MODULE__{} = data_model) do - aliases = Map.values(data_model.type_aliases) - structures = Map.values(data_model.structures) - enumerations = Map.values(data_model.enumerations) - - aliases ++ enumerations ++ structures - end - - def fetch(%__MODULE__{} = data_model, name) do - field = - case kind(data_model, name) do - {:ok, :structure} -> :structures - {:ok, :type_alias} -> :type_aliases - {:ok, :enumeration} -> :enumerations - :error -> :error - end - - data_model - |> Map.get(field, %{}) - |> Map.fetch(name) - |> case do - {:ok, %element_module{} = element} -> - {:ok, element_module.resolve(element, data_model)} - - :error -> - :error - end - end - - def fetch!(%__MODULE__{} = data_model, name) do - case fetch(data_model, name) do - {:ok, thing} -> thing - :error -> raise "Could not find type #{name}" - end - end - - def references(%__MODULE__{} = data_model, %{name: name}) do - references(data_model, name) - end - - def references(%__MODULE__{} = data_model, roots) do - collect_references(data_model, List.wrap(roots), MapSet.new()) - end - - defp collect_references(%__MODULE__{}, [], references) do - MapSet.to_list(references) - end - - defp collect_references(%__MODULE__{} = data_model, [first | rest], references) do - with false <- MapSet.member?(references, first), - {:ok, %referred_type{} = referred} <- fetch(data_model, first) do - new_refs = referred_type.references(referred) - collect_references(data_model, rest ++ new_refs, MapSet.put(references, first)) - else - _ -> - collect_references(data_model, rest, references) - end - end - - defp load_from_meta(root_meta, name, new_fn) do - root_meta - |> Map.get(name) - |> Map.new(fn definition -> - loaded = new_fn.(definition) - {loaded.name, loaded} - end) - end - - defp kind(%__MODULE__{} = data_model, name) do - Map.fetch(data_model.names_to_types, name) - end - - defp type_name("structures"), do: :structure - defp type_name("enumerations"), do: :enumeration - defp type_name("typeAliases"), do: :type_alias - - @meta_model_file_name "metamodel.3.17.json" - defp load_meta_model do - file_name = - __ENV__.file - |> Path.dirname() - |> Path.join([@meta_model_file_name]) - - with {:ok, file_contents} <- File.read(file_name) do - Jason.decode(file_contents) - end - end - - defimpl Inspect, for: __MODULE__ do - def inspect(_data_model, _opts) do - "#DataModel<>" - end - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/enumeration.ex b/apps/proto/lib/mix/tasks/lsp/data_model/enumeration.ex deleted file mode 100644 index 30aeeb95..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/enumeration.ex +++ /dev/null @@ -1,67 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Enumeration do - defmodule Value do - defstruct [:name, :value, :documentation] - - def new(%{"name" => name, "value" => value} = value_meta) do - docs = value_meta["documentation"] - %__MODULE__{name: name, value: value, documentation: docs} - end - end - - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.Mappings - - defstruct [:name, :values, :type] - - def new(%{"name" => name, "type" => type, "values" => values}) do - %__MODULE__{ - name: name, - type: Type.new(name, type), - values: Enum.map(values, &Value.new/1) - } - end - - def to_protocol(%__MODULE__{} = enumeration, _, _, _) do - module_name = Module.concat([enumeration.name]) - quote(do: unquote(module_name)) - end - - def resolve(%__MODULE__{} = enumeration, %DataModel{} = data_model) do - %__MODULE__{enumeration | type: Type.resolve(enumeration.type, data_model)} - end - - def build_definition( - %__MODULE__{} = enumeration, - %Mappings{} = mappings, - %DataModel{}, - _container_module - ) do - proto_module = Mappings.proto_module(mappings) - - with {:ok, destination_module} <- - Mappings.fetch_destination_module(mappings, enumeration.name) do - values = - Enum.map(enumeration.values, fn value -> - name = value.name |> Macro.underscore() |> String.to_atom() - quote(do: {unquote(name), unquote(value.value)}) - end) - - ast = - quote do - defmodule unquote(destination_module) do - alias unquote(proto_module) - use Proto - - defenum unquote(values) - end - end - - {:ok, ast} - end - end - - def references(%__MODULE__{}) do - [] - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/notification.ex b/apps/proto/lib/mix/tasks/lsp/data_model/notification.ex deleted file mode 100644 index 52fcd328..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/notification.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Notification do - defstruct [:method, :direction, :params, :documentation] -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/property.ex b/apps/proto/lib/mix/tasks/lsp/data_model/property.ex deleted file mode 100644 index 55d38c3b..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/property.ex +++ /dev/null @@ -1,42 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Property do - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.Mappings - - defstruct [:name, :type, :required?, :references, :documentation] - - def new(%{"name" => name, "type" => type} = property_meta) do - required? = !Map.get(property_meta, "optional", false) - - keys = Keyword.merge([name: name, required?: required?], type: Type.new(name, type)) - struct(__MODULE__, keys) - end - - def resolve(%__MODULE__{} = property, %DataModel{} = data_model) do - %__MODULE__{property | type: Type.resolve(property.type, data_model)} - end - - def to_protocol( - %__MODULE__{} = property, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - underscored = property.name |> Macro.underscore() |> String.to_atom() - type_call = Type.to_protocol(property.type, data_model, mappings, container_module) - - if property.required? do - quote(do: {unquote(underscored), unquote(type_call)}) - else - quote(do: {unquote(underscored), optional(unquote(type_call))}) - end - end - - def references(%__MODULE__{} = property) do - %type_module{} = property.type - - property.type - |> type_module.references() - |> Enum.reject(fn name -> String.starts_with?(name, "LSP") end) - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/request.ex b/apps/proto/lib/mix/tasks/lsp/data_model/request.ex deleted file mode 100644 index a125eae4..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/request.ex +++ /dev/null @@ -1,3 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Request do - defstruct [:method, :result, :direction, :params] -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/structure.ex b/apps/proto/lib/mix/tasks/lsp/data_model/structure.ex deleted file mode 100644 index 43a876f2..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/structure.ex +++ /dev/null @@ -1,135 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Structure do - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.DataModel.Property - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.DataModel.Type.ObjectLiteral - alias Mix.Tasks.Lsp.Mappings - alias Mix.Tasks.Lsp.Mappings.NumberingContext - - defstruct name: nil, documentation: nil, properties: nil, definition: nil, module: nil - - def new(%{"name" => name, "properties" => _} = definition) do - NumberingContext.new() - - %__MODULE__{ - name: name, - documentation: definition[:documentation], - definition: definition, - module: Module.concat([name]) - } - end - - def to_protocol(%__MODULE__{} = structure, _, %Mappings{} = _mappings, _container_module) do - quote(do: unquote(structure.module)) - end - - def build_definition( - %__MODULE__{} = structure, - %Mappings{} = mappings, - %DataModel{} = data_model, - _container_module - ) do - with {:ok, destination_module} <- Mappings.fetch_destination_module(mappings, structure.name) do - NumberingContext.new() - types_module = Mappings.types_module(mappings) - proto_module = Mappings.proto_module(mappings) - structure = resolve(structure, data_model) - object_literals = Type.collect_object_literals(structure, data_model) - - literal_definitions = - Enum.map( - object_literals, - &ObjectLiteral.build_definition(&1, data_model, mappings, destination_module) - ) - - protocol_properties = - structure.properties - |> Enum.sort_by(& &1.name) - |> Enum.map(&Property.to_protocol(&1, data_model, mappings, destination_module)) - - type_module_alias = - case references(structure) do - [] -> [] - _ -> [quote(do: alias(unquote(types_module)))] - end - - ast = - quote do - defmodule unquote(destination_module) do - alias unquote(proto_module) - unquote_splicing(type_module_alias) - - unquote_splicing(literal_definitions) - - use Proto - deftype unquote(protocol_properties) - end - end - - {:ok, ast} - end - end - - def references(%__MODULE__{} = structure) do - Enum.flat_map(structure.properties, &Property.references/1) - end - - def resolve(%__MODULE__{properties: properties} = structure) when is_list(properties) do - structure - end - - def resolve(%__MODULE__{} = structure, %DataModel{} = data_model) do - %__MODULE__{structure | properties: properties(structure, data_model)} - end - - def properties(%__MODULE__{properties: properties}) when is_list(properties) do - properties - end - - def properties(%__MODULE__{} = structure, %DataModel{} = data_model) do - property_list(structure, data_model) - end - - defp resolve_remote_properties(%__MODULE__{} = structure, %DataModel{} = data_model) do - [] - |> add_extends(structure.definition) - |> add_mixins(structure.definition) - |> Enum.flat_map(fn %{"kind" => "reference", "name" => type_name} -> - data_model - |> DataModel.fetch!(type_name) - |> property_list(data_model) - end) - end - - defp property_list(%__MODULE__{} = structure, %DataModel{} = data_model) do - base_properties = - structure.definition - |> Map.get("properties") - |> Enum.map(&Property.new/1) - - base_property_names = MapSet.new(base_properties, & &1.name) - - # Note: The reject here is so that properties defined in the - # current structure override those defined in mixins and extends - resolved_remote_properties = - structure - |> resolve_remote_properties(data_model) - |> Enum.reject(&(&1.name in base_property_names)) - - base_properties - |> Enum.concat(resolved_remote_properties) - |> Enum.sort_by(& &1.name) - end - - defp add_extends(queue, %{"extends" => extends}) do - extends ++ queue - end - - defp add_extends(queue, _), do: queue - - defp add_mixins(queue, %{"mixins" => mixins}) do - mixins ++ queue - end - - defp add_mixins(queue, _), do: queue -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/type.ex b/apps/proto/lib/mix/tasks/lsp/data_model/type.ex deleted file mode 100644 index adcf45cd..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/type.ex +++ /dev/null @@ -1,439 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.Type do - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.DataModel.Property - alias Mix.Tasks.Lsp.DataModel.Structure - alias Mix.Tasks.Lsp.DataModel.TypeAlias - alias Mix.Tasks.Lsp.Mappings - - defmodule Base do - defstruct [:kind, :type_name] - - def new(type_name) do - %__MODULE__{kind: :base, type_name: type_name} - end - - def resolve(%__MODULE__{} = base, %DataModel{}) do - base - end - - def to_protocol(%__MODULE__{} = type, %DataModel{}, _mappings, _container_module) do - case type.type_name do - "string" -> quote(do: string()) - "integer" -> quote(do: integer()) - "uinteger" -> quote(do: integer()) - "boolean" -> quote(do: boolean()) - "null" -> quote(do: nil) - "DocumentUri" -> quote(do: string()) - "decimal" -> quote(do: float()) - "URI" -> quote(do: string()) - end - end - - def to_typespec(%__MODULE__{} = type) do - case type.type_name do - "string" -> quote(do: String.t()) - "integer" -> quote(do: integer()) - "uinteger" -> quote(do: integer()) - "boolean" -> quote(do: boolean()) - "null" -> quote(do: nil) - "DocumentUri" -> quote(do: String.t()) - "decimal" -> quote(do: float()) - "URI" -> quote(do: Expert.uri()) - end - end - - def references(%__MODULE__{}) do - [] - end - end - - defmodule Array do - alias Mix.Tasks.Lsp.DataModel.Type - defstruct [:kind, :element_type] - - def new(parent_name, element_type) do - %__MODULE__{kind: :array, element_type: Type.new(parent_name, element_type)} - end - - def resolve(%__MODULE__{} = array, %DataModel{} = data_model) do - %__MODULE__{array | element_type: Type.resolve(array.element_type, data_model)} - end - - def to_protocol( - %__MODULE__{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - element_protocol = - Type.to_protocol(type.element_type, data_model, mappings, container_module) - - quote(do: list_of(unquote(element_protocol))) - end - - def references(%__MODULE__{} = array) do - %type_module{} = array.element_type - type_module.references(array.element_type) - end - end - - defmodule Tuple do - alias Mix.Tasks.Lsp.DataModel.Type - defstruct [:kind, :item_types] - - def new(parent_name, items) do - item_types = Enum.map(items, &Type.new(parent_name, &1)) - %__MODULE__{kind: :tuple, item_types: item_types} - end - - def resolve(%__MODULE__{} = tuple, %DataModel{} = data_model) do - resolved_types = Enum.map(tuple.item_types, &Type.resolve(&1, data_model)) - %__MODULE__{tuple | item_types: resolved_types} - end - - def to_protocol( - %__MODULE__{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - types = - Enum.map(type.item_types, &Type.to_protocol(&1, data_model, mappings, container_module)) - - quote(do: tuple_of(unquote(types))) - end - - def references(%__MODULE__{} = tuple) do - Enum.flat_map(tuple.item_types, fn %type_module{} = type -> type_module.references(type) end) - end - end - - defmodule Reference do - alias Mix.Tasks.Lsp.DataModel.Enumeration - alias Mix.Tasks.Lsp.DataModel.Structure - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.DataModel.TypeAlias - defstruct [:kind, :reference] - - def new(reference) do - %__MODULE__{kind: :reference, reference: reference} - end - - def resolve(%__MODULE__{} = reference, %DataModel{} = data_model) do - case DataModel.fetch!(data_model, reference.reference) do - %Enumeration{} = enumeration -> - Enumeration.resolve(enumeration, data_model) - - %Structure{} = structure -> - structure - - %TypeAlias{} = type_alias -> - TypeAlias.resolve(type_alias, data_model) - end - end - - def to_protocol( - %__MODULE__{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - _container_module - ) do - case DataModel.fetch!(data_model, type.reference) do - %Enumeration{} = enumeration -> - {:ok, enumeration_module} = - Mappings.fetch_destination_module(mappings, enumeration, true) - - quote(do: unquote(enumeration_module)) - - %Structure{} = structure -> - {:ok, mapped_module} = Mappings.fetch_destination_module(mappings, structure, true) - - quote(do: unquote(mapped_module)) - - %TypeAlias{} = type_alias -> - {:ok, mapped_module} = Mappings.fetch_destination_module(mappings, type_alias, true) - quote(do: unquote(mapped_module)) - end - end - - def references(%__MODULE__{} = reference) do - [reference.reference] - end - end - - defmodule Or do - alias Mix.Tasks.Lsp.DataModel.Property - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.Mappings.NumberingContext - - defstruct [:kind, :subtypes] - - def new(parent_name, subtypes) do - subtypes = Enum.map(subtypes, &Type.new(parent_name, &1)) - %__MODULE__{kind: :or, subtypes: subtypes} - end - - def resolve(%__MODULE__{} = or_type, %DataModel{} = data_model) do - resolved_subtypes = Enum.map(or_type.subtypes, &Type.resolve(&1, data_model)) - - %__MODULE__{or_type | subtypes: resolved_subtypes} - or_type - end - - def to_protocol( - %__MODULE__{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - subtypes = - Enum.map(type.subtypes, &Type.to_protocol(&1, data_model, mappings, container_module)) - - quote(do: one_of(unquote(subtypes))) - end - - def references(%__MODULE__{} = type) do - Enum.flat_map(type.subtypes, fn %type_module{} = type -> type_module.references(type) end) - end - end - - defmodule ObjectLiteral do - alias Mix.Tasks.Lsp.DataModel.Property - alias Mix.Tasks.Lsp.DataModel.Structure - alias Mix.Tasks.Lsp.Mappings.NumberingContext - - defstruct [:kind, :name, :properties, :definition, :module] - - def new(parent_name, definition) do - base_name = Macro.camelize(parent_name) - - module = - case NumberingContext.get_and_increment({parent_name, base_name}) do - 0 -> Module.concat([base_name]) - sequence -> Module.concat(["#{base_name}#{sequence}"]) - end - - properties = Enum.map(definition, &Property.new/1) - - %__MODULE__{ - definition: definition, - kind: :object_literal, - properties: properties, - name: base_name, - module: module - } - end - - def resolve(%__MODULE__{properties: nil} = literal, %DataModel{} = data_model) do - resolved_properties = - %{"properties" => literal.definition, "name" => "Literal"} - |> Structure.new() - |> Structure.resolve(data_model) - |> Structure.properties(data_model) - - %__MODULE__{literal | properties: resolved_properties} - end - - def resolve(%__MODULE__{} = literal, _) do - literal - end - - def to_protocol(%__MODULE__{} = literal, %DataModel{}, %Mappings{}, container_module) do - module = module(literal) - quote(do: unquote(Module.concat(container_module, module))) - end - - def build_definition( - %__MODULE__{} = literal, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - resolved = resolve(literal, data_model) - module = module(literal) - - properties = - resolved.properties - |> Enum.sort_by(& &1.name) - |> Enum.map(&Property.to_protocol(&1, data_model, mappings, container_module)) - - quote do - defmodule unquote(module) do - use Proto - - deftype(unquote(properties)) - end - end - end - - defp module(%__MODULE__{} = literal) do - literal.module - end - - def references(%__MODULE__{} = literal) do - Enum.flat_map(literal.properties, &Property.references/1) - end - end - - defmodule Literal do - defstruct [:kind, :value, :base_type] - - def new(base_type, value) do - %__MODULE__{base_type: base_type, value: value, kind: :literal} - end - - def resolve(%__MODULE__{} = literal, %DataModel{}) do - literal - end - - def to_protocol(%__MODULE__{} = type, %DataModel{}, %Mappings{}, _container_module) do - quote(do: literal(unquote(type.value))) - end - - def references(%__MODULE__{}) do - [] - end - end - - defmodule Dictionary do - alias Mix.Tasks.Lsp.DataModel.Type - defstruct [:kind, :key_type, :value_type] - - def new(parent_name, key_type, value_type) do - %__MODULE__{ - kind: :map, - key_type: Type.new(parent_name, key_type), - value_type: Type.new(parent_name, value_type) - } - end - - def resolve(%__MODULE__{} = map, %DataModel{} = data_model) do - resolved_key_type = Type.resolve(map.key_type, data_model) - resolved_value_type = Type.resolve(map.value_type, data_model) - %__MODULE__{map | key_type: resolved_key_type, value_type: resolved_value_type} - end - - def to_protocol( - %__MODULE__{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - value_type = Type.to_protocol(type.value_type, data_model, mappings, container_module) - quote(do: map_of(unquote(value_type))) - end - - def references(%__MODULE__{} = dictionary) do - %key_module{} = dictionary.key_type - %value_module{} = dictionary.value_type - - List.flatten([ - key_module.references(dictionary.key_type), - value_module.references(dictionary.value_type) - ]) - end - end - - def new(_parent_name, %{"kind" => "base", "name" => name}) do - Base.new(name) - end - - def new(_parent_name, %{"kind" => "reference", "name" => name}) do - Reference.new(name) - end - - def new(parent_name, %{"kind" => "or", "items" => types}) do - Or.new(parent_name, types) - end - - def new(_parent_name, %{"kind" => "stringLiteral", "value" => value}) do - Literal.new(:string, value) - end - - def new(parent_name, %{"kind" => "literal", "value" => %{"properties" => properties}}) do - ObjectLiteral.new(parent_name, properties) - end - - def new(parent_name, %{"kind" => "array", "element" => element_type}) do - Array.new(parent_name, element_type) - end - - def new(parent_name, %{"kind" => "map", "key" => key_type, "value" => value_type}) do - Dictionary.new(parent_name, key_type, value_type) - end - - def new(parent_name, %{"kind" => "tuple", "items" => items}) do - Tuple.new(parent_name, items) - end - - def resolve(%type_module{} = type, %DataModel{} = data_model) do - type_module.resolve(type, data_model) - end - - def to_protocol(%{reference: "LSPAny"}, _, _, _) do - quote(do: any()) - end - - def to_protocol(%{reference: "LSPObject"}, _, _, _) do - quote(do: map_of(any())) - end - - def to_protocol(%{reference: "LSPArray"}, _, _, _) do - quote(do: list_of(any())) - end - - def to_protocol( - %type_module{} = type, - %DataModel{} = data_model, - %Mappings{} = mappings, - container_module - ) do - type_module.to_protocol(type, data_model, mappings, container_module) - end - - def collect_object_literals(type, %DataModel{} = data_model) do - type - |> collect_object_literals(data_model, []) - |> Enum.sort_by(& &1.module) - end - - def collect_object_literals(%ObjectLiteral{} = literal, %DataModel{} = data_model, acc) do - Enum.reduce(literal.properties, [literal | acc], &collect_object_literals(&1, data_model, &2)) - end - - def collect_object_literals(%Property{} = property, %DataModel{} = data_model, acc) do - collect_object_literals(property.type, data_model, acc) - end - - def collect_object_literals(%Array{} = array, %DataModel{} = data_model, acc) do - collect_object_literals(array.element_type, data_model, acc) - end - - def collect_object_literals(%Tuple{} = tuple, %DataModel{} = data_model, acc) do - Enum.reduce(tuple.item_types, acc, &collect_object_literals(&1, data_model, &2)) - end - - def collect_object_literals(%Structure{} = structure, %DataModel{} = data_model, acc) do - Enum.reduce(structure.properties, acc, &collect_object_literals(&1.type, data_model, &2)) - end - - def collect_object_literals(%Or{} = or_type, %DataModel{} = data_model, acc) do - Enum.reduce(or_type.subtypes, acc, &collect_object_literals(&1, data_model, &2)) - end - - def collect_object_literals(%Base{}, %DataModel{}, acc) do - acc - end - - def collect_object_literals(%Reference{}, %DataModel{}, acc) do - acc - end - - def collect_object_literals(%TypeAlias{name: "LSP" <> _}, _, acc) do - acc - end - - def collect_object_literals(_, _, acc) do - acc - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/data_model/type_alias.ex b/apps/proto/lib/mix/tasks/lsp/data_model/type_alias.ex deleted file mode 100644 index 9bd5e876..00000000 --- a/apps/proto/lib/mix/tasks/lsp/data_model/type_alias.ex +++ /dev/null @@ -1,91 +0,0 @@ -defmodule Mix.Tasks.Lsp.DataModel.TypeAlias do - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.DataModel.Type - alias Mix.Tasks.Lsp.DataModel.Type.Base - alias Mix.Tasks.Lsp.DataModel.Type.ObjectLiteral - alias Mix.Tasks.Lsp.Mappings - - defstruct name: nil, type: nil - - def new(%{"name" => name, "type" => type}) do - type = Type.new(name, type) - - %__MODULE__{ - name: name, - type: type - } - end - - def resolve(%__MODULE__{name: "LSP" <> _} = type_alias, %DataModel{}) do - type_alias - end - - def resolve(%__MODULE__{} = type_alias, %DataModel{} = data_model) do - %__MODULE__{type_alias | type: Type.resolve(type_alias.type, data_model)} - end - - def build_definition(%__MODULE__{name: "LSP" <> _}, _, _, _) do - :skip - end - - def build_definition(%__MODULE__{type: %Base{}} = type_alias, %Mappings{} = mappings, _, _) do - with {:ok, destination_module} <- Mappings.fetch_destination_module(mappings, type_alias.name) do - type = Base.to_typespec(type_alias.type) - - ast = - quote do - defmodule unquote(destination_module) do - @type t :: unquote(type) - end - end - - {:ok, ast} - end - end - - def build_definition( - %__MODULE__{} = type_alias, - %Mappings{} = mappings, - %DataModel{} = data_model, - _container_module - ) do - with {:ok, destination_module} <- Mappings.fetch_destination_module(mappings, type_alias.name) do - type = Type.to_protocol(type_alias.type, data_model, mappings, destination_module) - object_literals = Type.collect_object_literals(type_alias.type, data_model) - types_module = Mappings.types_module(mappings) - proto_module = Mappings.proto_module(mappings) - - literal_definitions = - Enum.map( - object_literals, - &ObjectLiteral.build_definition(&1, data_model, mappings, destination_module) - ) - - type_module_alias = - case references(type_alias) do - [] -> [] - _ -> [quote(do: alias(unquote(types_module)))] - end - - ast = - quote do - defmodule unquote(destination_module) do - alias unquote(proto_module) - unquote_splicing(type_module_alias) - - unquote_splicing(literal_definitions) - - use Proto - defalias unquote(type) - end - end - - {:ok, ast} - end - end - - def references(%__MODULE__{} = type_alias) do - %type_module{} = type_alias.type - type_module.references(type_alias.type) - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/mappings.ex b/apps/proto/lib/mix/tasks/lsp/mappings.ex deleted file mode 100644 index 94cc60ed..00000000 --- a/apps/proto/lib/mix/tasks/lsp/mappings.ex +++ /dev/null @@ -1,148 +0,0 @@ -defmodule Mix.Tasks.Lsp.Mappings do - defmodule Mapping do - @derive Jason.Encoder - - defstruct [:source, :destination, :imported_version] - - @version "3.17" - def new(%{ - "source" => source, - "destination" => destination - }) do - new(source, destination) - end - - def new(source, destination) do - %__MODULE__{source: source, destination: destination, imported_version: @version} - end - end - - @types_module Expert.Protocol.Types - @proto_module Expert.Proto - - defstruct [:mappings, :imported_lsp_names, :types_module, :proto_module] - - def new(options \\ []) do - types_module = - options - |> Keyword.get(:types_module, @types_module) - |> List.wrap() - |> Module.concat() - - proto_module = - options - |> Keyword.get(:proto_module, @proto_module) - |> List.wrap() - |> Module.concat() - - with {:ok, type_mappings} <- load_type_mappings() do - imported_lsp_names = MapSet.new(type_mappings, & &1.source) - - mappings = %__MODULE__{ - mappings: type_mappings, - imported_lsp_names: imported_lsp_names, - types_module: types_module, - proto_module: proto_module - } - - {:ok, mappings} - end - end - - def proto_module(%__MODULE__{} = mappings) do - mappings.proto_module - end - - def types_module(%__MODULE__{} = mappings) do - mappings.types_module - end - - def put_new(%__MODULE__{} = mappings, source, destination) do - if imported?(mappings, source) do - :error - else - i = Mapping.new(source, destination) - - mappings = %__MODULE__{ - imported_lsp_names: MapSet.put(mappings.imported_lsp_names, i.source), - mappings: [i | mappings.mappings] - } - - {:ok, mappings} - end - end - - def write(%__MODULE__{} = mappings) do - sorted = Enum.sort_by(mappings.mappings, fn %Mapping{} = mapping -> mapping.source end) - - with {:ok, json_text} <- Jason.encode(sorted, pretty: true) do - json_text = [json_text, "\n"] - File.write(file_path(), json_text) - end - end - - def imported?(%__MODULE__{} = mappings, lsp_name) do - lsp_name in mappings.imported_lsp_names - end - - def fetch(%__MODULE__{} = mappings, lsp_name) do - case Enum.find(mappings.mappings, fn %Mapping{source: source} -> source == lsp_name end) do - %Mapping{} = mapping -> {:ok, mapping} - nil -> :error - end - end - - def fetch_destination_module(mappings, needle, truncate? \\ false) - - def fetch_destination_module(%__MODULE__{} = mappings, %_{name: lsp_name}, truncate?) do - fetch_destination_module(mappings, lsp_name, truncate?) - end - - def fetch_destination_module(%__MODULE__{} = mappings, lsp_name, truncate?) do - case fetch(mappings, lsp_name) do - {:ok, %Mapping{} = mapping} -> - module_string = - if truncate? do - aliased = - mappings - |> types_module() - |> Module.split() - |> List.last() - - Module.concat([aliased, mapping.destination]) - else - Module.concat([types_module(mappings), mapping.destination]) - end - - {:ok, Module.concat([module_string])} - - error -> - error - end - end - - @import_filename "type_mappings.json" - defp load_type_mappings do - import_file_path = file_path() - - with {:ok, json_text} <- File.read(import_file_path), - {:ok, contents} <- Jason.decode(json_text) do - {:ok, from_json(contents)} - end - end - - defp from_json(json_file) do - Enum.map(json_file, &Mapping.new/1) - end - - defp file_path do - current_dir = Path.dirname(__ENV__.file) - Path.join([current_dir, @import_filename]) - end - - defimpl Inspect, for: __MODULE__ do - def inspect(_, _) do - "#Mappings<>" - end - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/mappings/generate.ex b/apps/proto/lib/mix/tasks/lsp/mappings/generate.ex deleted file mode 100644 index f7cfd4fa..00000000 --- a/apps/proto/lib/mix/tasks/lsp/mappings/generate.ex +++ /dev/null @@ -1,231 +0,0 @@ -defmodule Mix.Tasks.Lsp.Mappings.Generate do - use Mix.Task - @shortdoc "Generate the LSP protocol modules" - @moduledoc """ - Generate the LSP protocol modules - - This task reads the mapping file and generates all of the LSP protocol artifacts. - Prior to running this task, you must first generate the mapping file with `mix lsp.mappings.init`. - That will create the file `type_mappings.json` which contains the source and destination modules for all - defined LSP types. - - Once that file is generated, the file can be edited to control where the generated elixir modules will live. - While doing the mapping, it's often helpful to run `mix lsp.mappings.print` to see current state of the mapping. - Once you're satisfied, run this task and elixir files will be generated in `lib/generated`. - - - ## Command line options - * `--types-module` - Controls the module in which the generated structures are placed. - (defaults to `Expert.Protocol.Types`) - * `--proto-module` - Controls the module in which the generated structures are placed. - (defaults to `Expert.Proto`) - * `--only` - Only generate the LSP types in the comma separated list - * `--roots` - A comma separated list of types to import. The types given will be interrogated - and all their references will also be imported. This is useful when importing complex structures, - as you don't need to specify all the types you wish to import. - """ - - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.Mappings - alias Mix.Tasks.Lsp.Mappings.Mapping - - @generated_files_root ~w(lib generated) - @switches [ - only: :string, - proto_module: :string, - roots: :string, - types_module: :string - ] - - def run(args) do - args - |> parse_options() - |> do_run() - end - - def do_run(options) do - mappings_opts = Keyword.take(options, [:types_module, :proto_module]) - - with {:ok, %DataModel{} = data_model} <- DataModel.new(), - {:ok, mappings} <- Mappings.new(mappings_opts), - {:ok, types_to_map} <- get_mapped_types(options, data_model), - {:ok, results} <- map_lsp_types(types_to_map, data_model, mappings) do - IO.puts("Mapping complete, writing #{length(results)} files") - - for {file_name, ast} <- results do - write_file(file_name, ast) - IO.write(".") - end - - IO.puts("\nComplete.") - else - {:error, reason} -> - Mix.Shell.IO.error("An error occurred during mapping #{to_string(reason)}") - - error -> - Mix.Shell.IO.error("An error occurred during mapping #{inspect(error)}") - end - end - - defp parse_options(args) do - {keywords, _, _} = OptionParser.parse(args, strict: @switches) - - if Keyword.has_key?(keywords, :only) and Keyword.has_key?(keywords, :roots) do - raise "You can only specify one of --only and --roots" - end - - keywords - |> replace_lazy(:only, &split_comma_delimited/1) - |> replace_lazy(:roots, &split_comma_delimited/1) - end - - defp map_lsp_types(types_to_map, %DataModel{} = data_model, %Mappings{} = mappings) do - mapping_results = - types_to_map - |> Enum.map(&do_mapping(&1, mappings, data_model)) - |> Enum.reduce_while([], fn - :skip, acc -> - IO.write([IO.ANSI.yellow(), ".", IO.ANSI.reset()]) - - {:cont, acc} - - {:ok, file, ast}, results -> - IO.write([IO.ANSI.green(), ".", IO.ANSI.reset()]) - - {:cont, [{file, ast} | results]} - - error, _ -> - IO.write([IO.ANSI.red(), "x", IO.ANSI.reset()]) - - {:halt, error} - end) - - IO.puts("") - - case mapping_results do - results when is_list(results) -> - {:ok, Enum.reverse(results)} - - error -> - error - end - end - - defp do_mapping(%struct_module{} = structure, %Mappings{} = mappings, %DataModel{} = data_model) do - with {:ok, %Mapping{}} <- Mappings.fetch(mappings, structure.name), - {:ok, destination_module} <- Mappings.fetch_destination_module(mappings, structure.name), - {:ok, definition_ast} <- - struct_module.build_definition(structure, mappings, data_model, destination_module) do - {:ok, file_for(destination_module), definition_ast} - end - end - - defp get_mapped_types(options, %DataModel{} = data_model) do - cond do - Keyword.has_key?(options, :only) -> - options - |> Keyword.get(:only) - |> do_get_mapped_types(data_model) - - Keyword.has_key?(options, :roots) -> - roots = Keyword.get(options, :roots) - - data_model - |> DataModel.references(roots) - |> do_get_mapped_types(data_model) - - true -> - do_get_mapped_types(:all, data_model) - end - end - - defp do_get_mapped_types(:all, %DataModel{} = data_model) do - all_types = - data_model - |> DataModel.all_types() - |> Enum.sort_by(& &1.name) - - {:ok, all_types} - end - - defp do_get_mapped_types(structure_names, %DataModel{} = data_model) do - results = - Enum.reduce_while(structure_names, [], fn name, acc -> - case DataModel.fetch(data_model, name) do - {:ok, structure} -> {:cont, [structure | acc]} - _ -> {:halt, {:error, "'#{name}' is not the name of a valid LSP structure"}} - end - end) - - case results do - mappings when is_list(mappings) -> - {:ok, Enum.sort_by(mappings, & &1.name)} - - error -> - error - end - end - - defp file_for(destination_module) do - base = Path.split(File.cwd!()) ++ @generated_files_root - - pieces = Module.split(destination_module) - {modules, [file]} = Enum.split(pieces, length(pieces) - 1) - - directories = - for module <- modules, - module != "ElixirLS" do - Macro.underscore(module) - end - - file_name = - case Macro.underscore(file) do - "_" <> rest -> rest <> ".ex" - other -> other <> ".ex" - end - - (base ++ directories) - |> Path.join() - |> Path.join(file_name) - end - - def write_file(file_path, ast) do - dir = Path.dirname(file_path) - File.mkdir_p!(dir) - {formatter, options} = formatter_and_opts_for(file_path) - locals_without_parens = Keyword.get(options, :locals_without_parens) - code = ast_to_string(ast, locals_without_parens, formatter) - File.write!(file_path, [header(), code]) - end - - defp ast_to_string(ast, locals_without_parens, formatter) do - ast - |> Code.quoted_to_algebra(locals_without_parens: locals_without_parens) - |> Inspect.Algebra.format(:infinity) - |> IO.iodata_to_binary() - |> formatter.() - end - - defp formatter_and_opts_for(file_path) do - Mix.Tasks.Format.formatter_for_file(file_path) - end - - defp header do - """ - # This file's contents are auto-generated. Do not edit. - """ - end - - defp split_comma_delimited(string) do - string - |> String.split(",") - |> Enum.map(&String.trim/1) - end - - defp replace_lazy(keywords, key, function) do - case Keyword.fetch(keywords, key) do - {:ok, value} -> Keyword.replace(keywords, key, function.(value)) - :error -> keywords - end - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/mappings/init.ex b/apps/proto/lib/mix/tasks/lsp/mappings/init.ex deleted file mode 100644 index 2b0d33cc..00000000 --- a/apps/proto/lib/mix/tasks/lsp/mappings/init.ex +++ /dev/null @@ -1,48 +0,0 @@ -defmodule Mix.Tasks.Lsp.Mappings.Init do - alias Mix.Shell.IO, as: ShellIO - alias Mix.Tasks.Lsp.DataModel - alias Mix.Tasks.Lsp.Mappings - - use Mix.Task - @base_module "ElixirLS.LanguageServer.Experimental.Protocol.Types" - def run(_) do - with {:ok, data_model} <- DataModel.new(), - {:ok, current} <- Mappings.new() do - current = - current - |> write_structures(data_model) - |> write_enumerations(data_model) - |> write_type_aliases(data_model) - - Mappings.write(current) - end - end - - defp write_structures(%Mappings{} = mappings, %DataModel{} = data_model) do - write_data_type(data_model.structures, mappings) - end - - defp write_enumerations(%Mappings{} = mappings, %DataModel{} = data_model) do - write_data_type(data_model.enumerations, mappings) - end - - defp write_type_aliases(%Mappings{} = mappings, %DataModel{} = data_model) do - write_data_type(data_model.type_aliases, mappings) - end - - defp write_data_type(list_of_data_types, %Mappings{} = mappings) do - Enum.reduce(list_of_data_types, mappings, fn - {name, _}, %Mappings{} = curr -> - destination_module = "#{@base_module}.#{name}" - - case Mappings.put_new(curr, name, destination_module) do - {:ok, new_current} -> - new_current - - :error -> - ShellIO.info("#{name} has already been mapped") - mappings - end - end) - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/mappings/numbering_context.ex b/apps/proto/lib/mix/tasks/lsp/mappings/numbering_context.ex deleted file mode 100644 index 45ae4e30..00000000 --- a/apps/proto/lib/mix/tasks/lsp/mappings/numbering_context.ex +++ /dev/null @@ -1,32 +0,0 @@ -defmodule Mix.Tasks.Lsp.Mappings.NumberingContext do - def new do - Process.put(:numbering, %{}) - end - - def get(name) do - :numbering - |> Process.get(%{}) - |> Map.get(name) - end - - def get_and_increment(name) do - case Process.get(:numbering, :undefined) do - :undefined -> - Process.put(:numbering, %{name => 1}) - 0 - - %{} = other -> - {existing, updated} = - Map.get_and_update(other, name, fn - nil -> - {0, 1} - - current -> - {current, current + 1} - end) - - Process.put(:numbering, updated) - existing - end - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/mappings/print.ex b/apps/proto/lib/mix/tasks/lsp/mappings/print.ex deleted file mode 100644 index 11c6f01d..00000000 --- a/apps/proto/lib/mix/tasks/lsp/mappings/print.ex +++ /dev/null @@ -1,183 +0,0 @@ -defmodule Mix.Tasks.Lsp.Mappings.Print do - alias IO.ANSI - alias Mix.Tasks.Lsp.Mappings - alias Mix.Tasks.Lsp.Mappings.Mapping - - defmodule Node do - defstruct path: nil, value: nil, children: %{} - - def new(path \\ nil) do - %__MODULE__{path: path} - end - - def children_size(%__MODULE__{} = node) do - map_size(node.children) - end - - def name(%__MODULE__{} = node) do - case node.path do - list when is_list(list) -> List.last(list) - nil -> "<>" - end - end - - def has_value?(%__MODULE__{} = node) do - node.value != nil - end - - def add(%__MODULE__{} = node, path, value) do - do_add(node, path, [], value) - end - - defp do_add(%__MODULE__{} = node, [], current_path, value) do - %__MODULE__{node | value: value, path: Enum.reverse(current_path)} - end - - defp do_add(%__MODULE__{} = node, [next | rest], current_path, value) do - current_path = [next | current_path] - - children = - Map.update( - node.children, - next, - current_path |> Enum.reverse() |> new() |> do_add(rest, current_path, value), - fn %Node{} = existing -> - do_add(existing, rest, current_path, value) - end - ) - - %__MODULE__{node | children: children} - end - end - - @shortdoc "Prints out the current mappings" - @moduledoc """ - Prints out the current mappings - This task reads `type_mappings.json` and generates a nested tree of the current mappings, much - like `mix deps.tree` does. - Use this task while determining where mappings live, as it's much easier to see the module structure - graphically as opposed to remembering all the mappings in the json file. - """ - use Mix.Task - @down "└" - @right "─" - @tee "├" - - def run(_) do - with {:ok, mappings} <- Mappings.new() do - print(mappings) - end - end - - def print(%Mappings{} = mappings) do - legend() - - mappings - |> build_tree() - |> print_tree() - end - - defp legend do - """ - Current Module mappings follow. - Modules that will result in a mapping file are #{mapped_module_color()}WrittenLikeThis#{ANSI.reset()} - while modules that just hold other modules are #{namespace_color()}WrittenLikeThis#{ANSI.reset()} - """ - |> IO.puts() - end - - defp mapped_module_color do - [ANSI.bright(), ANSI.white()] - end - - defp namespace_color do - [ANSI.cyan(), ANSI.italic()] - end - - defp print_tree(%Node{path: nil} = root) do - print_children(root, -1) - end - - defp print_tree(%Node{} = node, level \\ 0, last? \\ false) do - child_count_message = - case Node.children_size(node) do - 0 -> - "" - - child_count -> - ["(", pluralize(child_count, "child", "children"), ")"] - end - - sep = - cond do - level == 0 -> - "" - - last? -> - @down - - true -> - @tee - end - - name_color = - if Node.has_value?(node) do - mapped_module_color() - else - namespace_color() - end - - child_color = ANSI.yellow() - - indent = String.duplicate(" ", 2 * level) - - IO.puts([ - indent, - sep, - @right, - " ", - name_color, - Node.name(node), - ANSI.reset(), - " ", - child_color, - child_count_message, - ANSI.reset() - ]) - - print_children(node, level) - end - - defp print_children(%Node{children: children} = node, level) when map_size(children) > 0 do - child_count = Node.children_size(node) - - children - |> Map.values() - |> Enum.sort_by(&Node.name(&1)) - |> Enum.with_index() - |> Enum.each(fn {%Node{} = child, index} -> - print_tree(child, level + 1, last?(child_count, index)) - end) - end - - defp print_children(_, _) do - end - - defp pluralize(1, singular, _plural), do: "1 #{singular}" - defp pluralize(num, _, plural), do: "#{num} #{plural}" - - defp build_tree(%Mappings{} = mappings) do - Enum.reduce(mappings.mappings, Node.new(), fn %Mapping{} = mapping, %Node{} = root -> - path = split_module(mapping.destination) - Node.add(root, path, List.last(path)) - end) - end - - defp last?(item_count, index) do - index == item_count - 1 - end - - defp split_module(s) do - String.split(s, ".") - end -end diff --git a/apps/proto/lib/mix/tasks/lsp/metamodel.3.17.json b/apps/proto/lib/mix/tasks/lsp/metamodel.3.17.json deleted file mode 100644 index b43b4bdb..00000000 --- a/apps/proto/lib/mix/tasks/lsp/metamodel.3.17.json +++ /dev/null @@ -1,14383 +0,0 @@ -{ - "metaData": { - "version": "3.17.0" - }, - "requests": [ - { - "method": "textDocument/implementation", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Definition" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "ImplementationParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "ImplementationRegistrationOptions" - }, - "documentation": "A request to resolve the implementation locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositionParams]\n(#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\nThenable that resolves to such." - }, - { - "method": "textDocument/typeDefinition", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Definition" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "TypeDefinitionParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "TypeDefinitionRegistrationOptions" - }, - "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositionParams]\n(#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a\nThenable that resolves to such." - }, - { - "method": "workspace/workspaceFolders", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceFolder" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "serverToClient", - "documentation": "The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders." - }, - { - "method": "workspace/configuration", - "result": { - "kind": "array", - "element": { - "kind": "reference", - "name": "LSPAny" - } - }, - "messageDirection": "serverToClient", - "params": { - "kind": "and", - "items": [ - { - "kind": "reference", - "name": "ConfigurationParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ] - }, - "documentation": "The 'workspace/configuration' request is sent from the server to the client to fetch a certain\nconfiguration setting.\n\nThis pull model replaces the old push model were the client signaled configuration change via an\nevent. If the server still needs to react to configuration changes (since the server caches the\nresult of `workspace/configuration` requests) the server should register for an empty configuration\nchange event and empty the cache if such an event is received." - }, - { - "method": "textDocument/documentColor", - "result": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ColorInformation" - } - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentColorParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ColorInformation" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentColorRegistrationOptions" - }, - "documentation": "A request to list all color symbols found in a given text document. The request's\nparameter is of type [DocumentColorParams](#DocumentColorParams) the\nresponse is of type [ColorInformation[]](#ColorInformation) or a Thenable\nthat resolves to such." - }, - { - "method": "textDocument/colorPresentation", - "result": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ColorPresentation" - } - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "ColorPresentationParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ColorPresentation" - } - }, - "registrationOptions": { - "kind": "and", - "items": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - }, - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ] - }, - "documentation": "A request to list all presentation for a color. The request's\nparameter is of type [ColorPresentationParams](#ColorPresentationParams) the\nresponse is of type [ColorInformation[]](#ColorInformation) or a Thenable\nthat resolves to such." - }, - { - "method": "textDocument/foldingRange", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "FoldingRange" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "FoldingRangeParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FoldingRange" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "FoldingRangeRegistrationOptions" - }, - "documentation": "A request to provide folding ranges in a document. The request's\nparameter is of type [FoldingRangeParams](#FoldingRangeParams), the\nresponse is of type [FoldingRangeList](#FoldingRangeList) or a Thenable\nthat resolves to such." - }, - { - "method": "textDocument/declaration", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Declaration" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DeclarationLink" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DeclarationParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DeclarationLink" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "DeclarationRegistrationOptions" - }, - "documentation": "A request to resolve the type definition locations of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPositionParams]\n(#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)\nor a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves\nto such." - }, - { - "method": "textDocument/selectionRange", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "SelectionRange" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SelectionRangeParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SelectionRange" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "SelectionRangeRegistrationOptions" - }, - "documentation": "A request to provide selection ranges in a document. The request's\nparameter is of type [SelectionRangeParams](#SelectionRangeParams), the\nresponse is of type [SelectionRange[]](#SelectionRange[]) or a Thenable\nthat resolves to such." - }, - { - "method": "window/workDoneProgress/create", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "WorkDoneProgressCreateParams" - }, - "documentation": "The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress\nreporting from the server." - }, - { - "method": "textDocument/prepareCallHierarchy", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "CallHierarchyItem" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CallHierarchyPrepareParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "CallHierarchyRegistrationOptions" - }, - "documentation": "A request to result a `CallHierarchyItem` in a document at a given position.\nCan be used as an input to an incoming or outgoing call hierarchy.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "callHierarchy/incomingCalls", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "CallHierarchyIncomingCall" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CallHierarchyIncomingCallsParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CallHierarchyIncomingCall" - } - }, - "documentation": "A request to resolve the incoming calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "callHierarchy/outgoingCalls", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "CallHierarchyOutgoingCall" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CallHierarchyOutgoingCallsParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CallHierarchyOutgoingCall" - } - }, - "documentation": "A request to resolve the outgoing calls for a given `CallHierarchyItem`.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/semanticTokens/full", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SemanticTokens" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SemanticTokensParams" - }, - "partialResult": { - "kind": "reference", - "name": "SemanticTokensPartialResult" - }, - "registrationMethod": "textDocument/semanticTokens", - "registrationOptions": { - "kind": "reference", - "name": "SemanticTokensRegistrationOptions" - }, - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/semanticTokens/full/delta", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SemanticTokens" - }, - { - "kind": "reference", - "name": "SemanticTokensDelta" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SemanticTokensDeltaParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SemanticTokensPartialResult" - }, - { - "kind": "reference", - "name": "SemanticTokensDeltaPartialResult" - } - ] - }, - "registrationMethod": "textDocument/semanticTokens", - "registrationOptions": { - "kind": "reference", - "name": "SemanticTokensRegistrationOptions" - }, - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/semanticTokens/range", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SemanticTokens" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SemanticTokensRangeParams" - }, - "partialResult": { - "kind": "reference", - "name": "SemanticTokensPartialResult" - }, - "registrationMethod": "textDocument/semanticTokens", - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/semanticTokens/refresh", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "clientToServer", - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "window/showDocument", - "result": { - "kind": "reference", - "name": "ShowDocumentResult" - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "ShowDocumentParams" - }, - "documentation": "A request to show a document. This request might open an\nexternal program depending on the value of the URI to open.\nFor example a request to open `https://code.visualstudio.com/`\nwill very likely open the URI in a WEB browser.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/linkedEditingRange", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "LinkedEditingRanges" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "LinkedEditingRangeParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "LinkedEditingRangeRegistrationOptions" - }, - "documentation": "A request to provide ranges that can be edited together.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/willCreateFiles", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceEdit" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CreateFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The will create files request is sent from the client to the server before files are actually\ncreated as long as the creation is triggered from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/willRenameFiles", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceEdit" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "RenameFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The will rename files request is sent from the client to the server before files are actually\nrenamed as long as the rename is triggered from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/willDeleteFiles", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceEdit" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DeleteFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The did delete files notification is sent from the client to the server when\nfiles were deleted from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/moniker", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Moniker" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "MonikerParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Moniker" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "MonikerRegistrationOptions" - }, - "documentation": "A request to get the moniker of a symbol at a given text document position.\nThe request parameter is of type [TextDocumentPositionParams](#TextDocumentPositionParams).\nThe response is of type [Moniker[]](#Moniker[]) or `null`." - }, - { - "method": "textDocument/prepareTypeHierarchy", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "TypeHierarchyPrepareParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TypeHierarchyRegistrationOptions" - }, - "documentation": "A request to result a `TypeHierarchyItem` in a document at a given position.\nCan be used as an input to a subtypes or supertypes type hierarchy.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "typeHierarchy/supertypes", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "TypeHierarchySupertypesParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - }, - "documentation": "A request to resolve the supertypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "typeHierarchy/subtypes", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "TypeHierarchySubtypesParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - }, - "documentation": "A request to resolve the subtypes for a given `TypeHierarchyItem`.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "textDocument/inlineValue", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "InlineValue" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "InlineValueParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "InlineValue" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "InlineValueRegistrationOptions" - }, - "documentation": "A request to provide inline values in a document. The request's parameter is of\ntype [InlineValueParams](#InlineValueParams), the response is of type\n[InlineValue[]](#InlineValue[]) or a Thenable that resolves to such.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "workspace/inlineValue/refresh", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "clientToServer", - "documentation": "@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "textDocument/inlayHint", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "InlayHint" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "InlayHintParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "InlayHint" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "InlayHintRegistrationOptions" - }, - "documentation": "A request to provide inlay hints in a document. The request's parameter is of\ntype [InlayHintsParams](#InlayHintsParams), the response is of type\n[InlayHint[]](#InlayHint[]) or a Thenable that resolves to such.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "inlayHint/resolve", - "result": { - "kind": "reference", - "name": "InlayHint" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "InlayHint" - }, - "documentation": "A request to resolve additional properties for an inlay hint.\nThe request's parameter is of type [InlayHint](#InlayHint), the response is\nof type [InlayHint](#InlayHint) or a Thenable that resolves to such.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "workspace/inlayHint/refresh", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "clientToServer", - "documentation": "@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "textDocument/diagnostic", - "result": { - "kind": "reference", - "name": "DocumentDiagnosticReport" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentDiagnosticParams" - }, - "partialResult": { - "kind": "reference", - "name": "DocumentDiagnosticReportPartialResult" - }, - "errorData": { - "kind": "reference", - "name": "DiagnosticServerCancellationData" - }, - "registrationOptions": { - "kind": "reference", - "name": "DiagnosticRegistrationOptions" - }, - "documentation": "The document diagnostic request definition.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "workspace/diagnostic", - "result": { - "kind": "reference", - "name": "WorkspaceDiagnosticReport" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WorkspaceDiagnosticParams" - }, - "partialResult": { - "kind": "reference", - "name": "WorkspaceDiagnosticReportPartialResult" - }, - "errorData": { - "kind": "reference", - "name": "DiagnosticServerCancellationData" - }, - "documentation": "The workspace diagnostic request definition.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "workspace/diagnostic/refresh", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "clientToServer", - "documentation": "The diagnostic refresh request definition.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "client/registerCapability", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "RegistrationParams" - }, - "documentation": "The `client/registerCapability` request is sent from the server to the client to register a new capability\nhandler on the client side." - }, - { - "method": "client/unregisterCapability", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "UnregistrationParams" - }, - "documentation": "The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability\nhandler on the client side." - }, - { - "method": "initialize", - "result": { - "kind": "reference", - "name": "InitializeResult" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "InitializeParams" - }, - "errorData": { - "kind": "reference", - "name": "InitializeError" - }, - "documentation": "The initialize request is sent from the client to the server.\nIt is sent once as the request after starting up the server.\nThe requests parameter is of type [InitializeParams](#InitializeParams)\nthe response if of type [InitializeResult](#InitializeResult) of a Thenable that\nresolves to such." - }, - { - "method": "shutdown", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "clientToServer", - "documentation": "A shutdown request is sent from the client to the server.\nIt is sent once when the client decides to shutdown the\nserver. The only notification that is sent after a shutdown request\nis the exit event." - }, - { - "method": "window/showMessageRequest", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "MessageActionItem" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "ShowMessageRequestParams" - }, - "documentation": "The show message request is sent from the server to the client to show a message\nand a set of options actions to the user." - }, - { - "method": "textDocument/willSaveWaitUntil", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WillSaveTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - "documentation": "A document will save request is sent from the client to the server before\nthe document is actually saved. The request can return an array of TextEdits\nwhich will be applied to the text document before it is saved. Please note that\nclients might drop results if computing the text edits took too long or if a\nserver constantly fails on this request. This is done to keep the save fast and\nreliable." - }, - { - "method": "textDocument/completion", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItem" - } - }, - { - "kind": "reference", - "name": "CompletionList" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CompletionParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItem" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "CompletionRegistrationOptions" - }, - "documentation": "Request to request completion at a given text document position. The request's\nparameter is of type [TextDocumentPosition](#TextDocumentPosition) the response\nis of type [CompletionItem[]](#CompletionItem) or [CompletionList](#CompletionList)\nor a Thenable that resolves to such.\n\nThe request can delay the computation of the [`detail`](#CompletionItem.detail)\nand [`documentation`](#CompletionItem.documentation) properties to the `completionItem/resolve`\nrequest. However, properties that are needed for the initial sorting and filtering, like `sortText`,\n`filterText`, `insertText`, and `textEdit`, must not be changed during resolve." - }, - { - "method": "completionItem/resolve", - "result": { - "kind": "reference", - "name": "CompletionItem" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CompletionItem" - }, - "documentation": "Request to resolve additional information for a given completion item.The request's\nparameter is of type [CompletionItem](#CompletionItem) the response\nis of type [CompletionItem](#CompletionItem) or a Thenable that resolves to such." - }, - { - "method": "textDocument/hover", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Hover" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "HoverParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "HoverRegistrationOptions" - }, - "documentation": "Request to request hover information at a given text document position. The request's\nparameter is of type [TextDocumentPosition](#TextDocumentPosition) the response is of\ntype [Hover](#Hover) or a Thenable that resolves to such." - }, - { - "method": "textDocument/signatureHelp", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SignatureHelp" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SignatureHelpParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "SignatureHelpRegistrationOptions" - } - }, - { - "method": "textDocument/definition", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Definition" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DefinitionParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DefinitionLink" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "DefinitionRegistrationOptions" - }, - "documentation": "A request to resolve the definition location of a symbol at a given text\ndocument position. The request's parameter is of type [TextDocumentPosition]\n(#TextDocumentPosition) the response is of either type [Definition](#Definition)\nor a typed array of [DefinitionLink](#DefinitionLink) or a Thenable that resolves\nto such." - }, - { - "method": "textDocument/references", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "ReferenceParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "ReferenceRegistrationOptions" - }, - "documentation": "A request to resolve project-wide references for the symbol denoted\nby the given text document position. The request's parameter is of\ntype [ReferenceParams](#ReferenceParams) the response is of type\n[Location[]](#Location) or a Thenable that resolves to such." - }, - { - "method": "textDocument/documentHighlight", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentHighlight" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentHighlightParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentHighlight" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentHighlightRegistrationOptions" - }, - "documentation": "Request to resolve a [DocumentHighlight](#DocumentHighlight) for a given\ntext document position. The request's parameter is of type [TextDocumentPosition]\n(#TextDocumentPosition) the request response is of type [DocumentHighlight[]]\n(#DocumentHighlight) or a Thenable that resolves to such." - }, - { - "method": "textDocument/documentSymbol", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolInformation" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentSymbol" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentSymbolParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolInformation" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentSymbol" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentSymbolRegistrationOptions" - }, - "documentation": "A request to list all symbols found in a given text document. The request's\nparameter is of type [TextDocumentIdentifier](#TextDocumentIdentifier) the\nresponse is of type [SymbolInformation[]](#SymbolInformation) or a Thenable\nthat resolves to such." - }, - { - "method": "textDocument/codeAction", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Command" - }, - { - "kind": "reference", - "name": "CodeAction" - } - ] - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CodeActionParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Command" - }, - { - "kind": "reference", - "name": "CodeAction" - } - ] - } - }, - "registrationOptions": { - "kind": "reference", - "name": "CodeActionRegistrationOptions" - }, - "documentation": "A request to provide commands for the given text document and range." - }, - { - "method": "codeAction/resolve", - "result": { - "kind": "reference", - "name": "CodeAction" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CodeAction" - }, - "documentation": "Request to resolve additional information for a given code action.The request's\nparameter is of type [CodeAction](#CodeAction) the response\nis of type [CodeAction](#CodeAction) or a Thenable that resolves to such." - }, - { - "method": "workspace/symbol", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolInformation" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceSymbol" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WorkspaceSymbolParams" - }, - "partialResult": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolInformation" - } - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceSymbol" - } - } - ] - }, - "registrationOptions": { - "kind": "reference", - "name": "WorkspaceSymbolRegistrationOptions" - }, - "documentation": "A request to list project-wide symbols matching the query string given\nby the [WorkspaceSymbolParams](#WorkspaceSymbolParams). The response is\nof type [SymbolInformation[]](#SymbolInformation) or a Thenable that\nresolves to such.\n\n@since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients\n need to advertise support for WorkspaceSymbols via the client capability\n `workspace.symbol.resolveSupport`.\n", - "since": "3.17.0 - support for WorkspaceSymbol in the returned data. Clients\nneed to advertise support for WorkspaceSymbols via the client capability\n`workspace.symbol.resolveSupport`." - }, - { - "method": "workspaceSymbol/resolve", - "result": { - "kind": "reference", - "name": "WorkspaceSymbol" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WorkspaceSymbol" - }, - "documentation": "A request to resolve the range inside the workspace\nsymbol's location.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "textDocument/codeLens", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeLens" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CodeLensParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeLens" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "CodeLensRegistrationOptions" - }, - "documentation": "A request to provide code lens for the given text document." - }, - { - "method": "codeLens/resolve", - "result": { - "kind": "reference", - "name": "CodeLens" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CodeLens" - }, - "documentation": "A request to resolve a command for a given code lens." - }, - { - "method": "workspace/codeLens/refresh", - "result": { - "kind": "base", - "name": "null" - }, - "messageDirection": "serverToClient", - "documentation": "A request to refresh all code actions\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "textDocument/documentLink", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentLink" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentLinkParams" - }, - "partialResult": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentLink" - } - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentLinkRegistrationOptions" - }, - "documentation": "A request to provide document links" - }, - { - "method": "documentLink/resolve", - "result": { - "kind": "reference", - "name": "DocumentLink" - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentLink" - }, - "documentation": "Request to resolve additional information for a given document link. The request's\nparameter is of type [DocumentLink](#DocumentLink) the response\nis of type [DocumentLink](#DocumentLink) or a Thenable that resolves to such." - }, - { - "method": "textDocument/formatting", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentFormattingParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentFormattingRegistrationOptions" - }, - "documentation": "A request to to format a whole document." - }, - { - "method": "textDocument/rangeFormatting", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentRangeFormattingParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentRangeFormattingRegistrationOptions" - }, - "documentation": "A request to to format a range in a document." - }, - { - "method": "textDocument/onTypeFormatting", - "result": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DocumentOnTypeFormattingParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "DocumentOnTypeFormattingRegistrationOptions" - }, - "documentation": "A request to format a document on type." - }, - { - "method": "textDocument/rename", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceEdit" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "RenameParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "RenameRegistrationOptions" - }, - "documentation": "A request to rename a symbol." - }, - { - "method": "textDocument/prepareRename", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "PrepareRenameResult" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "PrepareRenameParams" - }, - "documentation": "A request to test and perform the setup necessary for a rename.\n\n@since 3.16 - support for default behavior", - "since": "3.16 - support for default behavior" - }, - { - "method": "workspace/executeCommand", - "result": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "LSPAny" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "ExecuteCommandParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "ExecuteCommandRegistrationOptions" - }, - "documentation": "A request send from the client to the server to execute a command. The request might return\na workspace edit which the client will apply to the workspace." - }, - { - "method": "workspace/applyEdit", - "result": { - "kind": "reference", - "name": "ApplyWorkspaceEditResult" - }, - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "ApplyWorkspaceEditParams" - }, - "documentation": "A request sent from the server to the client to modified certain resources." - } - ], - "notifications": [ - { - "method": "workspace/didChangeWorkspaceFolders", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidChangeWorkspaceFoldersParams" - }, - "documentation": "The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace\nfolder configuration changes." - }, - { - "method": "window/workDoneProgress/cancel", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WorkDoneProgressCancelParams" - }, - "documentation": "The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress\ninitiated on the server side." - }, - { - "method": "workspace/didCreateFiles", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "CreateFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The did create files notification is sent from the client to the server when\nfiles were created from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/didRenameFiles", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "RenameFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The did rename files notification is sent from the client to the server when\nfiles were renamed from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "workspace/didDeleteFiles", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DeleteFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "documentation": "The will delete files request is sent from the client to the server before files are actually\ndeleted as long as the deletion is triggered from within the client.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "method": "notebookDocument/didOpen", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidOpenNotebookDocumentParams" - }, - "registrationMethod": "notebookDocument/sync", - "documentation": "A notification sent when a notebook opens.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "notebookDocument/didChange", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidChangeNotebookDocumentParams" - }, - "registrationMethod": "notebookDocument/sync" - }, - { - "method": "notebookDocument/didSave", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidSaveNotebookDocumentParams" - }, - "registrationMethod": "notebookDocument/sync", - "documentation": "A notification sent when a notebook document is saved.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "notebookDocument/didClose", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidCloseNotebookDocumentParams" - }, - "registrationMethod": "notebookDocument/sync", - "documentation": "A notification sent when a notebook closes.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "method": "initialized", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "InitializedParams" - }, - "documentation": "The initialized notification is sent from the client to the\nserver after the client is fully initialized and the server\nis allowed to send requests from the server to the client." - }, - { - "method": "exit", - "messageDirection": "clientToServer", - "documentation": "The exit event is sent from the client to the server to\nask the server to exit its process." - }, - { - "method": "workspace/didChangeConfiguration", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidChangeConfigurationParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "DidChangeConfigurationRegistrationOptions" - }, - "documentation": "The configuration change notification is sent from the client to the server\nwhen the client's configuration has changed. The notification contains\nthe changed configuration as defined by the language client." - }, - { - "method": "window/showMessage", - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "ShowMessageParams" - }, - "documentation": "The show message notification is sent from a server to a client to ask\nthe client to display a particular message in the user interface." - }, - { - "method": "window/logMessage", - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "LogMessageParams" - }, - "documentation": "The log message notification is sent from the server to the client to ask\nthe client to log a particular message." - }, - { - "method": "telemetry/event", - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "LSPAny" - }, - "documentation": "The telemetry event notification is sent from the server to the client to ask\nthe client to log telemetry data." - }, - { - "method": "textDocument/didOpen", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidOpenTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - "documentation": "The document open notification is sent from the client to the server to signal\nnewly opened text documents. The document's truth is now managed by the client\nand the server must not try to read the document's truth using the document's\nuri. Open in this sense means it is managed by the client. It doesn't necessarily\nmean that its content is presented in an editor. An open notification must not\nbe sent more than once without a corresponding close notification send before.\nThis means open and close notification must be balanced and the max open count\nis one." - }, - { - "method": "textDocument/didChange", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidChangeTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentChangeRegistrationOptions" - }, - "documentation": "The document change notification is sent from the client to the server to signal\nchanges to a text document." - }, - { - "method": "textDocument/didClose", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidCloseTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - "documentation": "The document close notification is sent from the client to the server when\nthe document got closed in the client. The document's truth now exists where\nthe document's uri points to (e.g. if the document's uri is a file uri the\ntruth now exists on disk). As with the open notification the close notification\nis about managing the document's content. Receiving a close notification\ndoesn't mean that the document was open in an editor before. A close\nnotification requires a previous open notification to be sent." - }, - { - "method": "textDocument/didSave", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidSaveTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentSaveRegistrationOptions" - }, - "documentation": "The document save notification is sent from the client to the server when\nthe document got saved in the client." - }, - { - "method": "textDocument/willSave", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "WillSaveTextDocumentParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - "documentation": "A document will save notification is sent from the client to the server before\nthe document is actually saved." - }, - { - "method": "workspace/didChangeWatchedFiles", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "DidChangeWatchedFilesParams" - }, - "registrationOptions": { - "kind": "reference", - "name": "DidChangeWatchedFilesRegistrationOptions" - }, - "documentation": "The watched files notification is sent from the client to the server when\nthe client detects changes to file watched by the language client." - }, - { - "method": "textDocument/publishDiagnostics", - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "PublishDiagnosticsParams" - }, - "documentation": "Diagnostics notification are sent from the server to the client to signal\nresults of validation runs." - }, - { - "method": "$/setTrace", - "messageDirection": "clientToServer", - "params": { - "kind": "reference", - "name": "SetTraceParams" - } - }, - { - "method": "$/logTrace", - "messageDirection": "serverToClient", - "params": { - "kind": "reference", - "name": "LogTraceParams" - } - }, - { - "method": "$/cancelRequest", - "messageDirection": "both", - "params": { - "kind": "reference", - "name": "CancelParams" - } - }, - { - "method": "$/progress", - "messageDirection": "both", - "params": { - "kind": "reference", - "name": "ProgressParams" - } - } - ], - "structures": [ - { - "name": "ImplementationParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ] - }, - { - "name": "Location", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - } - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - } - } - ], - "documentation": "Represents a location inside a resource, such as a line\ninside a text file." - }, - { - "name": "ImplementationRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "ImplementationOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "TypeDefinitionParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ] - }, - { - "name": "TypeDefinitionRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "TypeDefinitionOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "WorkspaceFolder", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "The associated URI for this workspace folder." - }, - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the workspace folder. Used to refer to this\nworkspace folder in the user interface." - } - ], - "documentation": "A workspace folder inside a client." - }, - { - "name": "DidChangeWorkspaceFoldersParams", - "properties": [ - { - "name": "event", - "type": { - "kind": "reference", - "name": "WorkspaceFoldersChangeEvent" - }, - "documentation": "The actual workspace folder change event." - } - ], - "documentation": "The parameters of a `workspace/didChangeWorkspaceFolders` notification." - }, - { - "name": "ConfigurationParams", - "properties": [ - { - "name": "items", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ConfigurationItem" - } - } - } - ], - "documentation": "The parameters of a configuration request." - }, - { - "name": "PartialResultParams", - "properties": [ - { - "name": "partialResultToken", - "type": { - "kind": "reference", - "name": "ProgressToken" - }, - "optional": true, - "documentation": "An optional token that a server can use to report partial results (e.g. streaming) to\nthe client." - } - ] - }, - { - "name": "DocumentColorParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [DocumentColorRequest](#DocumentColorRequest)." - }, - { - "name": "ColorInformation", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range in the document where this color appears." - }, - { - "name": "color", - "type": { - "kind": "reference", - "name": "Color" - }, - "documentation": "The actual color value for this color range." - } - ], - "documentation": "Represents a color range from a document." - }, - { - "name": "DocumentColorRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentColorOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "ColorPresentationParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "color", - "type": { - "kind": "reference", - "name": "Color" - }, - "documentation": "The color to request presentations for." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range where the color would be inserted. Serves as a context." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [ColorPresentationRequest](#ColorPresentationRequest)." - }, - { - "name": "ColorPresentation", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The label of this color presentation. It will be shown on the color\npicker header. By default this is also the text that is inserted when selecting\nthis color presentation." - }, - { - "name": "textEdit", - "type": { - "kind": "reference", - "name": "TextEdit" - }, - "optional": true, - "documentation": "An [edit](#TextEdit) which is applied to a document when selecting\nthis presentation for the color. When `falsy` the [label](#ColorPresentation.label)\nis used." - }, - { - "name": "additionalTextEdits", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - "optional": true, - "documentation": "An optional array of additional [text edits](#TextEdit) that are applied when\nselecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves." - } - ] - }, - { - "name": "WorkDoneProgressOptions", - "properties": [ - { - "name": "workDoneProgress", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true - } - ] - }, - { - "name": "TextDocumentRegistrationOptions", - "properties": [ - { - "name": "documentSelector", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "DocumentSelector" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "A document selector to identify the scope of the registration. If set to null\nthe document selector provided on the client side will be used." - } - ], - "documentation": "General text document registration options." - }, - { - "name": "FoldingRangeParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [FoldingRangeRequest](#FoldingRangeRequest)." - }, - { - "name": "FoldingRange", - "properties": [ - { - "name": "startLine", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The zero-based start line of the range to fold. The folded area starts after the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." - }, - { - "name": "startCharacter", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line." - }, - { - "name": "endLine", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The zero-based end line of the range to fold. The folded area ends with the line's last character.\nTo be valid, the end must be zero or larger and smaller than the number of lines in the document." - }, - { - "name": "endCharacter", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "FoldingRangeKind" - }, - "optional": true, - "documentation": "Describes the kind of the folding range such as `comment' or 'region'. The kind\nis used to categorize folding ranges and used by commands like 'Fold all comments'.\nSee [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds." - }, - { - "name": "collapsedText", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The text that the client should show when the specified range is\ncollapsed. If not defined or not supported by the client, a default\nwill be chosen by the client.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Represents a folding range. To be valid, start and end line must be bigger than zero and smaller\nthan the number of lines in the document. Clients are free to ignore invalid ranges." - }, - { - "name": "FoldingRangeRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "FoldingRangeOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "DeclarationParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ] - }, - { - "name": "DeclarationRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "DeclarationOptions" - }, - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "SelectionRangeParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "positions", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Position" - } - }, - "documentation": "The positions inside the text document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "A parameter literal used in selection range requests." - }, - { - "name": "SelectionRange", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The [range](#Range) of this selection range." - }, - { - "name": "parent", - "type": { - "kind": "reference", - "name": "SelectionRange" - }, - "optional": true, - "documentation": "The parent selection range containing this range. Therefore `parent.range` must contain `this.range`." - } - ], - "documentation": "A selection range represents a part of a selection hierarchy. A selection range\nmay have a parent selection range that contains it." - }, - { - "name": "SelectionRangeRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "SelectionRangeOptions" - }, - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "WorkDoneProgressCreateParams", - "properties": [ - { - "name": "token", - "type": { - "kind": "reference", - "name": "ProgressToken" - }, - "documentation": "The token to be used to report progress." - } - ] - }, - { - "name": "WorkDoneProgressCancelParams", - "properties": [ - { - "name": "token", - "type": { - "kind": "reference", - "name": "ProgressToken" - }, - "documentation": "The token to be used to report progress." - } - ] - }, - { - "name": "CallHierarchyPrepareParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameter of a `textDocument/prepareCallHierarchy` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyItem", - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of this item." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "SymbolKind" - }, - "documentation": "The kind of this item." - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "optional": true, - "documentation": "Tags for this item." - }, - { - "name": "detail", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "More detail for this item, e.g. the signature of a function." - }, - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The resource identifier of this item." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code." - }, - { - "name": "selectionRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.\nMust be contained by the [`range`](#CallHierarchyItem.range)." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved between a call hierarchy prepare and\nincoming calls or outgoing calls requests." - } - ], - "documentation": "Represents programming constructs like functions or constructors in the context\nof call hierarchy.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "CallHierarchyOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Call hierarchy options used during static or dynamic registration.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyIncomingCallsParams", - "properties": [ - { - "name": "item", - "type": { - "kind": "reference", - "name": "CallHierarchyItem" - } - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameter of a `callHierarchy/incomingCalls` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyIncomingCall", - "properties": [ - { - "name": "from", - "type": { - "kind": "reference", - "name": "CallHierarchyItem" - }, - "documentation": "The item that makes the call." - }, - { - "name": "fromRanges", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Range" - } - }, - "documentation": "The ranges at which the calls appear. This is relative to the caller\ndenoted by [`this.from`](#CallHierarchyIncomingCall.from)." - } - ], - "documentation": "Represents an incoming call, e.g. a caller of a method or constructor.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyOutgoingCallsParams", - "properties": [ - { - "name": "item", - "type": { - "kind": "reference", - "name": "CallHierarchyItem" - } - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameter of a `callHierarchy/outgoingCalls` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CallHierarchyOutgoingCall", - "properties": [ - { - "name": "to", - "type": { - "kind": "reference", - "name": "CallHierarchyItem" - }, - "documentation": "The item that is called." - }, - { - "name": "fromRanges", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Range" - } - }, - "documentation": "The range at which this item is called. This is the range relative to the caller, e.g the item\npassed to [`provideCallHierarchyOutgoingCalls`](#CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls)\nand not [`this.to`](#CallHierarchyOutgoingCall.to)." - } - ], - "documentation": "Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokens", - "properties": [ - { - "name": "resultId", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional result id. If provided and clients support delta updating\nthe client will include the result id in the next semantic token request.\nA server can then instead of computing all semantic tokens again simply\nsend a delta." - }, - { - "name": "data", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "uinteger" - } - }, - "documentation": "The actual tokens." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensPartialResult", - "properties": [ - { - "name": "data", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "uinteger" - } - } - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "SemanticTokensOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensDeltaParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "previousResultId", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The result id of a previous response. The result Id can either point to a full response\nor a delta response depending on what was received last." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensDelta", - "properties": [ - { - "name": "resultId", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true - }, - { - "name": "edits", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SemanticTokensEdit" - } - }, - "documentation": "The semantic token edits to transform a previous result into a new result." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensDeltaPartialResult", - "properties": [ - { - "name": "edits", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SemanticTokensEdit" - } - } - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensRangeParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range the semantic tokens are requested for." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "ShowDocumentParams", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "The document uri to show." - }, - { - "name": "external", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Indicates to show the resource in an external program.\nTo show for example `https://code.visualstudio.com/`\nin the default WEB browser set `external` to `true`." - }, - { - "name": "takeFocus", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "An optional property to indicate whether the editor\nshowing the document should take focus or not.\nClients might ignore this property if an external\nprogram is started." - }, - { - "name": "selection", - "type": { - "kind": "reference", - "name": "Range" - }, - "optional": true, - "documentation": "An optional selection range if the document is a text\ndocument. Clients might ignore the property if an\nexternal program is started or the file is not a text\nfile." - } - ], - "documentation": "Params to show a document.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "ShowDocumentResult", - "properties": [ - { - "name": "success", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "A boolean indicating if the show was successful." - } - ], - "documentation": "The result of a showDocument request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "LinkedEditingRangeParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ] - }, - { - "name": "LinkedEditingRanges", - "properties": [ - { - "name": "ranges", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Range" - } - }, - "documentation": "A list of ranges that can be edited together. The ranges must have\nidentical length and contain identical text content. The ranges cannot overlap." - }, - { - "name": "wordPattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional word pattern (regular expression) that describes valid contents for\nthe given ranges. If no pattern is provided, the client configuration's word\npattern will be used." - } - ], - "documentation": "The result of a linked editing range request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "LinkedEditingRangeRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "LinkedEditingRangeOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ] - }, - { - "name": "CreateFilesParams", - "properties": [ - { - "name": "files", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileCreate" - } - }, - "documentation": "An array of all files/folders created in this operation." - } - ], - "documentation": "The parameters sent in notifications/requests for user-initiated creation of\nfiles.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "WorkspaceEdit", - "properties": [ - { - "name": "changes", - "type": { - "kind": "map", - "key": { - "kind": "base", - "name": "DocumentUri" - }, - "value": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - } - }, - "optional": true, - "documentation": "Holds changes to existing resources." - }, - { - "name": "documentChanges", - "type": { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "TextDocumentEdit" - }, - { - "kind": "reference", - "name": "CreateFile" - }, - { - "kind": "reference", - "name": "RenameFile" - }, - { - "kind": "reference", - "name": "DeleteFile" - } - ] - } - }, - "optional": true, - "documentation": "Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes\nare either an array of `TextDocumentEdit`s to express changes to n different text documents\nwhere each text document edit addresses a specific version of a text document. Or it can contain\nabove `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.\n\nWhether a client supports versioned document edits is expressed via\n`workspace.workspaceEdit.documentChanges` client capability.\n\nIf a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then\nonly plain `TextEdit`s using the `changes` property are supported." - }, - { - "name": "changeAnnotations", - "type": { - "kind": "map", - "key": { - "kind": "reference", - "name": "ChangeAnnotationIdentifier" - }, - "value": { - "kind": "reference", - "name": "ChangeAnnotation" - } - }, - "optional": true, - "documentation": "A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and\ndelete file / folder operations.\n\nWhether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "A workspace edit represents changes to many resources managed in the workspace. The edit\nshould either provide `changes` or `documentChanges`. If documentChanges are present\nthey are preferred over `changes` if the client can handle versioned document edits.\n\nSince version 3.13.0 a workspace edit can contain resource operations as well. If resource\noperations are present clients need to execute the operations in the order in which they\nare provided. So a workspace edit for example can consist of the following two changes:\n(1) a create file a.txt and (2) a text document edit which insert text into file a.txt.\n\nAn invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will\ncause failure of the operation. How the client recovers from the failure is described by\nthe client capability: `workspace.workspaceEdit.failureHandling`" - }, - { - "name": "FileOperationRegistrationOptions", - "properties": [ - { - "name": "filters", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileOperationFilter" - } - }, - "documentation": "The actual filters." - } - ], - "documentation": "The options to register for file operations.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "RenameFilesParams", - "properties": [ - { - "name": "files", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileRename" - } - }, - "documentation": "An array of all files/folders renamed in this operation. When a folder is renamed, only\nthe folder will be included, and not its children." - } - ], - "documentation": "The parameters sent in notifications/requests for user-initiated renames of\nfiles.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "DeleteFilesParams", - "properties": [ - { - "name": "files", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileDelete" - } - }, - "documentation": "An array of all files/folders deleted in this operation." - } - ], - "documentation": "The parameters sent in notifications/requests for user-initiated deletes of\nfiles.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MonikerParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ] - }, - { - "name": "Moniker", - "properties": [ - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The scheme of the moniker. For example tsc or .Net" - }, - { - "name": "identifier", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The identifier of the moniker. The value is opaque in LSIF however\nschema owners are allowed to define the structure if they want." - }, - { - "name": "unique", - "type": { - "kind": "reference", - "name": "UniquenessLevel" - }, - "documentation": "The scope in which the moniker is unique" - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "MonikerKind" - }, - "optional": true, - "documentation": "The moniker kind if known." - } - ], - "documentation": "Moniker definition to match LSIF 0.5 moniker definition.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MonikerRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "MonikerOptions" - } - ] - }, - { - "name": "TypeHierarchyPrepareParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameter of a `textDocument/prepareTypeHierarchy` request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TypeHierarchyItem", - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of this item." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "SymbolKind" - }, - "documentation": "The kind of this item." - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "optional": true, - "documentation": "Tags for this item." - }, - { - "name": "detail", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "More detail for this item, e.g. the signature of a function." - }, - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The resource identifier of this item." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range enclosing this symbol not including leading/trailing whitespace\nbut everything else, e.g. comments and code." - }, - { - "name": "selectionRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range that should be selected and revealed when this symbol is being\npicked, e.g. the name of a function. Must be contained by the\n[`range`](#TypeHierarchyItem.range)." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved between a type hierarchy prepare and\nsupertypes or subtypes requests. It could also be used to identify the\ntype hierarchy in the server, helping improve the performance on\nresolving supertypes and subtypes." - } - ], - "documentation": "@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TypeHierarchyRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "TypeHierarchyOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Type hierarchy options used during static or dynamic registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TypeHierarchySupertypesParams", - "properties": [ - { - "name": "item", - "type": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameter of a `typeHierarchy/supertypes` request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TypeHierarchySubtypesParams", - "properties": [ - { - "name": "item", - "type": { - "kind": "reference", - "name": "TypeHierarchyItem" - } - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameter of a `typeHierarchy/subtypes` request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range for which inline values should be computed." - }, - { - "name": "context", - "type": { - "kind": "reference", - "name": "InlineValueContext" - }, - "documentation": "Additional information about the context in which inline values were\nrequested." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "A parameter literal used in inline value requests.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "InlineValueOptions" - }, - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Inline value options used during static or dynamic registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHintParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range for which inlay hints should be computed." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "A parameter literal used in inlay hint requests.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHint", - "properties": [ - { - "name": "position", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The position of this hint." - }, - { - "name": "label", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "InlayHintLabelPart" - } - } - ] - }, - "documentation": "The label of this hint. A human readable string or an array of\nInlayHintLabelPart label parts.\n\n*Note* that neither the string nor the label part can be empty." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "InlayHintKind" - }, - "optional": true, - "documentation": "The kind of this hint. Can be omitted in which case the client\nshould fall back to a reasonable default." - }, - { - "name": "textEdits", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - "optional": true, - "documentation": "Optional text edits that are performed when accepting this inlay hint.\n\n*Note* that edits are expected to change the document so that the inlay\nhint (or its nearest variant) is now part of the document and the inlay\nhint itself is now obsolete." - }, - { - "name": "tooltip", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "MarkupContent" - } - ] - }, - "optional": true, - "documentation": "The tooltip text when you hover over this item." - }, - { - "name": "paddingLeft", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Render padding before the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." - }, - { - "name": "paddingRight", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Render padding after the hint.\n\nNote: Padding should use the editor's background color, not the\nbackground color of the hint itself. That means padding can be used\nto visually align/separate an inlay hint." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on an inlay hint between\na `textDocument/inlayHint` and a `inlayHint/resolve` request." - } - ], - "documentation": "Inlay hint information.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHintRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "InlayHintOptions" - }, - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Inlay hint options used during static or dynamic registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DocumentDiagnosticParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "identifier", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The additional identifier provided during registration." - }, - { - "name": "previousResultId", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The result id of a previous response if provided." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters of the document diagnostic request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DocumentDiagnosticReportPartialResult", - "properties": [ - { - "name": "relatedDocuments", - "type": { - "kind": "map", - "key": { - "kind": "base", - "name": "DocumentUri" - }, - "value": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "FullDocumentDiagnosticReport" - }, - { - "kind": "reference", - "name": "UnchangedDocumentDiagnosticReport" - } - ] - } - } - } - ], - "documentation": "A partial result for a document diagnostic report.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DiagnosticServerCancellationData", - "properties": [ - { - "name": "retriggerRequest", - "type": { - "kind": "base", - "name": "boolean" - } - } - ], - "documentation": "Cancellation data returned from a diagnostic request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DiagnosticRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DiagnosticOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Diagnostic registration options.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceDiagnosticParams", - "properties": [ - { - "name": "identifier", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The additional identifier provided during registration." - }, - { - "name": "previousResultIds", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "PreviousResultId" - } - }, - "documentation": "The currently known diagnostic reports with their\nprevious result ids." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters of the workspace diagnostic request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceDiagnosticReport", - "properties": [ - { - "name": "items", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceDocumentDiagnosticReport" - } - } - } - ], - "documentation": "A workspace diagnostic report.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceDiagnosticReportPartialResult", - "properties": [ - { - "name": "items", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceDocumentDiagnosticReport" - } - } - } - ], - "documentation": "A partial result for a workspace diagnostic report.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DidOpenNotebookDocumentParams", - "properties": [ - { - "name": "notebookDocument", - "type": { - "kind": "reference", - "name": "NotebookDocument" - }, - "documentation": "The notebook document that got opened." - }, - { - "name": "cellTextDocuments", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentItem" - } - }, - "documentation": "The text documents that represent the content\nof a notebook cell." - } - ], - "documentation": "The params sent in an open notebook document notification.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DidChangeNotebookDocumentParams", - "properties": [ - { - "name": "notebookDocument", - "type": { - "kind": "reference", - "name": "VersionedNotebookDocumentIdentifier" - }, - "documentation": "The notebook document that did change. The version number points\nto the version after all provided changes have been applied. If\nonly the text document content of a cell changes the notebook version\ndoesn't necessarily have to change." - }, - { - "name": "change", - "type": { - "kind": "reference", - "name": "NotebookDocumentChangeEvent" - }, - "documentation": "The actual changes to the notebook document.\n\nThe changes describe single state changes to the notebook document.\nSo if there are two changes c1 (at array index 0) and c2 (at array\nindex 1) for a notebook in state S then c1 moves the notebook from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and\nc2 is computed on the state S'.\n\nTo mirror the content of a notebook using change events use the following approach:\n- start with the same initial content\n- apply the 'notebookDocument/didChange' notifications in the order you receive them.\n- apply the `NotebookChangeEvent`s in a single notification in the order\n you receive them." - } - ], - "documentation": "The params sent in a change notebook document notification.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DidSaveNotebookDocumentParams", - "properties": [ - { - "name": "notebookDocument", - "type": { - "kind": "reference", - "name": "NotebookDocumentIdentifier" - }, - "documentation": "The notebook document that got saved." - } - ], - "documentation": "The params sent in a save notebook document notification.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DidCloseNotebookDocumentParams", - "properties": [ - { - "name": "notebookDocument", - "type": { - "kind": "reference", - "name": "NotebookDocumentIdentifier" - }, - "documentation": "The notebook document that got closed." - }, - { - "name": "cellTextDocuments", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentIdentifier" - } - }, - "documentation": "The text documents that represent the content\nof a notebook cell that got closed." - } - ], - "documentation": "The params sent in a close notebook document notification.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "RegistrationParams", - "properties": [ - { - "name": "registrations", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Registration" - } - } - } - ] - }, - { - "name": "UnregistrationParams", - "properties": [ - { - "name": "unregisterations", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Unregistration" - } - } - } - ] - }, - { - "name": "InitializeParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "_InitializeParams" - }, - { - "kind": "reference", - "name": "WorkspaceFoldersInitializeParams" - } - ] - }, - { - "name": "InitializeResult", - "properties": [ - { - "name": "capabilities", - "type": { - "kind": "reference", - "name": "ServerCapabilities" - }, - "documentation": "The capabilities the language server provides." - }, - { - "name": "serverInfo", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the server as defined by the server." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The server's version as defined by the server." - } - ] - } - }, - "optional": true, - "documentation": "Information about the server.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "documentation": "The result returned from an initialize request." - }, - { - "name": "InitializeError", - "properties": [ - { - "name": "retry", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "Indicates whether the client execute the following retry logic:\n(1) show the message provided by the ResponseError to the user\n(2) user selects retry or cancel\n(3) if user selected retry the initialize method is sent again." - } - ], - "documentation": "The data type of the ResponseError if the\ninitialize request fails." - }, - { - "name": "InitializedParams", - "properties": [] - }, - { - "name": "DidChangeConfigurationParams", - "properties": [ - { - "name": "settings", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "documentation": "The actual changed settings" - } - ], - "documentation": "The parameters of a change configuration notification." - }, - { - "name": "DidChangeConfigurationRegistrationOptions", - "properties": [ - { - "name": "section", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - } - ] - }, - "optional": true - } - ] - }, - { - "name": "ShowMessageParams", - "properties": [ - { - "name": "type", - "type": { - "kind": "reference", - "name": "MessageType" - }, - "documentation": "The message type. See {@link MessageType}" - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The actual message." - } - ], - "documentation": "The parameters of a notification message." - }, - { - "name": "ShowMessageRequestParams", - "properties": [ - { - "name": "type", - "type": { - "kind": "reference", - "name": "MessageType" - }, - "documentation": "The message type. See {@link MessageType}" - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The actual message." - }, - { - "name": "actions", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MessageActionItem" - } - }, - "optional": true, - "documentation": "The message action items to present." - } - ] - }, - { - "name": "MessageActionItem", - "properties": [ - { - "name": "title", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A short title like 'Retry', 'Open Log' etc." - } - ] - }, - { - "name": "LogMessageParams", - "properties": [ - { - "name": "type", - "type": { - "kind": "reference", - "name": "MessageType" - }, - "documentation": "The message type. See {@link MessageType}" - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The actual message." - } - ], - "documentation": "The log message parameters." - }, - { - "name": "DidOpenTextDocumentParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentItem" - }, - "documentation": "The document that was opened." - } - ], - "documentation": "The parameters sent in an open text document notification" - }, - { - "name": "DidChangeTextDocumentParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "VersionedTextDocumentIdentifier" - }, - "documentation": "The document that did change. The version number points\nto the version after all provided content changes have\nbeen applied." - }, - { - "name": "contentChanges", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentContentChangeEvent" - } - }, - "documentation": "The actual content changes. The content changes describe single state changes\nto the document. So if there are two content changes c1 (at array index 0) and\nc2 (at array index 1) for a document in state S then c1 moves the document from\nS to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed\non the state S'.\n\nTo mirror the content of a document using change events use the following approach:\n- start with the same initial content\n- apply the 'textDocument/didChange' notifications in the order you receive them.\n- apply the `TextDocumentContentChangeEvent`s in a single notification in the order\n you receive them." - } - ], - "documentation": "The change text document notification's parameters." - }, - { - "name": "TextDocumentChangeRegistrationOptions", - "properties": [ - { - "name": "syncKind", - "type": { - "kind": "reference", - "name": "TextDocumentSyncKind" - }, - "documentation": "How documents are synced to the server." - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - } - ], - "documentation": "Describe options to be used when registered for text document change events." - }, - { - "name": "DidCloseTextDocumentParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document that was closed." - } - ], - "documentation": "The parameters sent in a close text document notification" - }, - { - "name": "DidSaveTextDocumentParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document that was saved." - }, - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "Optional the content when saved. Depends on the includeText value\nwhen the save notification was requested." - } - ], - "documentation": "The parameters sent in a save text document notification" - }, - { - "name": "TextDocumentSaveRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "SaveOptions" - } - ], - "documentation": "Save registration options." - }, - { - "name": "WillSaveTextDocumentParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document that will be saved." - }, - { - "name": "reason", - "type": { - "kind": "reference", - "name": "TextDocumentSaveReason" - }, - "documentation": "The 'TextDocumentSaveReason'." - } - ], - "documentation": "The parameters sent in a will save text document notification." - }, - { - "name": "TextEdit", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range of the text document to be manipulated. To insert\ntext into a document create a range where start === end." - }, - { - "name": "newText", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The string to be inserted. For delete operations use an\nempty string." - } - ], - "documentation": "A text edit applicable to a text document." - }, - { - "name": "DidChangeWatchedFilesParams", - "properties": [ - { - "name": "changes", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileEvent" - } - }, - "documentation": "The actual file events." - } - ], - "documentation": "The watched files change notification's parameters." - }, - { - "name": "DidChangeWatchedFilesRegistrationOptions", - "properties": [ - { - "name": "watchers", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FileSystemWatcher" - } - }, - "documentation": "The watchers to register." - } - ], - "documentation": "Describe options to be used when registered for text document change events." - }, - { - "name": "PublishDiagnosticsParams", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The URI for which diagnostic information is reported." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "integer" - }, - "optional": true, - "documentation": "Optional the version number of the document the diagnostics are published for.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "diagnostics", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Diagnostic" - } - }, - "documentation": "An array of diagnostic information items." - } - ], - "documentation": "The publish diagnostic notification's parameters." - }, - { - "name": "CompletionParams", - "properties": [ - { - "name": "context", - "type": { - "kind": "reference", - "name": "CompletionContext" - }, - "optional": true, - "documentation": "The completion context. This is only available it the client specifies\nto send this using the client capability `textDocument.completion.contextSupport === true`" - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Completion parameters" - }, - { - "name": "CompletionItem", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The label of this completion item.\n\nThe label property is also by default the text that\nis inserted when selecting this completion.\n\nIf label details are provided the label itself should\nbe an unqualified name of the completion item." - }, - { - "name": "labelDetails", - "type": { - "kind": "reference", - "name": "CompletionItemLabelDetails" - }, - "optional": true, - "documentation": "Additional details for the label\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "CompletionItemKind" - }, - "optional": true, - "documentation": "The kind of this completion item. Based of the kind\nan icon is chosen by the editor." - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItemTag" - } - }, - "optional": true, - "documentation": "Tags for this completion item.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "detail", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A human-readable string with additional information\nabout this item, like type or symbol information." - }, - { - "name": "documentation", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "MarkupContent" - } - ] - }, - "optional": true, - "documentation": "A human-readable string that represents a doc-comment." - }, - { - "name": "deprecated", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Indicates if this item is deprecated.\n@deprecated Use `tags` instead." - }, - { - "name": "preselect", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Select this item when showing.\n\n*Note* that only one completion item can be selected and that the\ntool / client decides which item that is. The rule is that the *first*\nitem of those that match best is selected." - }, - { - "name": "sortText", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A string that should be used when comparing this item\nwith other items. When `falsy` the [label](#CompletionItem.label)\nis used." - }, - { - "name": "filterText", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A string that should be used when filtering a set of\ncompletion items. When `falsy` the [label](#CompletionItem.label)\nis used." - }, - { - "name": "insertText", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A string that should be inserted into a document when selecting\nthis completion. When `falsy` the [label](#CompletionItem.label)\nis used.\n\nThe `insertText` is subject to interpretation by the client side.\nSome tools might not take the string literally. For example\nVS Code when code complete is requested in this example\n`con` and a completion item with an `insertText` of\n`console` is provided it will only insert `sole`. Therefore it is\nrecommended to use `textEdit` instead since it avoids additional client\nside interpretation." - }, - { - "name": "insertTextFormat", - "type": { - "kind": "reference", - "name": "InsertTextFormat" - }, - "optional": true, - "documentation": "The format of the insert text. The format applies to both the\n`insertText` property and the `newText` property of a provided\n`textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.\n\nPlease note that the insertTextFormat doesn't apply to\n`additionalTextEdits`." - }, - { - "name": "insertTextMode", - "type": { - "kind": "reference", - "name": "InsertTextMode" - }, - "optional": true, - "documentation": "How whitespace and indentation is handled during completion\nitem insertion. If not provided the clients default value depends on\nthe `textDocument.completion.insertTextMode` client capability.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "textEdit", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "TextEdit" - }, - { - "kind": "reference", - "name": "InsertReplaceEdit" - } - ] - }, - "optional": true, - "documentation": "An [edit](#TextEdit) which is applied to a document when selecting\nthis completion. When an edit is provided the value of\n[insertText](#CompletionItem.insertText) is ignored.\n\nMost editors support two different operations when accepting a completion\nitem. One is to insert a completion text and the other is to replace an\nexisting text with a completion text. Since this can usually not be\npredetermined by a server it can report both ranges. Clients need to\nsignal support for `InsertReplaceEdits` via the\n`textDocument.completion.insertReplaceSupport` client capability\nproperty.\n\n*Note 1:* The text edit's range as well as both ranges from an insert\nreplace edit must be a [single line] and they must contain the position\nat which completion has been requested.\n*Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range\nmust be a prefix of the edit's replace range, that means it must be\ncontained and starting at the same position.\n\n@since 3.16.0 additional type `InsertReplaceEdit`", - "since": "3.16.0 additional type `InsertReplaceEdit`" - }, - { - "name": "textEditText", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The edit text used if the completion item is part of a CompletionList and\nCompletionList defines an item default for the text edit range.\n\nClients will only honor this property if they opt into completion list\nitem defaults using the capability `completionList.itemDefaults`.\n\nIf not provided and a list's default range is provided the label\nproperty is used as a text.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "additionalTextEdits", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextEdit" - } - }, - "optional": true, - "documentation": "An optional array of additional [text edits](#TextEdit) that are applied when\nselecting this completion. Edits must not overlap (including the same insert position)\nwith the main [edit](#CompletionItem.textEdit) nor with themselves.\n\nAdditional text edits should be used to change text unrelated to the current cursor position\n(for example adding an import statement at the top of the file if the completion item will\ninsert an unqualified type)." - }, - { - "name": "commitCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "An optional set of characters that when pressed while this completion is active will accept it first and\nthen type that character. *Note* that all commit characters should have `length=1` and that superfluous\ncharacters will be ignored." - }, - { - "name": "command", - "type": { - "kind": "reference", - "name": "Command" - }, - "optional": true, - "documentation": "An optional [command](#Command) that is executed *after* inserting this completion. *Note* that\nadditional modifications to the current document should be described with the\n[additionalTextEdits](#CompletionItem.additionalTextEdits)-property." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on a completion item between a\n[CompletionRequest](#CompletionRequest) and a [CompletionResolveRequest](#CompletionResolveRequest)." - } - ], - "documentation": "A completion item represents a text snippet that is\nproposed to complete text that is being typed." - }, - { - "name": "CompletionList", - "properties": [ - { - "name": "isIncomplete", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "This list it not complete. Further typing results in recomputing this list.\n\nRecomputed lists have all their items replaced (not appended) in the\nincomplete completion sessions." - }, - { - "name": "itemDefaults", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "commitCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "A default commit character set.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "editRange", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Range" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "insert", - "type": { - "kind": "reference", - "name": "Range" - } - }, - { - "name": "replace", - "type": { - "kind": "reference", - "name": "Range" - } - } - ] - } - } - ] - }, - "optional": true, - "documentation": "A default edit range.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "insertTextFormat", - "type": { - "kind": "reference", - "name": "InsertTextFormat" - }, - "optional": true, - "documentation": "A default insert text format.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "insertTextMode", - "type": { - "kind": "reference", - "name": "InsertTextMode" - }, - "optional": true, - "documentation": "A default insert text mode.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A default data value.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } - }, - "optional": true, - "documentation": "In many cases the items of an actual completion result share the same\nvalue for properties like `commitCharacters` or the range of a text\nedit. A completion list can therefore define item defaults which will\nbe used if a completion item itself doesn't specify the value.\n\nIf a completion list specifies a default value and a completion item\nalso specifies a corresponding value the one from the item is used.\n\nServers are only allowed to return default values if the client\nsignals support for this via the `completionList.itemDefaults`\ncapability.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "items", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItem" - } - }, - "documentation": "The completion items." - } - ], - "documentation": "Represents a collection of [completion items](#CompletionItem) to be presented\nin the editor." - }, - { - "name": "CompletionRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "CompletionOptions" - } - ], - "documentation": "Registration options for a [CompletionRequest](#CompletionRequest)." - }, - { - "name": "HoverParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "Parameters for a [HoverRequest](#HoverRequest)." - }, - { - "name": "Hover", - "properties": [ - { - "name": "contents", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "MarkupContent" - }, - { - "kind": "reference", - "name": "MarkedString" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkedString" - } - } - ] - }, - "documentation": "The hover's content" - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "optional": true, - "documentation": "An optional range inside the text document that is used to\nvisualize the hover, e.g. by changing the background color." - } - ], - "documentation": "The result of a hover request." - }, - { - "name": "HoverRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "HoverOptions" - } - ], - "documentation": "Registration options for a [HoverRequest](#HoverRequest)." - }, - { - "name": "SignatureHelpParams", - "properties": [ - { - "name": "context", - "type": { - "kind": "reference", - "name": "SignatureHelpContext" - }, - "optional": true, - "documentation": "The signature help context. This is only available if the client specifies\nto send this using the client capability `textDocument.signatureHelp.contextSupport === true`\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "Parameters for a [SignatureHelpRequest](#SignatureHelpRequest)." - }, - { - "name": "SignatureHelp", - "properties": [ - { - "name": "signatures", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SignatureInformation" - } - }, - "documentation": "One or more signatures." - }, - { - "name": "activeSignature", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The active signature. If omitted or the value lies outside the\nrange of `signatures` the value defaults to zero or is ignored if\nthe `SignatureHelp` has no signatures.\n\nWhenever possible implementors should make an active decision about\nthe active signature and shouldn't rely on a default value.\n\nIn future version of the protocol this property might become\nmandatory to better express this." - }, - { - "name": "activeParameter", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The active parameter of the active signature. If omitted or the value\nlies outside the range of `signatures[activeSignature].parameters`\ndefaults to 0 if the active signature has parameters. If\nthe active signature has no parameters it is ignored.\nIn future version of the protocol this property might become\nmandatory to better express the active parameter if the\nactive signature does have any." - } - ], - "documentation": "Signature help represents the signature of something\ncallable. There can be multiple signature but only one\nactive and only one active parameter." - }, - { - "name": "SignatureHelpRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "SignatureHelpOptions" - } - ], - "documentation": "Registration options for a [SignatureHelpRequest](#SignatureHelpRequest)." - }, - { - "name": "DefinitionParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [DefinitionRequest](#DefinitionRequest)." - }, - { - "name": "DefinitionRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DefinitionOptions" - } - ], - "documentation": "Registration options for a [DefinitionRequest](#DefinitionRequest)." - }, - { - "name": "ReferenceParams", - "properties": [ - { - "name": "context", - "type": { - "kind": "reference", - "name": "ReferenceContext" - } - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [ReferencesRequest](#ReferencesRequest)." - }, - { - "name": "ReferenceRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "ReferenceOptions" - } - ], - "documentation": "Registration options for a [ReferencesRequest](#ReferencesRequest)." - }, - { - "name": "DocumentHighlightParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [DocumentHighlightRequest](#DocumentHighlightRequest)." - }, - { - "name": "DocumentHighlight", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range this highlight applies to." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "DocumentHighlightKind" - }, - "optional": true, - "documentation": "The highlight kind, default is [text](#DocumentHighlightKind.Text)." - } - ], - "documentation": "A document highlight is a range inside a text document which deserves\nspecial attention. Usually a document highlight is visualized by changing\nthe background color of its range." - }, - { - "name": "DocumentHighlightRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentHighlightOptions" - } - ], - "documentation": "Registration options for a [DocumentHighlightRequest](#DocumentHighlightRequest)." - }, - { - "name": "DocumentSymbolParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "Parameters for a [DocumentSymbolRequest](#DocumentSymbolRequest)." - }, - { - "name": "SymbolInformation", - "properties": [ - { - "name": "deprecated", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead" - }, - { - "name": "location", - "type": { - "kind": "reference", - "name": "Location" - }, - "documentation": "The location of this symbol. The location's range is used by a tool\nto reveal the location in the editor. If the symbol is selected in the\ntool the range's start information is used to position the cursor. So\nthe range usually spans more than the actual symbol's name and does\nnormally include things like visibility modifiers.\n\nThe range doesn't have to denote a node range in the sense of an abstract\nsyntax tree. It can therefore not be used to re-construct a hierarchy of\nthe symbols." - } - ], - "extends": [ - { - "kind": "reference", - "name": "BaseSymbolInformation" - } - ], - "documentation": "Represents information about programming constructs like variables, classes,\ninterfaces etc." - }, - { - "name": "DocumentSymbol", - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of this symbol. Will be displayed in the user interface and therefore must not be\nan empty string or a string only consisting of white spaces." - }, - { - "name": "detail", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "More detail for this symbol, e.g the signature of a function." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "SymbolKind" - }, - "documentation": "The kind of this symbol." - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "optional": true, - "documentation": "Tags for this document symbol.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "deprecated", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Indicates if this symbol is deprecated.\n\n@deprecated Use tags instead" - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to determine if the clients cursor is\ninside the symbol to reveal in the symbol in the UI." - }, - { - "name": "selectionRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.\nMust be contained by the `range`." - }, - { - "name": "children", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentSymbol" - } - }, - "optional": true, - "documentation": "Children of this symbol, e.g. properties of a class." - } - ], - "documentation": "Represents programming constructs like variables, classes, interfaces etc.\nthat appear in a document. Document symbols can be hierarchical and they\nhave two ranges: one that encloses its definition and one that points to\nits most interesting range, e.g. the range of an identifier." - }, - { - "name": "DocumentSymbolRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentSymbolOptions" - } - ], - "documentation": "Registration options for a [DocumentSymbolRequest](#DocumentSymbolRequest)." - }, - { - "name": "CodeActionParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document in which the command was invoked." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range for which the command was invoked." - }, - { - "name": "context", - "type": { - "kind": "reference", - "name": "CodeActionContext" - }, - "documentation": "Context carrying additional information." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameters of a [CodeActionRequest](#CodeActionRequest)." - }, - { - "name": "Command", - "properties": [ - { - "name": "title", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "Title of the command, like `save`." - }, - { - "name": "command", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The identifier of the actual command handler." - }, - { - "name": "arguments", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "LSPAny" - } - }, - "optional": true, - "documentation": "Arguments that the command handler should be\ninvoked with." - } - ], - "documentation": "Represents a reference to a command. Provides a title which\nwill be used to represent a command in the UI and, optionally,\nan array of arguments which will be passed to the command handler\nfunction when invoked." - }, - { - "name": "CodeAction", - "properties": [ - { - "name": "title", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A short, human-readable, title for this code action." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "CodeActionKind" - }, - "optional": true, - "documentation": "The kind of the code action.\n\nUsed to filter code actions." - }, - { - "name": "diagnostics", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Diagnostic" - } - }, - "optional": true, - "documentation": "The diagnostics that this code action resolves." - }, - { - "name": "isPreferred", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted\nby keybindings.\n\nA quick fix should be marked preferred if it properly addresses the underlying error.\nA refactoring should be marked preferred if it is the most reasonable choice of actions to take.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "disabled", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "reason", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "Human readable description of why the code action is currently disabled.\n\nThis is displayed in the code actions UI." - } - ] - } - }, - "optional": true, - "documentation": "Marks that the code action cannot currently be applied.\n\nClients should follow the following guidelines regarding disabled code actions:\n\n - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)\n code action menus.\n\n - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type\n of code action, such as refactorings.\n\n - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)\n that auto applies a code action and only disabled code actions are returned, the client should show the user an\n error message with `reason` in the editor.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "edit", - "type": { - "kind": "reference", - "name": "WorkspaceEdit" - }, - "optional": true, - "documentation": "The workspace edit this code action performs." - }, - { - "name": "command", - "type": { - "kind": "reference", - "name": "Command" - }, - "optional": true, - "documentation": "A command this code action executes. If a code action\nprovides an edit and a command, first the edit is\nexecuted and then the command." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on a code action between\na `textDocument/codeAction` and a `codeAction/resolve` request.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "A code action represents a change that can be performed in code, e.g. to fix a problem or\nto refactor code.\n\nA CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed." - }, - { - "name": "CodeActionRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "CodeActionOptions" - } - ], - "documentation": "Registration options for a [CodeActionRequest](#CodeActionRequest)." - }, - { - "name": "WorkspaceSymbolParams", - "properties": [ - { - "name": "query", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A query string to filter symbols by. Clients may send an empty\nstring here to request all symbols." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameters of a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." - }, - { - "name": "WorkspaceSymbol", - "properties": [ - { - "name": "location", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Location" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - } - } - ] - } - } - ] - }, - "documentation": "The location of the symbol. Whether a server is allowed to\nreturn a location without a range depends on the client\ncapability `workspace.symbol.resolveSupport`.\n\nSee SymbolInformation#location for more details." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on a workspace symbol between a\nworkspace symbol request and a workspace symbol resolve request." - } - ], - "extends": [ - { - "kind": "reference", - "name": "BaseSymbolInformation" - } - ], - "documentation": "A special workspace symbol that supports locations without a range.\n\nSee also SymbolInformation.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceSymbolRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "WorkspaceSymbolOptions" - } - ], - "documentation": "Registration options for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." - }, - { - "name": "CodeLensParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to request code lens for." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameters of a [CodeLensRequest](#CodeLensRequest)." - }, - { - "name": "CodeLens", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range in which this code lens is valid. Should only span a single line." - }, - { - "name": "command", - "type": { - "kind": "reference", - "name": "Command" - }, - "optional": true, - "documentation": "The command this code lens represents." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on a code lens item between\na [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]\n(#CodeLensResolveRequest)" - } - ], - "documentation": "A code lens represents a [command](#Command) that should be shown along with\nsource text, like the number of references, a way to run tests, etc.\n\nA code lens is _unresolved_ when no command is associated to it. For performance\nreasons the creation of a code lens and resolving should be done in two stages." - }, - { - "name": "CodeLensRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "CodeLensOptions" - } - ], - "documentation": "Registration options for a [CodeLensRequest](#CodeLensRequest)." - }, - { - "name": "DocumentLinkParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to provide document links for." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - }, - { - "kind": "reference", - "name": "PartialResultParams" - } - ], - "documentation": "The parameters of a [DocumentLinkRequest](#DocumentLinkRequest)." - }, - { - "name": "DocumentLink", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range this link applies to." - }, - { - "name": "target", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The uri this link points to. If missing a resolve request is sent later." - }, - { - "name": "tooltip", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The tooltip text when you hover over this link.\n\nIf a tooltip is provided, is will be displayed in a string that includes instructions on how to\ntrigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,\nuser settings, and localization.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved on a document link between a\nDocumentLinkRequest and a DocumentLinkResolveRequest." - } - ], - "documentation": "A document link is a range in a text document that links to an internal or external resource, like another\ntext document or a web site." - }, - { - "name": "DocumentLinkRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentLinkOptions" - } - ], - "documentation": "Registration options for a [DocumentLinkRequest](#DocumentLinkRequest)." - }, - { - "name": "DocumentFormattingParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to format." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "FormattingOptions" - }, - "documentation": "The format options." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameters of a [DocumentFormattingRequest](#DocumentFormattingRequest)." - }, - { - "name": "DocumentFormattingRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentFormattingOptions" - } - ], - "documentation": "Registration options for a [DocumentFormattingRequest](#DocumentFormattingRequest)." - }, - { - "name": "DocumentRangeFormattingParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to format." - }, - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range to format" - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "FormattingOptions" - }, - "documentation": "The format options" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameters of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." - }, - { - "name": "DocumentRangeFormattingRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentRangeFormattingOptions" - } - ], - "documentation": "Registration options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." - }, - { - "name": "DocumentOnTypeFormattingParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to format." - }, - { - "name": "position", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The position around which the on type formatting should happen.\nThis is not necessarily the exact position where the character denoted\nby the property `ch` got typed." - }, - { - "name": "ch", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The character that has been typed that triggered the formatting\non type request. That is not necessarily the last character that\ngot inserted into the document since the client could auto insert\ncharacters as well (e.g. like automatic brace completion)." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "FormattingOptions" - }, - "documentation": "The formatting options." - } - ], - "documentation": "The parameters of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." - }, - { - "name": "DocumentOnTypeFormattingRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "DocumentOnTypeFormattingOptions" - } - ], - "documentation": "Registration options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." - }, - { - "name": "RenameParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The document to rename." - }, - { - "name": "position", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The position at which this request was sent." - }, - { - "name": "newName", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new name of the symbol. If the given name is not valid the\nrequest must return a [ResponseError](#ResponseError) with an\nappropriate message set." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameters of a [RenameRequest](#RenameRequest)." - }, - { - "name": "RenameRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentRegistrationOptions" - }, - { - "kind": "reference", - "name": "RenameOptions" - } - ], - "documentation": "Registration options for a [RenameRequest](#RenameRequest)." - }, - { - "name": "PrepareRenameParams", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentPositionParams" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ] - }, - { - "name": "ExecuteCommandParams", - "properties": [ - { - "name": "command", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The identifier of the actual command handler." - }, - { - "name": "arguments", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "LSPAny" - } - }, - "optional": true, - "documentation": "Arguments that the command should be invoked with." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The parameters of a [ExecuteCommandRequest](#ExecuteCommandRequest)." - }, - { - "name": "ExecuteCommandRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "ExecuteCommandOptions" - } - ], - "documentation": "Registration options for a [ExecuteCommandRequest](#ExecuteCommandRequest)." - }, - { - "name": "ApplyWorkspaceEditParams", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional label of the workspace edit. This label is\npresented in the user interface for example on an undo\nstack to undo the workspace edit." - }, - { - "name": "edit", - "type": { - "kind": "reference", - "name": "WorkspaceEdit" - }, - "documentation": "The edits to apply." - } - ], - "documentation": "The parameters passed via a apply workspace edit request." - }, - { - "name": "ApplyWorkspaceEditResult", - "properties": [ - { - "name": "applied", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "Indicates whether the edit was applied or not." - }, - { - "name": "failureReason", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional textual description for why the edit was not applied.\nThis may be used by the server for diagnostic logging or to provide\na suitable error for a request that triggered the edit." - }, - { - "name": "failedChange", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "Depending on the client's failure handling strategy `failedChange` might\ncontain the index of the change that failed. This property is only available\nif the client signals a `failureHandlingStrategy` in its client capabilities." - } - ], - "documentation": "The result returned from the apply workspace edit request.\n\n@since 3.17 renamed from ApplyWorkspaceEditResponse", - "since": "3.17 renamed from ApplyWorkspaceEditResponse" - }, - { - "name": "WorkDoneProgressBegin", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "begin" - } - }, - { - "name": "title", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "Mandatory title of the progress operation. Used to briefly inform about\nthe kind of operation being performed.\n\nExamples: \"Indexing\" or \"Linking dependencies\"." - }, - { - "name": "cancellable", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Controls if a cancel button should show to allow the user to cancel the\nlong running operation. Clients that don't support cancellation are allowed\nto ignore the setting." - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." - }, - { - "name": "percentage", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]." - } - ] - }, - { - "name": "WorkDoneProgressReport", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "report" - } - }, - { - "name": "cancellable", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Controls enablement state of a cancel button.\n\nClients that don't support cancellation or don't support controlling the button's\nenablement state are allowed to ignore the property." - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "Optional, more detailed associated progress message. Contains\ncomplementary information to the `title`.\n\nExamples: \"3/25 files\", \"project/src/module2\", \"node_modules/some_dep\".\nIf unset, the previous progress message (if any) is still valid." - }, - { - "name": "percentage", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "Optional progress percentage to display (value 100 is considered 100%).\nIf not provided infinite progress is assumed and clients are allowed\nto ignore the `percentage` value in subsequent in report notifications.\n\nThe value should be steadily rising. Clients are free to ignore values\nthat are not following this rule. The value range is [0, 100]" - } - ] - }, - { - "name": "WorkDoneProgressEnd", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "end" - } - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "Optional, a final message indicating to for example indicate the outcome\nof the operation." - } - ] - }, - { - "name": "SetTraceParams", - "properties": [ - { - "name": "value", - "type": { - "kind": "reference", - "name": "TraceValues" - } - } - ] - }, - { - "name": "LogTraceParams", - "properties": [ - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - } - }, - { - "name": "verbose", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true - } - ] - }, - { - "name": "CancelParams", - "properties": [ - { - "name": "id", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "string" - } - ] - }, - "documentation": "The request id to cancel." - } - ] - }, - { - "name": "ProgressParams", - "properties": [ - { - "name": "token", - "type": { - "kind": "reference", - "name": "ProgressToken" - }, - "documentation": "The progress token provided by the client or server." - }, - { - "name": "value", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "documentation": "The progress data." - } - ] - }, - { - "name": "TextDocumentPositionParams", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentIdentifier" - }, - "documentation": "The text document." - }, - { - "name": "position", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The position inside the text document." - } - ], - "documentation": "A parameter literal used in requests to pass a text document and a position inside that\ndocument." - }, - { - "name": "WorkDoneProgressParams", - "properties": [ - { - "name": "workDoneToken", - "type": { - "kind": "reference", - "name": "ProgressToken" - }, - "optional": true, - "documentation": "An optional token that a server can use to report work done progress." - } - ] - }, - { - "name": "LocationLink", - "properties": [ - { - "name": "originSelectionRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "optional": true, - "documentation": "Span of the origin of this link.\n\nUsed as the underlined span for mouse interaction. Defaults to the word range at\nthe definition position." - }, - { - "name": "targetUri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The target resource identifier of this link." - }, - { - "name": "targetRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The full target range of this link. If the target for example is a symbol then target range is the\nrange enclosing this symbol not including leading/trailing whitespace but everything else\nlike comments. This information is typically used to highlight the range in the editor." - }, - { - "name": "targetSelectionRange", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range that should be selected and revealed when this link is being followed, e.g the name of a function.\nMust be contained by the `targetRange`. See also `DocumentSymbol#range`" - } - ], - "documentation": "Represents the connection of two locations. Provides additional metadata over normal [locations](#Location),\nincluding an origin range." - }, - { - "name": "Range", - "properties": [ - { - "name": "start", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The range's start position." - }, - { - "name": "end", - "type": { - "kind": "reference", - "name": "Position" - }, - "documentation": "The range's end position." - } - ], - "documentation": "A range in a text document expressed as (zero-based) start and end positions.\n\nIf you want to specify a range that contains a line including the line ending\ncharacter(s) then use an end position denoting the start of the next line.\nFor example:\n```ts\n{\n start: { line: 5, character: 23 }\n end : { line 6, character : 0 }\n}\n```" - }, - { - "name": "ImplementationOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "StaticRegistrationOptions", - "properties": [ - { - "name": "id", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The id used to register the request. The id can be used to deregister\nthe request again. See also Registration#id." - } - ], - "documentation": "Static registration options to be returned in the initialize\nrequest." - }, - { - "name": "TypeDefinitionOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "WorkspaceFoldersChangeEvent", - "properties": [ - { - "name": "added", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceFolder" - } - }, - "documentation": "The array of added workspace folders" - }, - { - "name": "removed", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceFolder" - } - }, - "documentation": "The array of the removed workspace folders" - } - ], - "documentation": "The workspace folder change event." - }, - { - "name": "ConfigurationItem", - "properties": [ - { - "name": "scopeUri", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The scope to get the configuration section for." - }, - { - "name": "section", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The configuration section asked for." - } - ] - }, - { - "name": "TextDocumentIdentifier", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The text document's uri." - } - ], - "documentation": "A literal to identify a text document in the client." - }, - { - "name": "Color", - "properties": [ - { - "name": "red", - "type": { - "kind": "base", - "name": "decimal" - }, - "documentation": "The red component of this color in the range [0-1]." - }, - { - "name": "green", - "type": { - "kind": "base", - "name": "decimal" - }, - "documentation": "The green component of this color in the range [0-1]." - }, - { - "name": "blue", - "type": { - "kind": "base", - "name": "decimal" - }, - "documentation": "The blue component of this color in the range [0-1]." - }, - { - "name": "alpha", - "type": { - "kind": "base", - "name": "decimal" - }, - "documentation": "The alpha component of this color in the range [0-1]." - } - ], - "documentation": "Represents a color in RGBA space." - }, - { - "name": "DocumentColorOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "FoldingRangeOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "DeclarationOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "Position", - "properties": [ - { - "name": "line", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "Line position in a document (zero-based).\n\nIf a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document.\nIf a line number is negative, it defaults to 0." - }, - { - "name": "character", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "Character offset on a line in a document (zero-based).\n\nThe meaning of this offset is determined by the negotiated\n`PositionEncodingKind`.\n\nIf the character value is greater than the line length it defaults back to the\nline length." - } - ], - "documentation": "Position in a text document expressed as zero-based line and character\noffset. Prior to 3.17 the offsets were always based on a UTF-16 string\nrepresentation. So a string of the form `a𐐀b` the character offset of the\ncharacter `a` is 0, the character offset of `𐐀` is 1 and the character\noffset of b is 3 since `𐐀` is represented using two code units in UTF-16.\nSince 3.17 clients and servers can agree on a different string encoding\nrepresentation (e.g. UTF-8). The client announces it's supported encoding\nvia the client capability [`general.positionEncodings`](#clientCapabilities).\nThe value is an array of position encodings the client supports, with\ndecreasing preference (e.g. the encoding at index `0` is the most preferred\none). To stay backwards compatible the only mandatory encoding is UTF-16\nrepresented via the string `utf-16`. The server can pick one of the\nencodings offered by the client and signals that encoding back to the\nclient via the initialize result's property\n[`capabilities.positionEncoding`](#serverCapabilities). If the string value\n`utf-16` is missing from the client's capability `general.positionEncodings`\nservers can safely assume that the client supports UTF-16. If the server\nomits the position encoding in its initialize result the encoding defaults\nto the string value `utf-16`. Implementation considerations: since the\nconversion from one encoding into another requires the content of the\nfile / line the conversion is best done where the file is read which is\nusually on the server side.\n\nPositions are line end character agnostic. So you can not specify a position\nthat denotes `\\r|\\n` or `\\n|` where `|` represents the character offset.\n\n@since 3.17.0 - support for negotiated position encoding.", - "since": "3.17.0 - support for negotiated position encoding." - }, - { - "name": "SelectionRangeOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "CallHierarchyOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Call hierarchy options used during static registration.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensOptions", - "properties": [ - { - "name": "legend", - "type": { - "kind": "reference", - "name": "SemanticTokensLegend" - }, - "documentation": "The legend used by the server" - }, - { - "name": "range", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [] - } - } - ] - }, - "optional": true, - "documentation": "Server supports providing semantic tokens for a specific range\nof a document." - }, - { - "name": "full", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "delta", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server supports deltas for full documents." - } - ] - } - } - ] - }, - "optional": true, - "documentation": "Server supports providing semantic tokens for a full document." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensEdit", - "properties": [ - { - "name": "start", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The start offset of the edit." - }, - { - "name": "deleteCount", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The count of elements to remove." - }, - { - "name": "data", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "uinteger" - } - }, - "optional": true, - "documentation": "The elements to insert." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "LinkedEditingRangeOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "FileCreate", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A file:// URI for the location of the file/folder being created." - } - ], - "documentation": "Represents information on a file/folder create.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "TextDocumentEdit", - "properties": [ - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "OptionalVersionedTextDocumentIdentifier" - }, - "documentation": "The text document to change." - }, - { - "name": "edits", - "type": { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "TextEdit" - }, - { - "kind": "reference", - "name": "AnnotatedTextEdit" - } - ] - } - }, - "documentation": "The edits to be applied.\n\n@since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability.", - "since": "3.16.0 - support for AnnotatedTextEdit. This is guarded using a\nclient capability." - } - ], - "documentation": "Describes textual changes on a text document. A TextDocumentEdit describes all changes\non a document version Si and after they are applied move the document to version Si+1.\nSo the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any\nkind of ordering. However the edits must be non overlapping." - }, - { - "name": "CreateFile", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "create" - }, - "documentation": "A create" - }, - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The resource to create." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "CreateFileOptions" - }, - "optional": true, - "documentation": "Additional options" - } - ], - "extends": [ - { - "kind": "reference", - "name": "ResourceOperation" - } - ], - "documentation": "Create file operation." - }, - { - "name": "RenameFile", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "rename" - }, - "documentation": "A rename" - }, - { - "name": "oldUri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The old (existing) location." - }, - { - "name": "newUri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The new location." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "RenameFileOptions" - }, - "optional": true, - "documentation": "Rename options." - } - ], - "extends": [ - { - "kind": "reference", - "name": "ResourceOperation" - } - ], - "documentation": "Rename file operation" - }, - { - "name": "DeleteFile", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "delete" - }, - "documentation": "A delete" - }, - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The file to delete." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "DeleteFileOptions" - }, - "optional": true, - "documentation": "Delete options." - } - ], - "extends": [ - { - "kind": "reference", - "name": "ResourceOperation" - } - ], - "documentation": "Delete file operation" - }, - { - "name": "ChangeAnnotation", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A human-readable string describing the actual change. The string\nis rendered prominent in the user interface." - }, - { - "name": "needsConfirmation", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "A flag which indicates that user confirmation is needed\nbefore applying the change." - }, - { - "name": "description", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A human-readable string which is rendered less prominent in\nthe user interface." - } - ], - "documentation": "Additional information that describes document changes.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "FileOperationFilter", - "properties": [ - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri scheme like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "reference", - "name": "FileOperationPattern" - }, - "documentation": "The actual file operation pattern." - } - ], - "documentation": "A filter to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "FileRename", - "properties": [ - { - "name": "oldUri", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A file:// URI for the original location of the file/folder being renamed." - }, - { - "name": "newUri", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A file:// URI for the new location of the file/folder being renamed." - } - ], - "documentation": "Represents information on a file/folder rename.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "FileDelete", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A file:// URI for the location of the file/folder being deleted." - } - ], - "documentation": "Represents information on a file/folder delete.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MonikerOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ] - }, - { - "name": "TypeHierarchyOptions", - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "properties": [], - "documentation": "Type hierarchy options used during static registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueContext", - "properties": [ - { - "name": "frameId", - "type": { - "kind": "base", - "name": "integer" - }, - "documentation": "The stack frame (as a DAP Id) where the execution has stopped." - }, - { - "name": "stoppedLocation", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range where execution has stopped.\nTypically the end position of the range denotes the line where the inline values are shown." - } - ], - "documentation": "@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueText", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range for which the inline value applies." - }, - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The text of the inline value." - } - ], - "documentation": "Provide inline value as text.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueVariableLookup", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range for which the inline value applies.\nThe range is used to extract the variable name from the underlying document." - }, - { - "name": "variableName", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "If specified the name of the variable to look up." - }, - { - "name": "caseSensitiveLookup", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "How to perform the lookup." - } - ], - "documentation": "Provide inline value through a variable lookup.\nIf only a range is specified, the variable name will be extracted from the underlying document.\nAn optional variable name can be used to override the extracted name.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueEvaluatableExpression", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The document range for which the inline value applies.\nThe range is used to extract the evaluatable expression from the underlying document." - }, - { - "name": "expression", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "If specified the expression overrides the extracted expression." - } - ], - "documentation": "Provide an inline value through an expression evaluation.\nIf only a range is specified, the expression will be extracted from the underlying document.\nAn optional expression can be used to override the extracted expression.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueOptions", - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "properties": [], - "documentation": "Inline value options used during static registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHintLabelPart", - "properties": [ - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The value of this label part." - }, - { - "name": "tooltip", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "MarkupContent" - } - ] - }, - "optional": true, - "documentation": "The tooltip text when you hover over this label part. Depending on\nthe client capability `inlayHint.resolveSupport` clients might resolve\nthis property late using the resolve request." - }, - { - "name": "location", - "type": { - "kind": "reference", - "name": "Location" - }, - "optional": true, - "documentation": "An optional source code location that represents this\nlabel part.\n\nThe editor will use this location for the hover and for code navigation\nfeatures: This part will become a clickable link that resolves to the\ndefinition of the symbol at the given location (not necessarily the\nlocation itself), it shows the hover that shows at the given location,\nand it shows a context menu with further code navigation commands.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." - }, - { - "name": "command", - "type": { - "kind": "reference", - "name": "Command" - }, - "optional": true, - "documentation": "An optional command for this label part.\n\nDepending on the client capability `inlayHint.resolveSupport` clients\nmight resolve this property late using the resolve request." - } - ], - "documentation": "An inlay hint label part allows for interactive and composite labels\nof inlay hints.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "MarkupContent", - "properties": [ - { - "name": "kind", - "type": { - "kind": "reference", - "name": "MarkupKind" - }, - "documentation": "The type of the Markup" - }, - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The content itself" - } - ], - "documentation": "A `MarkupContent` literal represents a string value which content is interpreted base on its\nkind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.\n\nIf the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.\nSee https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nHere is an example how such a string can be constructed using JavaScript / TypeScript:\n```ts\nlet markdown: MarkdownContent = {\n kind: MarkupKind.Markdown,\n value: [\n '# Header',\n 'Some text',\n '```typescript',\n 'someCode();',\n '```'\n ].join('\\n')\n};\n```\n\n*Please Note* that clients might sanitize the return markdown. A client could decide to\nremove HTML from the markdown to avoid script execution." - }, - { - "name": "InlayHintOptions", - "properties": [ - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server provides support to resolve additional\ninformation for an inlay hint item." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Inlay hint options used during static registration.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "RelatedFullDocumentDiagnosticReport", - "properties": [ - { - "name": "relatedDocuments", - "type": { - "kind": "map", - "key": { - "kind": "base", - "name": "DocumentUri" - }, - "value": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "FullDocumentDiagnosticReport" - }, - { - "kind": "reference", - "name": "UnchangedDocumentDiagnosticReport" - } - ] - } - }, - "optional": true, - "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "extends": [ - { - "kind": "reference", - "name": "FullDocumentDiagnosticReport" - } - ], - "documentation": "A full diagnostic report with a set of related documents.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "RelatedUnchangedDocumentDiagnosticReport", - "properties": [ - { - "name": "relatedDocuments", - "type": { - "kind": "map", - "key": { - "kind": "base", - "name": "DocumentUri" - }, - "value": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "FullDocumentDiagnosticReport" - }, - { - "kind": "reference", - "name": "UnchangedDocumentDiagnosticReport" - } - ] - } - }, - "optional": true, - "documentation": "Diagnostics of related documents. This information is useful\nin programming languages where code in a file A can generate\ndiagnostics in a file B which A depends on. An example of\nsuch a language is C/C++ where marco definitions in a file\na.cpp and result in errors in a header file b.hpp.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "extends": [ - { - "kind": "reference", - "name": "UnchangedDocumentDiagnosticReport" - } - ], - "documentation": "An unchanged diagnostic report with a set of related documents.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "FullDocumentDiagnosticReport", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "full" - }, - "documentation": "A full document diagnostic report." - }, - { - "name": "resultId", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional result id. If provided it will\nbe sent on the next diagnostic request for the\nsame document." - }, - { - "name": "items", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Diagnostic" - } - }, - "documentation": "The actual items." - } - ], - "documentation": "A diagnostic report with a full set of problems.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "UnchangedDocumentDiagnosticReport", - "properties": [ - { - "name": "kind", - "type": { - "kind": "stringLiteral", - "value": "unchanged" - }, - "documentation": "A document diagnostic report indicating\nno changes to the last result. A server can\nonly return `unchanged` if result ids are\nprovided." - }, - { - "name": "resultId", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A result id which will be sent on the next\ndiagnostic request for the same document." - } - ], - "documentation": "A diagnostic report indicating that the last returned\nreport is still accurate.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DiagnosticOptions", - "properties": [ - { - "name": "identifier", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional identifier under which the diagnostics are\nmanaged by the client." - }, - { - "name": "interFileDependencies", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "Whether the language has inter file dependencies meaning that\nediting code in one file can result in a different diagnostic\nset in another file. Inter file dependencies are common for\nmost programming languages and typically uncommon for linters." - }, - { - "name": "workspaceDiagnostics", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "The server provides support for workspace diagnostics as well." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Diagnostic options.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "PreviousResultId", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The URI for which the client knowns a\nresult id." - }, - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The value of the previous result id." - } - ], - "documentation": "A previous result id in a workspace pull request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocument", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "The notebook document's uri." - }, - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The type of the notebook." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "integer" - }, - "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." - }, - { - "name": "metadata", - "type": { - "kind": "reference", - "name": "LSPObject" - }, - "optional": true, - "documentation": "Additional metadata stored with the notebook\ndocument.\n\nNote: should always be an object literal (e.g. LSPObject)" - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCell" - } - }, - "documentation": "The cells of a notebook." - } - ], - "documentation": "A notebook document.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TextDocumentItem", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The text document's uri." - }, - { - "name": "languageId", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The text document's language identifier." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "integer" - }, - "documentation": "The version number of this document (it will increase after each\nchange, including undo/redo)." - }, - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The content of the opened text document." - } - ], - "documentation": "An item to transfer a text document from the client to the\nserver." - }, - { - "name": "VersionedNotebookDocumentIdentifier", - "properties": [ - { - "name": "version", - "type": { - "kind": "base", - "name": "integer" - }, - "documentation": "The version number of this notebook document." - }, - { - "name": "uri", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "The notebook document's uri." - } - ], - "documentation": "A versioned notebook document identifier.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentChangeEvent", - "properties": [ - { - "name": "metadata", - "type": { - "kind": "reference", - "name": "LSPObject" - }, - "optional": true, - "documentation": "The changed meta data if any.\n\nNote: should always be an object literal (e.g. LSPObject)" - }, - { - "name": "cells", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "structure", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "array", - "type": { - "kind": "reference", - "name": "NotebookCellArrayChange" - }, - "documentation": "The change to the cell array." - }, - { - "name": "didOpen", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentItem" - } - }, - "optional": true, - "documentation": "Additional opened cell text documents." - }, - { - "name": "didClose", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentIdentifier" - } - }, - "optional": true, - "documentation": "Additional closed cell text documents." - } - ] - } - }, - "optional": true, - "documentation": "Changes to the cell structure to add or\nremove cells." - }, - { - "name": "data", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCell" - } - }, - "optional": true, - "documentation": "Changes to notebook cells properties like its\nkind, execution summary or metadata." - }, - { - "name": "textContent", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "document", - "type": { - "kind": "reference", - "name": "VersionedTextDocumentIdentifier" - } - }, - { - "name": "changes", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TextDocumentContentChangeEvent" - } - } - } - ] - } - } - }, - "optional": true, - "documentation": "Changes to the text content of notebook cells." - } - ] - } - }, - "optional": true, - "documentation": "Changes to cells" - } - ], - "documentation": "A change event for a notebook document.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentIdentifier", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "The notebook document's uri." - } - ], - "documentation": "A literal to identify a notebook document in the client.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "Registration", - "properties": [ - { - "name": "id", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The id used to register the request. The id can be used to deregister\nthe request again." - }, - { - "name": "method", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The method / capability to register for." - }, - { - "name": "registerOptions", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "Options necessary for the registration." - } - ], - "documentation": "General parameters to to register for an notification or to register a provider." - }, - { - "name": "Unregistration", - "properties": [ - { - "name": "id", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The id used to unregister the request or notification. Usually an id\nprovided during the register request." - }, - { - "name": "method", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The method to unregister for." - } - ], - "documentation": "General parameters to unregister a request or notification." - }, - { - "name": "_InitializeParams", - "properties": [ - { - "name": "processId", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The process Id of the parent process that started\nthe server.\n\nIs `null` if the process has not been started by another process.\nIf the parent process is not alive then the server should exit." - }, - { - "name": "clientInfo", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the client as defined by the client." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The client's version as defined by the client." - } - ] - } - }, - "optional": true, - "documentation": "Information about the client\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "locale", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The locale the client is currently showing the user interface\nin. This must not necessarily be the locale of the operating\nsystem.\n\nUses IETF language tags as the value's syntax\n(See https://en.wikipedia.org/wiki/IETF_language_tag)\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "rootPath", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "optional": true, - "documentation": "The rootPath of the workspace. Is null\nif no folder is open.\n\n@deprecated in favour of rootUri." - }, - { - "name": "rootUri", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "DocumentUri" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The rootUri of the workspace. Is null if no\nfolder is open. If both `rootPath` and `rootUri` are set\n`rootUri` wins.\n\n@deprecated in favour of workspaceFolders." - }, - { - "name": "capabilities", - "type": { - "kind": "reference", - "name": "ClientCapabilities" - }, - "documentation": "The capabilities provided by the client (editor or tool)" - }, - { - "name": "initializationOptions", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "User provided initialization options." - }, - { - "name": "trace", - "type": { - "kind": "or", - "items": [ - { - "kind": "stringLiteral", - "value": "off" - }, - { - "kind": "stringLiteral", - "value": "messages" - }, - { - "kind": "stringLiteral", - "value": "compact" - }, - { - "kind": "stringLiteral", - "value": "verbose" - } - ] - }, - "optional": true, - "documentation": "The initial trace setting. If omitted trace is disabled ('off')." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressParams" - } - ], - "documentation": "The initialize parameters" - }, - { - "name": "WorkspaceFoldersInitializeParams", - "properties": [ - { - "name": "workspaceFolders", - "type": { - "kind": "or", - "items": [ - { - "kind": "array", - "element": { - "kind": "reference", - "name": "WorkspaceFolder" - } - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "optional": true, - "documentation": "The workspace folders configured in the client when the server starts.\n\nThis property is only available if the client supports workspace folders.\nIt can be `null` if the client supports workspace folders but none are\nconfigured.\n\n@since 3.6.0", - "since": "3.6.0" - } - ] - }, - { - "name": "ServerCapabilities", - "properties": [ - { - "name": "positionEncoding", - "type": { - "kind": "reference", - "name": "PositionEncodingKind" - }, - "optional": true, - "documentation": "The position encoding the server picked from the encodings offered\nby the client via the client capability `general.positionEncodings`.\n\nIf the client didn't provide any position encodings the only valid\nvalue that a server can return is 'utf-16'.\n\nIf omitted it defaults to 'utf-16'.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "textDocumentSync", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "TextDocumentSyncOptions" - }, - { - "kind": "reference", - "name": "TextDocumentSyncKind" - } - ] - }, - "optional": true, - "documentation": "Defines how text documents are synced. Is either a detailed structure\ndefining each notification or for backwards compatibility the\nTextDocumentSyncKind number." - }, - { - "name": "notebookDocumentSync", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "NotebookDocumentSyncOptions" - }, - { - "kind": "reference", - "name": "NotebookDocumentSyncRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "Defines how notebook documents are synced.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "completionProvider", - "type": { - "kind": "reference", - "name": "CompletionOptions" - }, - "optional": true, - "documentation": "The server provides completion support." - }, - { - "name": "hoverProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "HoverOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides hover support." - }, - { - "name": "signatureHelpProvider", - "type": { - "kind": "reference", - "name": "SignatureHelpOptions" - }, - "optional": true, - "documentation": "The server provides signature help support." - }, - { - "name": "declarationProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DeclarationOptions" - }, - { - "kind": "reference", - "name": "DeclarationRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides Goto Declaration support." - }, - { - "name": "definitionProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DefinitionOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides goto definition support." - }, - { - "name": "typeDefinitionProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "TypeDefinitionOptions" - }, - { - "kind": "reference", - "name": "TypeDefinitionRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides Goto Type Definition support." - }, - { - "name": "implementationProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "ImplementationOptions" - }, - { - "kind": "reference", - "name": "ImplementationRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides Goto Implementation support." - }, - { - "name": "referencesProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "ReferenceOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides find references support." - }, - { - "name": "documentHighlightProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DocumentHighlightOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides document highlight support." - }, - { - "name": "documentSymbolProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DocumentSymbolOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides document symbol support." - }, - { - "name": "codeActionProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "CodeActionOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides code actions. CodeActionOptions may only be\nspecified if the client states that it supports\n`codeActionLiteralSupport` in its initial `initialize` request." - }, - { - "name": "codeLensProvider", - "type": { - "kind": "reference", - "name": "CodeLensOptions" - }, - "optional": true, - "documentation": "The server provides code lens." - }, - { - "name": "documentLinkProvider", - "type": { - "kind": "reference", - "name": "DocumentLinkOptions" - }, - "optional": true, - "documentation": "The server provides document link support." - }, - { - "name": "colorProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DocumentColorOptions" - }, - { - "kind": "reference", - "name": "DocumentColorRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides color provider support." - }, - { - "name": "workspaceSymbolProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "WorkspaceSymbolOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides workspace symbol support." - }, - { - "name": "documentFormattingProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DocumentFormattingOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides document formatting." - }, - { - "name": "documentRangeFormattingProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "DocumentRangeFormattingOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides document range formatting." - }, - { - "name": "documentOnTypeFormattingProvider", - "type": { - "kind": "reference", - "name": "DocumentOnTypeFormattingOptions" - }, - "optional": true, - "documentation": "The server provides document formatting on typing." - }, - { - "name": "renameProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "RenameOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides rename support. RenameOptions may only be\nspecified if the client states that it supports\n`prepareSupport` in its initial `initialize` request." - }, - { - "name": "foldingRangeProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "FoldingRangeOptions" - }, - { - "kind": "reference", - "name": "FoldingRangeRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides folding provider support." - }, - { - "name": "selectionRangeProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "SelectionRangeOptions" - }, - { - "kind": "reference", - "name": "SelectionRangeRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides selection range support." - }, - { - "name": "executeCommandProvider", - "type": { - "kind": "reference", - "name": "ExecuteCommandOptions" - }, - "optional": true, - "documentation": "The server provides execute command support." - }, - { - "name": "callHierarchyProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "CallHierarchyOptions" - }, - { - "kind": "reference", - "name": "CallHierarchyRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides call hierarchy support.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "linkedEditingRangeProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "LinkedEditingRangeOptions" - }, - { - "kind": "reference", - "name": "LinkedEditingRangeRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides linked editing range support.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "semanticTokensProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "SemanticTokensOptions" - }, - { - "kind": "reference", - "name": "SemanticTokensRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides semantic tokens support.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "monikerProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "MonikerOptions" - }, - { - "kind": "reference", - "name": "MonikerRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides moniker support.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "typeHierarchyProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "TypeHierarchyOptions" - }, - { - "kind": "reference", - "name": "TypeHierarchyRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides type hierarchy support.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "inlineValueProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "InlineValueOptions" - }, - { - "kind": "reference", - "name": "InlineValueRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides inline values.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "inlayHintProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "InlayHintOptions" - }, - { - "kind": "reference", - "name": "InlayHintRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server provides inlay hints.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "diagnosticProvider", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "DiagnosticOptions" - }, - { - "kind": "reference", - "name": "DiagnosticRegistrationOptions" - } - ] - }, - "optional": true, - "documentation": "The server has support for pull model diagnostics.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "workspace", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "workspaceFolders", - "type": { - "kind": "reference", - "name": "WorkspaceFoldersServerCapabilities" - }, - "optional": true, - "documentation": "The server supports workspace folder.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "fileOperations", - "type": { - "kind": "reference", - "name": "FileOperationOptions" - }, - "optional": true, - "documentation": "The server is interested in notifications/requests for operations on files.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - } - }, - "optional": true, - "documentation": "Workspace specific server capabilities." - }, - { - "name": "experimental", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "Experimental server capabilities." - } - ], - "documentation": "Defines the capabilities provided by a language\nserver." - }, - { - "name": "VersionedTextDocumentIdentifier", - "properties": [ - { - "name": "version", - "type": { - "kind": "base", - "name": "integer" - }, - "documentation": "The version number of this document." - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentIdentifier" - } - ], - "documentation": "A text document identifier to denote a specific version of a text document." - }, - { - "name": "SaveOptions", - "properties": [ - { - "name": "includeText", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client is supposed to include the content on save." - } - ], - "documentation": "Save options." - }, - { - "name": "FileEvent", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The file's uri." - }, - { - "name": "type", - "type": { - "kind": "reference", - "name": "FileChangeType" - }, - "documentation": "The change type." - } - ], - "documentation": "An event describing a file change." - }, - { - "name": "FileSystemWatcher", - "properties": [ - { - "name": "globPattern", - "type": { - "kind": "reference", - "name": "GlobPattern" - }, - "documentation": "The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail.\n\n@since 3.17.0 support for relative patterns.", - "since": "3.17.0 support for relative patterns." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "WatchKind" - }, - "optional": true, - "documentation": "The kind of events of interest. If omitted it defaults\nto WatchKind.Create | WatchKind.Change | WatchKind.Delete\nwhich is 7." - } - ] - }, - { - "name": "Diagnostic", - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range at which the message applies" - }, - { - "name": "severity", - "type": { - "kind": "reference", - "name": "DiagnosticSeverity" - }, - "optional": true, - "documentation": "The diagnostic's severity. Can be omitted. If omitted it is up to the\nclient to interpret diagnostics as error, warning, info or hint." - }, - { - "name": "code", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "string" - } - ] - }, - "optional": true, - "documentation": "The diagnostic's code, which usually appear in the user interface." - }, - { - "name": "codeDescription", - "type": { - "kind": "reference", - "name": "CodeDescription" - }, - "optional": true, - "documentation": "An optional property to describe the error code.\nRequires the code field (above) to be present/not null.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "source", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A human-readable string describing the source of this\ndiagnostic, e.g. 'typescript' or 'super lint'. It usually\nappears in the user interface." - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The diagnostic's message. It usually appears in the user interface" - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DiagnosticTag" - } - }, - "optional": true, - "documentation": "Additional metadata about the diagnostic.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "relatedInformation", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DiagnosticRelatedInformation" - } - }, - "optional": true, - "documentation": "An array of related diagnostic information, e.g. when symbol-names within\na scope collide all definitions can be marked via this property." - }, - { - "name": "data", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "A data entry field that is preserved between a `textDocument/publishDiagnostics`\nnotification and `textDocument/codeAction` request.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "Represents a diagnostic, such as a compiler error or warning. Diagnostic objects\nare only valid in the scope of a resource." - }, - { - "name": "CompletionContext", - "properties": [ - { - "name": "triggerKind", - "type": { - "kind": "reference", - "name": "CompletionTriggerKind" - }, - "documentation": "How the completion was triggered." - }, - { - "name": "triggerCharacter", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The trigger character (a single character) that has trigger code complete.\nIs undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`" - } - ], - "documentation": "Contains additional information about the context in which a completion request is triggered." - }, - { - "name": "CompletionItemLabelDetails", - "properties": [ - { - "name": "detail", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional string which is rendered less prominently directly after {@link CompletionItem.label label},\nwithout any spacing. Should be used for function signatures and type annotations." - }, - { - "name": "description", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used\nfor fully qualified names and file paths." - } - ], - "documentation": "Additional details for a completion item label.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InsertReplaceEdit", - "properties": [ - { - "name": "newText", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The string to be inserted." - }, - { - "name": "insert", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range if the insert is requested" - }, - { - "name": "replace", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range if the replace is requested." - } - ], - "documentation": "A special text edit to provide an insert and a replace operation.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CompletionOptions", - "properties": [ - { - "name": "triggerCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "Most tools trigger completion request automatically without explicitly requesting\nit using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user\nstarts to type an identifier. For example if the user types `c` in a JavaScript file\ncode complete will automatically pop up present `console` besides others as a\ncompletion item. Characters that make up identifiers don't need to be listed here.\n\nIf code complete should automatically be trigger on characters not being valid inside\nan identifier (for example `.` in JavaScript) list them in `triggerCharacters`." - }, - { - "name": "allCommitCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "The list of all possible characters that commit a completion. This field can be used\nif clients don't support individual commit characters per completion item. See\n`ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`\n\nIf a server provides both `allCommitCharacters` and commit characters on an individual\ncompletion item the ones on the completion item win.\n\n@since 3.2.0", - "since": "3.2.0" - }, - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server provides support to resolve additional\ninformation for a completion item." - }, - { - "name": "completionItem", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "labelDetailsSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server has support for completion item label\ndetails (see also `CompletionItemLabelDetails`) when\nreceiving a completion item in a resolve call.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } - }, - "optional": true, - "documentation": "The server supports the following `CompletionItem` specific\ncapabilities.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Completion options." - }, - { - "name": "HoverOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Hover options." - }, - { - "name": "SignatureHelpContext", - "properties": [ - { - "name": "triggerKind", - "type": { - "kind": "reference", - "name": "SignatureHelpTriggerKind" - }, - "documentation": "Action that caused signature help to be triggered." - }, - { - "name": "triggerCharacter", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "Character that caused signature help to be triggered.\n\nThis is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`" - }, - { - "name": "isRetrigger", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "`true` if signature help was already showing when it was triggered.\n\nRetriggers occurs when the signature help is already active and can be caused by actions such as\ntyping a trigger character, a cursor move, or document content changes." - }, - { - "name": "activeSignatureHelp", - "type": { - "kind": "reference", - "name": "SignatureHelp" - }, - "optional": true, - "documentation": "The currently active `SignatureHelp`.\n\nThe `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on\nthe user navigating through available signatures." - } - ], - "documentation": "Additional information about the context in which a signature help request was triggered.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "SignatureInformation", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The label of this signature. Will be shown in\nthe UI." - }, - { - "name": "documentation", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "MarkupContent" - } - ] - }, - "optional": true, - "documentation": "The human-readable doc-comment of this signature. Will be shown\nin the UI but can be omitted." - }, - { - "name": "parameters", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ParameterInformation" - } - }, - "optional": true, - "documentation": "The parameters of this signature." - }, - { - "name": "activeParameter", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The index of the active parameter.\n\nIf provided, this is used in place of `SignatureHelp.activeParameter`.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "Represents the signature of something callable. A signature\ncan have a label, like a function-name, a doc-comment, and\na set of parameters." - }, - { - "name": "SignatureHelpOptions", - "properties": [ - { - "name": "triggerCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "List of characters that trigger signature help automatically." - }, - { - "name": "retriggerCharacters", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "List of characters that re-trigger signature help.\n\nThese trigger characters are only active when signature help is already showing. All trigger characters\nare also counted as re-trigger characters.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Server Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest)." - }, - { - "name": "DefinitionOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Server Capabilities for a [DefinitionRequest](#DefinitionRequest)." - }, - { - "name": "ReferenceContext", - "properties": [ - { - "name": "includeDeclaration", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "Include the declaration of the current symbol." - } - ], - "documentation": "Value-object that contains additional information when\nrequesting references." - }, - { - "name": "ReferenceOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Reference options." - }, - { - "name": "DocumentHighlightOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [DocumentHighlightRequest](#DocumentHighlightRequest)." - }, - { - "name": "BaseSymbolInformation", - "properties": [ - { - "name": "name", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of this symbol." - }, - { - "name": "kind", - "type": { - "kind": "reference", - "name": "SymbolKind" - }, - "documentation": "The kind of this symbol." - }, - { - "name": "tags", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "optional": true, - "documentation": "Tags for this symbol.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "containerName", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The name of the symbol containing this symbol. This information is for\nuser interface purposes (e.g. to render a qualifier in the user interface\nif necessary). It can't be used to re-infer a hierarchy for the document\nsymbols." - } - ], - "documentation": "A base for all symbol information." - }, - { - "name": "DocumentSymbolOptions", - "properties": [ - { - "name": "label", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A human-readable string that is shown when multiple outlines trees\nare shown for the same document.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [DocumentSymbolRequest](#DocumentSymbolRequest)." - }, - { - "name": "CodeActionContext", - "properties": [ - { - "name": "diagnostics", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "Diagnostic" - } - }, - "documentation": "An array of diagnostics known on the client side overlapping the range provided to the\n`textDocument/codeAction` request. They are provided so that the server knows which\nerrors are currently presented to the user for the given range. There is no guarantee\nthat these accurately reflect the error state of the resource. The primary parameter\nto compute code actions is the provided range." - }, - { - "name": "only", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeActionKind" - } - }, - "optional": true, - "documentation": "Requested kind of actions to return.\n\nActions not of this kind are filtered out by the client before being shown. So servers\ncan omit computing them." - }, - { - "name": "triggerKind", - "type": { - "kind": "reference", - "name": "CodeActionTriggerKind" - }, - "optional": true, - "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Contains additional diagnostic information about the context in which\na [code action](#CodeActionProvider.provideCodeActions) is run." - }, - { - "name": "CodeActionOptions", - "properties": [ - { - "name": "codeActionKinds", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeActionKind" - } - }, - "optional": true, - "documentation": "CodeActionKinds that this server may return.\n\nThe list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server\nmay list out every specific kind they provide." - }, - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server provides support to resolve additional\ninformation for a code action.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [CodeActionRequest](#CodeActionRequest)." - }, - { - "name": "WorkspaceSymbolOptions", - "properties": [ - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server provides support to resolve additional\ninformation for a workspace symbol.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Server capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." - }, - { - "name": "CodeLensOptions", - "properties": [ - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Code lens has a resolve provider as well." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Code Lens provider options of a [CodeLensRequest](#CodeLensRequest)." - }, - { - "name": "DocumentLinkOptions", - "properties": [ - { - "name": "resolveProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Document links have a resolve provider as well." - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [DocumentLinkRequest](#DocumentLinkRequest)." - }, - { - "name": "FormattingOptions", - "properties": [ - { - "name": "tabSize", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "Size of a tab in spaces." - }, - { - "name": "insertSpaces", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "Prefer spaces over tabs." - }, - { - "name": "trimTrailingWhitespace", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Trim trailing whitespace on a line.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "insertFinalNewline", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Insert a newline character at the end of the file if one does not exist.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "trimFinalNewlines", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Trim all newlines after the final newline at the end of the file.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "documentation": "Value-object describing what options formatting should use." - }, - { - "name": "DocumentFormattingOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [DocumentFormattingRequest](#DocumentFormattingRequest)." - }, - { - "name": "DocumentRangeFormattingOptions", - "properties": [], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." - }, - { - "name": "DocumentOnTypeFormattingOptions", - "properties": [ - { - "name": "firstTriggerCharacter", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A character on which formatting should be triggered, like `{`." - }, - { - "name": "moreTriggerCharacter", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "More trigger characters." - } - ], - "documentation": "Provider options for a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." - }, - { - "name": "RenameOptions", - "properties": [ - { - "name": "prepareProvider", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Renames should be checked and tested before being executed.\n\n@since version 3.12.0", - "since": "version 3.12.0" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "Provider options for a [RenameRequest](#RenameRequest)." - }, - { - "name": "ExecuteCommandOptions", - "properties": [ - { - "name": "commands", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The commands to be executed on the server" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "WorkDoneProgressOptions" - } - ], - "documentation": "The server capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest)." - }, - { - "name": "SemanticTokensLegend", - "properties": [ - { - "name": "tokenTypes", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The token types a server uses." - }, - { - "name": "tokenModifiers", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The token modifiers a server uses." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "OptionalVersionedTextDocumentIdentifier", - "properties": [ - { - "name": "version", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The version number of this document. If a versioned text document identifier\nis sent from the server to the client and the file is not open in the editor\n(the server has not received an open notification before) the server can send\n`null` to indicate that the version is unknown and the content on disk is the\ntruth (as specified with document content ownership)." - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextDocumentIdentifier" - } - ], - "documentation": "A text document identifier to optionally denote a specific version of a text document." - }, - { - "name": "AnnotatedTextEdit", - "properties": [ - { - "name": "annotationId", - "type": { - "kind": "reference", - "name": "ChangeAnnotationIdentifier" - }, - "documentation": "The actual identifier of the change annotation" - } - ], - "extends": [ - { - "kind": "reference", - "name": "TextEdit" - } - ], - "documentation": "A special text edit with an additional change annotation.\n\n@since 3.16.0.", - "since": "3.16.0." - }, - { - "name": "ResourceOperation", - "properties": [ - { - "name": "kind", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The resource operation kind." - }, - { - "name": "annotationId", - "type": { - "kind": "reference", - "name": "ChangeAnnotationIdentifier" - }, - "optional": true, - "documentation": "An optional annotation identifier describing the operation.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "A generic resource operation." - }, - { - "name": "CreateFileOptions", - "properties": [ - { - "name": "overwrite", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Overwrite existing file. Overwrite wins over `ignoreIfExists`" - }, - { - "name": "ignoreIfExists", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Ignore if exists." - } - ], - "documentation": "Options to create a file." - }, - { - "name": "RenameFileOptions", - "properties": [ - { - "name": "overwrite", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Overwrite target if existing. Overwrite wins over `ignoreIfExists`" - }, - { - "name": "ignoreIfExists", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Ignores if target exists." - } - ], - "documentation": "Rename file options" - }, - { - "name": "DeleteFileOptions", - "properties": [ - { - "name": "recursive", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Delete the content recursively if a folder is denoted." - }, - { - "name": "ignoreIfNotExists", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Ignore the operation if the file doesn't exist." - } - ], - "documentation": "Delete file options" - }, - { - "name": "FileOperationPattern", - "properties": [ - { - "name": "glob", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The glob pattern to match. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)" - }, - { - "name": "matches", - "type": { - "kind": "reference", - "name": "FileOperationPatternKind" - }, - "optional": true, - "documentation": "Whether to match files or folders with this pattern.\n\nMatches both if undefined." - }, - { - "name": "options", - "type": { - "kind": "reference", - "name": "FileOperationPatternOptions" - }, - "optional": true, - "documentation": "Additional options used during matching." - } - ], - "documentation": "A pattern to describe in which file operation requests or notifications\nthe server is interested in receiving.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "WorkspaceFullDocumentDiagnosticReport", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The URI for which diagnostic information is reported." - }, - { - "name": "version", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." - } - ], - "extends": [ - { - "kind": "reference", - "name": "FullDocumentDiagnosticReport" - } - ], - "documentation": "A full document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceUnchangedDocumentDiagnosticReport", - "properties": [ - { - "name": "uri", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The URI for which diagnostic information is reported." - }, - { - "name": "version", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The version number for which the diagnostics are reported.\nIf the document is not marked as open `null` can be provided." - } - ], - "extends": [ - { - "kind": "reference", - "name": "UnchangedDocumentDiagnosticReport" - } - ], - "documentation": "An unchanged document diagnostic report for a workspace diagnostic result.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "LSPObject", - "properties": [], - "documentation": "LSP object definition.\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookCell", - "properties": [ - { - "name": "kind", - "type": { - "kind": "reference", - "name": "NotebookCellKind" - }, - "documentation": "The cell's kind" - }, - { - "name": "document", - "type": { - "kind": "base", - "name": "DocumentUri" - }, - "documentation": "The URI of the cell's text document\ncontent." - }, - { - "name": "metadata", - "type": { - "kind": "reference", - "name": "LSPObject" - }, - "optional": true, - "documentation": "Additional metadata stored with the cell.\n\nNote: should always be an object literal (e.g. LSPObject)" - }, - { - "name": "executionSummary", - "type": { - "kind": "reference", - "name": "ExecutionSummary" - }, - "optional": true, - "documentation": "Additional execution summary information\nif supported by the client." - } - ], - "documentation": "A notebook cell.\n\nA cell's document URI must be unique across ALL notebook\ncells and can therefore be used to uniquely identify a\nnotebook cell or the cell's text document.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookCellArrayChange", - "properties": [ - { - "name": "start", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The start oftest of the cell that changed." - }, - { - "name": "deleteCount", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "The deleted cells" - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "NotebookCell" - } - }, - "optional": true, - "documentation": "The new cells, if any" - } - ], - "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ClientCapabilities", - "properties": [ - { - "name": "workspace", - "type": { - "kind": "reference", - "name": "WorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Workspace specific client capabilities." - }, - { - "name": "textDocument", - "type": { - "kind": "reference", - "name": "TextDocumentClientCapabilities" - }, - "optional": true, - "documentation": "Text document specific client capabilities." - }, - { - "name": "notebookDocument", - "type": { - "kind": "reference", - "name": "NotebookDocumentClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "window", - "type": { - "kind": "reference", - "name": "WindowClientCapabilities" - }, - "optional": true, - "documentation": "Window specific client capabilities." - }, - { - "name": "general", - "type": { - "kind": "reference", - "name": "GeneralClientCapabilities" - }, - "optional": true, - "documentation": "General client capabilities.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "experimental", - "type": { - "kind": "reference", - "name": "LSPAny" - }, - "optional": true, - "documentation": "Experimental client capabilities." - } - ], - "documentation": "Defines the capabilities provided by the client." - }, - { - "name": "TextDocumentSyncOptions", - "properties": [ - { - "name": "openClose", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Open and close notifications are sent to the server. If omitted open close notification should not\nbe sent." - }, - { - "name": "change", - "type": { - "kind": "reference", - "name": "TextDocumentSyncKind" - }, - "optional": true, - "documentation": "Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full\nand TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None." - }, - { - "name": "willSave", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "If present will save notifications are sent to the server. If omitted the notification should not be\nsent." - }, - { - "name": "willSaveWaitUntil", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "If present will save wait until requests are sent to the server. If omitted the request should not be\nsent." - }, - { - "name": "save", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "reference", - "name": "SaveOptions" - } - ] - }, - "optional": true, - "documentation": "If present save notifications are sent to the server. If omitted the notification should not be\nsent." - } - ] - }, - { - "name": "NotebookDocumentSyncOptions", - "properties": [ - { - "name": "notebookSelector", - "type": { - "kind": "array", - "element": { - "kind": "or", - "items": [ - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - } - }, - "optional": true, - "documentation": "The cells of the matching notebook to be synced." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "optional": true, - "documentation": "The notebook to be synced If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "cells", - "type": { - "kind": "array", - "element": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - } - }, - "documentation": "The cells of the matching notebook to be synced." - } - ] - } - } - ] - } - }, - "documentation": "The notebooks to be synced" - }, - { - "name": "save", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether save notification should be forwarded to\nthe server. Will only be honored if mode === `notebook`." - } - ], - "documentation": "Options specific to a notebook plus its cells\nto be synced to the server.\n\nIf a selector provides a notebook document\nfilter but no cell selector all cells of a\nmatching notebook document will be synced.\n\nIf a selector provides no notebook document\nfilter but only a cell selector all notebook\ndocument that contain at least one matching\ncell will be synced.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentSyncRegistrationOptions", - "properties": [], - "extends": [ - { - "kind": "reference", - "name": "NotebookDocumentSyncOptions" - } - ], - "mixins": [ - { - "kind": "reference", - "name": "StaticRegistrationOptions" - } - ], - "documentation": "Registration options specific to a notebook.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceFoldersServerCapabilities", - "properties": [ - { - "name": "supported", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The server has support for workspace folders" - }, - { - "name": "changeNotifications", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "base", - "name": "boolean" - } - ] - }, - "optional": true, - "documentation": "Whether the server wants to receive workspace folder\nchange notifications.\n\nIf a string is provided the string is treated as an ID\nunder which the notification is registered on the client\nside. The ID can be used to unregister for these events\nusing the `client/unregisterCapability` request." - } - ] - }, - { - "name": "FileOperationOptions", - "properties": [ - { - "name": "didCreate", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving didCreateFiles notifications." - }, - { - "name": "willCreate", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving willCreateFiles requests." - }, - { - "name": "didRename", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving didRenameFiles notifications." - }, - { - "name": "willRename", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving willRenameFiles requests." - }, - { - "name": "didDelete", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving didDeleteFiles file notifications." - }, - { - "name": "willDelete", - "type": { - "kind": "reference", - "name": "FileOperationRegistrationOptions" - }, - "optional": true, - "documentation": "The server is interested in receiving willDeleteFiles file requests." - } - ], - "documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CodeDescription", - "properties": [ - { - "name": "href", - "type": { - "kind": "base", - "name": "URI" - }, - "documentation": "An URI to open with more information about the diagnostic error." - } - ], - "documentation": "Structure to capture a description for an error code.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "DiagnosticRelatedInformation", - "properties": [ - { - "name": "location", - "type": { - "kind": "reference", - "name": "Location" - }, - "documentation": "The location of this related diagnostic information." - }, - { - "name": "message", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The message of this related diagnostic information." - } - ], - "documentation": "Represents a related message and source code location for a diagnostic. This should be\nused to point to code locations that cause or related to a diagnostics, e.g when duplicating\na symbol in a scope." - }, - { - "name": "ParameterInformation", - "properties": [ - { - "name": "label", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "tuple", - "items": [ - { - "kind": "base", - "name": "uinteger" - }, - { - "kind": "base", - "name": "uinteger" - } - ] - } - ] - }, - "documentation": "The label of this parameter information.\n\nEither a string or an inclusive start and exclusive end offsets within its containing\nsignature label. (see SignatureInformation.label). The offsets are based on a UTF-16\nstring representation as `Position` and `Range` does.\n\n*Note*: a label of type string should be a substring of its containing signature label.\nIts intended use case is to highlight the parameter label part in the `SignatureInformation.label`." - }, - { - "name": "documentation", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "MarkupContent" - } - ] - }, - "optional": true, - "documentation": "The human-readable doc-comment of this parameter. Will be shown\nin the UI but can be omitted." - } - ], - "documentation": "Represents a parameter of a callable-signature. A parameter can\nhave a label and a doc-comment." - }, - { - "name": "NotebookCellTextDocumentFilter", - "properties": [ - { - "name": "notebook", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "reference", - "name": "NotebookDocumentFilter" - } - ] - }, - "documentation": "A filter that matches against the notebook\ncontaining the notebook cell. If a string\nvalue is provided it matches against the\nnotebook type. '*' matches every notebook." - }, - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id like `python`.\n\nWill be matched against the language id of the\nnotebook cell document. '*' matches every language." - } - ], - "documentation": "A notebook cell text document filter denotes a cell text\ndocument by different properties.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "FileOperationPatternOptions", - "properties": [ - { - "name": "ignoreCase", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The pattern should be matched ignoring casing." - } - ], - "documentation": "Matching options for the file operation pattern.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "ExecutionSummary", - "properties": [ - { - "name": "executionOrder", - "type": { - "kind": "base", - "name": "uinteger" - }, - "documentation": "A strict monotonically increasing value\nindicating the execution order of a cell\ninside a notebook." - }, - { - "name": "success", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the execution was successful or\nnot if known by the client." - } - ] - }, - { - "name": "WorkspaceClientCapabilities", - "properties": [ - { - "name": "applyEdit", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports applying batch edits\nto the workspace by supporting the request\n'workspace/applyEdit'" - }, - { - "name": "workspaceEdit", - "type": { - "kind": "reference", - "name": "WorkspaceEditClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to `WorkspaceEdit`s." - }, - { - "name": "didChangeConfiguration", - "type": { - "kind": "reference", - "name": "DidChangeConfigurationClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `workspace/didChangeConfiguration` notification." - }, - { - "name": "didChangeWatchedFiles", - "type": { - "kind": "reference", - "name": "DidChangeWatchedFilesClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `workspace/didChangeWatchedFiles` notification." - }, - { - "name": "symbol", - "type": { - "kind": "reference", - "name": "WorkspaceSymbolClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `workspace/symbol` request." - }, - { - "name": "executeCommand", - "type": { - "kind": "reference", - "name": "ExecuteCommandClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `workspace/executeCommand` request." - }, - { - "name": "workspaceFolders", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for workspace folders.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "configuration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports `workspace/configuration` requests.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "semanticTokens", - "type": { - "kind": "reference", - "name": "SemanticTokensWorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the semantic token requests scoped to the\nworkspace.\n\n@since 3.16.0.", - "since": "3.16.0." - }, - { - "name": "codeLens", - "type": { - "kind": "reference", - "name": "CodeLensWorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the code lens requests scoped to the\nworkspace.\n\n@since 3.16.0.", - "since": "3.16.0." - }, - { - "name": "fileOperations", - "type": { - "kind": "reference", - "name": "FileOperationClientCapabilities" - }, - "optional": true, - "documentation": "The client has support for file notifications/requests for user operations on files.\n\nSince 3.16.0" - }, - { - "name": "inlineValue", - "type": { - "kind": "reference", - "name": "InlineValueWorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the inline values requests scoped to the\nworkspace.\n\n@since 3.17.0.", - "since": "3.17.0." - }, - { - "name": "inlayHint", - "type": { - "kind": "reference", - "name": "InlayHintWorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the inlay hint requests scoped to the\nworkspace.\n\n@since 3.17.0.", - "since": "3.17.0." - }, - { - "name": "diagnostics", - "type": { - "kind": "reference", - "name": "DiagnosticWorkspaceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the diagnostic requests scoped to the\nworkspace.\n\n@since 3.17.0.", - "since": "3.17.0." - } - ], - "documentation": "Workspace specific client capabilities." - }, - { - "name": "TextDocumentClientCapabilities", - "properties": [ - { - "name": "synchronization", - "type": { - "kind": "reference", - "name": "TextDocumentSyncClientCapabilities" - }, - "optional": true, - "documentation": "Defines which synchronization capabilities the client supports." - }, - { - "name": "completion", - "type": { - "kind": "reference", - "name": "CompletionClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/completion` request." - }, - { - "name": "hover", - "type": { - "kind": "reference", - "name": "HoverClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/hover` request." - }, - { - "name": "signatureHelp", - "type": { - "kind": "reference", - "name": "SignatureHelpClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/signatureHelp` request." - }, - { - "name": "declaration", - "type": { - "kind": "reference", - "name": "DeclarationClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/declaration` request.\n\n@since 3.14.0", - "since": "3.14.0" - }, - { - "name": "definition", - "type": { - "kind": "reference", - "name": "DefinitionClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/definition` request." - }, - { - "name": "typeDefinition", - "type": { - "kind": "reference", - "name": "TypeDefinitionClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/typeDefinition` request.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "implementation", - "type": { - "kind": "reference", - "name": "ImplementationClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/implementation` request.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "references", - "type": { - "kind": "reference", - "name": "ReferenceClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/references` request." - }, - { - "name": "documentHighlight", - "type": { - "kind": "reference", - "name": "DocumentHighlightClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/documentHighlight` request." - }, - { - "name": "documentSymbol", - "type": { - "kind": "reference", - "name": "DocumentSymbolClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/documentSymbol` request." - }, - { - "name": "codeAction", - "type": { - "kind": "reference", - "name": "CodeActionClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/codeAction` request." - }, - { - "name": "codeLens", - "type": { - "kind": "reference", - "name": "CodeLensClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/codeLens` request." - }, - { - "name": "documentLink", - "type": { - "kind": "reference", - "name": "DocumentLinkClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/documentLink` request." - }, - { - "name": "colorProvider", - "type": { - "kind": "reference", - "name": "DocumentColorClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/documentColor` and the\n`textDocument/colorPresentation` request.\n\n@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "formatting", - "type": { - "kind": "reference", - "name": "DocumentFormattingClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/formatting` request." - }, - { - "name": "rangeFormatting", - "type": { - "kind": "reference", - "name": "DocumentRangeFormattingClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/rangeFormatting` request." - }, - { - "name": "onTypeFormatting", - "type": { - "kind": "reference", - "name": "DocumentOnTypeFormattingClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/onTypeFormatting` request." - }, - { - "name": "rename", - "type": { - "kind": "reference", - "name": "RenameClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/rename` request." - }, - { - "name": "foldingRange", - "type": { - "kind": "reference", - "name": "FoldingRangeClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/foldingRange` request.\n\n@since 3.10.0", - "since": "3.10.0" - }, - { - "name": "selectionRange", - "type": { - "kind": "reference", - "name": "SelectionRangeClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/selectionRange` request.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "publishDiagnostics", - "type": { - "kind": "reference", - "name": "PublishDiagnosticsClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/publishDiagnostics` notification." - }, - { - "name": "callHierarchy", - "type": { - "kind": "reference", - "name": "CallHierarchyClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the various call hierarchy requests.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "semanticTokens", - "type": { - "kind": "reference", - "name": "SemanticTokensClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the various semantic token request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "linkedEditingRange", - "type": { - "kind": "reference", - "name": "LinkedEditingRangeClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/linkedEditingRange` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "moniker", - "type": { - "kind": "reference", - "name": "MonikerClientCapabilities" - }, - "optional": true, - "documentation": "Client capabilities specific to the `textDocument/moniker` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "typeHierarchy", - "type": { - "kind": "reference", - "name": "TypeHierarchyClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the various type hierarchy requests.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "inlineValue", - "type": { - "kind": "reference", - "name": "InlineValueClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/inlineValue` request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "inlayHint", - "type": { - "kind": "reference", - "name": "InlayHintClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the `textDocument/inlayHint` request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "diagnostic", - "type": { - "kind": "reference", - "name": "DiagnosticClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the diagnostic pull model.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Text document specific client capabilities." - }, - { - "name": "NotebookDocumentClientCapabilities", - "properties": [ - { - "name": "synchronization", - "type": { - "kind": "reference", - "name": "NotebookDocumentSyncClientCapabilities" - }, - "documentation": "Capabilities specific to notebook document synchronization\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Capabilities specific to the notebook document support.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WindowClientCapabilities", - "properties": [ - { - "name": "workDoneProgress", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "It indicates whether the client supports server initiated\nprogress using the `window/workDoneProgress/create` request.\n\nThe capability also controls Whether client supports handling\nof progress notifications. If set servers are allowed to report a\n`workDoneProgress` property in the request specific server\ncapabilities.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "showMessage", - "type": { - "kind": "reference", - "name": "ShowMessageRequestClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the showMessage request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "showDocument", - "type": { - "kind": "reference", - "name": "ShowDocumentClientCapabilities" - }, - "optional": true, - "documentation": "Capabilities specific to the showDocument request.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - }, - { - "name": "GeneralClientCapabilities", - "properties": [ - { - "name": "staleRequestSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "cancel", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "The client will actively cancel the request." - }, - { - "name": "retryOnContentModified", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The list of requests for which the client\nwill retry the request if it receives a\nresponse with error code `ContentModified`" - } - ] - } - }, - "optional": true, - "documentation": "Client capability that signals how the client\nhandles stale requests (e.g. a request\nfor which the client will not process the response\nanymore since the information is outdated).\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "regularExpressions", - "type": { - "kind": "reference", - "name": "RegularExpressionsClientCapabilities" - }, - "optional": true, - "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "markdown", - "type": { - "kind": "reference", - "name": "MarkdownClientCapabilities" - }, - "optional": true, - "documentation": "Client capabilities specific to the client's markdown parser.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "positionEncodings", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "PositionEncodingKind" - } - }, - "optional": true, - "documentation": "The position encodings supported by the client. Client and server\nhave to agree on the same position encoding to ensure that offsets\n(e.g. character position in a line) are interpreted the same on both\nsides.\n\nTo keep the protocol backwards compatible the following applies: if\nthe value 'utf-16' is missing from the array of position encodings\nservers can assume that the client supports UTF-16. UTF-16 is\ntherefore a mandatory encoding.\n\nIf omitted it defaults to ['utf-16'].\n\nImplementation considerations: since the conversion from one encoding\ninto another requires the content of the file / line the conversion\nis best done where the file is read which is usually on the server\nside.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "General client capabilities.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "RelativePattern", - "properties": [ - { - "name": "baseUri", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceFolder" - }, - { - "kind": "base", - "name": "URI" - } - ] - }, - "documentation": "A workspace folder or a base URI to which this pattern will be matched\nagainst relatively." - }, - { - "name": "pattern", - "type": { - "kind": "reference", - "name": "Pattern" - }, - "documentation": "The actual glob pattern;" - } - ], - "documentation": "A relative pattern is a helper to construct glob patterns that are matched\nrelatively to a base URI. The common value for a `baseUri` is a workspace\nfolder root, but it can be another absolute URI as well.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "WorkspaceEditClientCapabilities", - "properties": [ - { - "name": "documentChanges", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports versioned document changes in `WorkspaceEdit`s" - }, - { - "name": "resourceOperations", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "ResourceOperationKind" - } - }, - "optional": true, - "documentation": "The resource operations the client supports. Clients should at least\nsupport 'create', 'rename' and 'delete' files and folders.\n\n@since 3.13.0", - "since": "3.13.0" - }, - { - "name": "failureHandling", - "type": { - "kind": "reference", - "name": "FailureHandlingKind" - }, - "optional": true, - "documentation": "The failure handling strategy of a client if applying the workspace edit\nfails.\n\n@since 3.13.0", - "since": "3.13.0" - }, - { - "name": "normalizesLineEndings", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client normalizes line endings to the client specific\nsetting.\nIf set to `true` the client will normalize line ending characters\nin a workspace edit to the client-specified new line\ncharacter.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "changeAnnotationSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "groupsOnLabel", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client groups edits with equal labels into tree nodes,\nfor instance all edits labelled with \"Changes in Strings\" would\nbe a tree node." - } - ] - } - }, - "optional": true, - "documentation": "Whether the client in general supports change annotations on text edits,\ncreate file, rename file and delete file changes.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - }, - { - "name": "DidChangeConfigurationClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Did change configuration notification supports dynamic registration." - } - ] - }, - { - "name": "DidChangeWatchedFilesClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Did change watched files notification supports dynamic registration. Please note\nthat the current protocol doesn't support static configuration for file changes\nfrom the server side." - }, - { - "name": "relativePatternSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client has support for {@link RelativePattern relative pattern}\nor not.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - }, - { - "name": "WorkspaceSymbolClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Symbol request supports dynamic registration." - }, - { - "name": "symbolKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolKind" - } - }, - "optional": true, - "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." - } - ] - } - }, - "optional": true, - "documentation": "Specific capabilities for the `SymbolKind` in the `workspace/symbol` request." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "The client supports tags on `SymbolInformation`.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "resolveSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily. Usually\n`location.range`" - } - ] - } - }, - "optional": true, - "documentation": "The client support partial workspace symbols. The client will send the\nrequest `workspaceSymbol/resolve` to the server to resolve additional\nproperties.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Client capabilities for a [WorkspaceSymbolRequest](#WorkspaceSymbolRequest)." - }, - { - "name": "ExecuteCommandClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Execute command supports dynamic registration." - } - ], - "documentation": "The client capabilities of a [ExecuteCommandRequest](#ExecuteCommandRequest)." - }, - { - "name": "SemanticTokensWorkspaceClientCapabilities", - "properties": [ - { - "name": "refreshSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\nsemantic tokens currently shown. It should be used with absolute care\nand is useful for situation where a server for example detects a project\nwide change that requires such a calculation." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "CodeLensWorkspaceClientCapabilities", - "properties": [ - { - "name": "refreshSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ncode lenses currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detect a project wide\nchange that requires such a calculation." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "FileOperationClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports dynamic registration for file requests/notifications." - }, - { - "name": "didCreate", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending didCreateFiles notifications." - }, - { - "name": "willCreate", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending willCreateFiles requests." - }, - { - "name": "didRename", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending didRenameFiles notifications." - }, - { - "name": "willRename", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending willRenameFiles requests." - }, - { - "name": "didDelete", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending didDeleteFiles notifications." - }, - { - "name": "willDelete", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for sending willDeleteFiles requests." - } - ], - "documentation": "Capabilities relating to events from file operations by the user in the client.\n\nThese events do not come from the file system, they come from user operations\nlike renaming a file in the UI.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "InlineValueWorkspaceClientCapabilities", - "properties": [ - { - "name": "refreshSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from the\nserver to the client.\n\nNote that this event is global and will force the client to refresh all\ninline values currently shown. It should be used with absolute care and is\nuseful for situation where a server for example detects a project wide\nchange that requires such a calculation." - } - ], - "documentation": "Client workspace capabilities specific to inline values.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHintWorkspaceClientCapabilities", - "properties": [ - { - "name": "refreshSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\ninlay hints currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." - } - ], - "documentation": "Client workspace capabilities specific to inlay hints.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DiagnosticWorkspaceClientCapabilities", - "properties": [ - { - "name": "refreshSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client implementation supports a refresh request sent from\nthe server to the client.\n\nNote that this event is global and will force the client to refresh all\npulled diagnostics currently shown. It should be used with absolute care and\nis useful for situation where a server for example detects a project wide\nchange that requires such a calculation." - } - ], - "documentation": "Workspace client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TextDocumentSyncClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether text document synchronization supports dynamic registration." - }, - { - "name": "willSave", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports sending will save notifications." - }, - { - "name": "willSaveWaitUntil", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports sending a will save request and\nwaits for a response providing text edits which will\nbe applied to the document before it is saved." - }, - { - "name": "didSave", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports did save notifications." - } - ] - }, - { - "name": "CompletionClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether completion supports dynamic registration." - }, - { - "name": "completionItem", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "snippetSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports snippets as insert text.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too." - }, - { - "name": "commitCharactersSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports commit characters on a completion item." - }, - { - "name": "documentationFormat", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } - }, - "optional": true, - "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." - }, - { - "name": "deprecatedSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports the deprecated property on a completion item." - }, - { - "name": "preselectSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports the preselect property on a completion item." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItemTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "Client supports the tag property on a completion item. Clients supporting\ntags have to handle unknown tags gracefully. Clients especially need to\npreserve unknown tags when sending a completion item back to the server in\na resolve call.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "insertReplaceSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client support insert replace edit to control different behavior if a\ncompletion item is inserted in the text or should replace text.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "resolveSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } - }, - "optional": true, - "documentation": "Indicates which properties a client can resolve lazily on a completion\nitem. Before version 3.16.0 only the predefined properties `documentation`\nand `details` could be resolved lazily.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "insertTextModeSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "InsertTextMode" - } - } - } - ] - } - }, - "optional": true, - "documentation": "The client supports the `insertTextMode` property on\na completion item to override the whitespace handling mode\nas defined by the client (see `insertTextMode`).\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "labelDetailsSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client has support for completion item label\ndetails (see also `CompletionItemLabelDetails`).\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } - }, - "optional": true, - "documentation": "The client supports the following `CompletionItem` specific\ncapabilities." - }, - { - "name": "completionItemKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CompletionItemKind" - } - }, - "optional": true, - "documentation": "The completion item kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe completion items kinds from `Text` to `Reference` as defined in\nthe initial version of the protocol." - } - ] - } - }, - "optional": true - }, - { - "name": "insertTextMode", - "type": { - "kind": "reference", - "name": "InsertTextMode" - }, - "optional": true, - "documentation": "Defines how the client handles whitespace and indentation\nwhen accepting a completion item that uses multi line\ntext in either `insertText` or `textEdit`.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "contextSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports to send additional context information for a\n`textDocument/completion` request." - }, - { - "name": "completionList", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "itemDefaults", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "The client supports the following itemDefaults on\na completion list.\n\nThe value lists the supported property names of the\n`CompletionList.itemDefaults` object. If omitted\nno properties are supported.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } - }, - "optional": true, - "documentation": "The client supports the following `CompletionList` specific\ncapabilities.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Completion client capabilities" - }, - { - "name": "HoverClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether hover supports dynamic registration." - }, - { - "name": "contentFormat", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } - }, - "optional": true, - "documentation": "Client supports the following content formats for the content\nproperty. The order describes the preferred format of the client." - } - ] - }, - { - "name": "SignatureHelpClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether signature help supports dynamic registration." - }, - { - "name": "signatureInformation", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "documentationFormat", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "MarkupKind" - } - }, - "optional": true, - "documentation": "Client supports the following content formats for the documentation\nproperty. The order describes the preferred format of the client." - }, - { - "name": "parameterInformation", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "labelOffsetSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports processing label offsets instead of a\nsimple label string.\n\n@since 3.14.0", - "since": "3.14.0" - } - ] - } - }, - "optional": true, - "documentation": "Client capabilities specific to parameter information." - }, - { - "name": "activeParameterSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports the `activeParameter` property on `SignatureInformation`\nliteral.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - } - }, - "optional": true, - "documentation": "The client supports the following `SignatureInformation`\nspecific properties." - }, - { - "name": "contextSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports to send additional context information for a\n`textDocument/signatureHelp` request. A client that opts into\ncontextSupport will also support the `retriggerCharacters` on\n`SignatureHelpOptions`.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "documentation": "Client Capabilities for a [SignatureHelpRequest](#SignatureHelpRequest)." - }, - { - "name": "DeclarationClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether declaration supports dynamic registration. If this is set to `true`\nthe client supports the new `DeclarationRegistrationOptions` return value\nfor the corresponding server capability as well." - }, - { - "name": "linkSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports additional metadata in the form of declaration links." - } - ], - "documentation": "@since 3.14.0", - "since": "3.14.0" - }, - { - "name": "DefinitionClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether definition supports dynamic registration." - }, - { - "name": "linkSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", - "since": "3.14.0" - } - ], - "documentation": "Client Capabilities for a [DefinitionRequest](#DefinitionRequest)." - }, - { - "name": "TypeDefinitionClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `TypeDefinitionRegistrationOptions` return value\nfor the corresponding server capability as well." - }, - { - "name": "linkSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\nSince 3.14.0" - } - ], - "documentation": "Since 3.6.0" - }, - { - "name": "ImplementationClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `ImplementationRegistrationOptions` return value\nfor the corresponding server capability as well." - }, - { - "name": "linkSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports additional metadata in the form of definition links.\n\n@since 3.14.0", - "since": "3.14.0" - } - ], - "documentation": "@since 3.6.0", - "since": "3.6.0" - }, - { - "name": "ReferenceClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether references supports dynamic registration." - } - ], - "documentation": "Client Capabilities for a [ReferencesRequest](#ReferencesRequest)." - }, - { - "name": "DocumentHighlightClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether document highlight supports dynamic registration." - } - ], - "documentation": "Client Capabilities for a [DocumentHighlightRequest](#DocumentHighlightRequest)." - }, - { - "name": "DocumentSymbolClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether document symbol supports dynamic registration." - }, - { - "name": "symbolKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolKind" - } - }, - "optional": true, - "documentation": "The symbol kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown.\n\nIf this property is not present the client only supports\nthe symbol kinds from `File` to `Array` as defined in\nthe initial version of the protocol." - } - ] - } - }, - "optional": true, - "documentation": "Specific capabilities for the `SymbolKind` in the\n`textDocument/documentSymbol` request." - }, - { - "name": "hierarchicalDocumentSymbolSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports hierarchical document symbols." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "SymbolTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "The client supports tags on `SymbolInformation`. Tags are supported on\n`DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "labelSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports an additional label presented in the UI when\nregistering a document symbol provider.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "Client Capabilities for a [DocumentSymbolRequest](#DocumentSymbolRequest)." - }, - { - "name": "CodeActionClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports dynamic registration." - }, - { - "name": "codeActionLiteralSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "codeActionKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "CodeActionKind" - } - }, - "documentation": "The code action kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." - } - ] - } - }, - "documentation": "The code action kind is support with the following value\nset." - } - ] - } - }, - "optional": true, - "documentation": "The client support code action literals of type `CodeAction` as a valid\nresponse of the `textDocument/codeAction` request. If the property is not\nset the request can only return `Command` literals.\n\n@since 3.8.0", - "since": "3.8.0" - }, - { - "name": "isPreferredSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports the `isPreferred` property.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "disabledSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports the `disabled` property.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "dataSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/codeAction` and a\n`codeAction/resolve` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "resolveSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } - }, - "optional": true, - "documentation": "Whether the client supports resolving additional code action\nproperties via a separate `codeAction/resolve` request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "honorsChangeAnnotations", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\n`CodeAction#edit` property by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "The Client Capabilities of a [CodeActionRequest](#CodeActionRequest)." - }, - { - "name": "CodeLensClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code lens supports dynamic registration." - } - ], - "documentation": "The client capabilities of a [CodeLensRequest](#CodeLensRequest)." - }, - { - "name": "DocumentLinkClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether document link supports dynamic registration." - }, - { - "name": "tooltipSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports the `tooltip` property on `DocumentLink`.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "documentation": "The client capabilities of a [DocumentLinkRequest](#DocumentLinkRequest)." - }, - { - "name": "DocumentColorClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `DocumentColorRegistrationOptions` return value\nfor the corresponding server capability as well." - } - ] - }, - { - "name": "DocumentFormattingClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether formatting supports dynamic registration." - } - ], - "documentation": "Client capabilities of a [DocumentFormattingRequest](#DocumentFormattingRequest)." - }, - { - "name": "DocumentRangeFormattingClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether range formatting supports dynamic registration." - } - ], - "documentation": "Client capabilities of a [DocumentRangeFormattingRequest](#DocumentRangeFormattingRequest)." - }, - { - "name": "DocumentOnTypeFormattingClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether on type formatting supports dynamic registration." - } - ], - "documentation": "Client capabilities of a [DocumentOnTypeFormattingRequest](#DocumentOnTypeFormattingRequest)." - }, - { - "name": "RenameClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether rename supports dynamic registration." - }, - { - "name": "prepareSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports testing for validity of rename operations\nbefore execution.\n\n@since 3.12.0", - "since": "3.12.0" - }, - { - "name": "prepareSupportDefaultBehavior", - "type": { - "kind": "reference", - "name": "PrepareSupportDefaultBehavior" - }, - "optional": true, - "documentation": "Client supports the default behavior result.\n\nThe value indicates the default behavior used by the\nclient.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "honorsChangeAnnotations", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client honors the change annotations in\ntext edits and resource operations returned via the\nrename request's workspace edit by for example presenting\nthe workspace edit in the user interface and asking\nfor confirmation.\n\n@since 3.16.0", - "since": "3.16.0" - } - ] - }, - { - "name": "FoldingRangeClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration for folding range\nproviders. If this is set to `true` the client supports the new\n`FoldingRangeRegistrationOptions` return value for the corresponding\nserver capability as well." - }, - { - "name": "rangeLimit", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The maximum number of folding ranges that the client prefers to receive\nper document. The value serves as a hint, servers are free to follow the\nlimit." - }, - { - "name": "lineFoldingOnly", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "If set, the client signals that it only supports folding complete lines.\nIf set, client will ignore specified `startCharacter` and `endCharacter`\nproperties in a FoldingRange." - }, - { - "name": "foldingRangeKind", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "FoldingRangeKind" - } - }, - "optional": true, - "documentation": "The folding range kind values the client supports. When this\nproperty exists the client also guarantees that it will\nhandle values outside its set gracefully and falls back\nto a default value when unknown." - } - ] - } - }, - "optional": true, - "documentation": "Specific options for the folding range kind.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "foldingRange", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "collapsedText", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "If set, the client signals that it supports setting collapsedText on\nfolding ranges to display custom labels instead of the default text.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - } - }, - "optional": true, - "documentation": "Specific options for the folding range.\n\n@since 3.17.0", - "since": "3.17.0" - } - ] - }, - { - "name": "SelectionRangeClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration for selection range providers. If this is set to `true`\nthe client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server\ncapability as well." - } - ] - }, - { - "name": "PublishDiagnosticsClientCapabilities", - "properties": [ - { - "name": "relatedInformation", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the clients accepts diagnostics with related information." - }, - { - "name": "tagSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "valueSet", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DiagnosticTag" - } - }, - "documentation": "The tags supported by the client." - } - ] - } - }, - "optional": true, - "documentation": "Client supports the tag property to provide meta data about a diagnostic.\nClients supporting tags have to handle unknown tags gracefully.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "versionSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client interprets the version property of the\n`textDocument/publishDiagnostics` notification's parameter.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "codeDescriptionSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Client supports a codeDescription property\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "dataSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether code action supports the `data` property which is\npreserved between a `textDocument/publishDiagnostics` and\n`textDocument/codeAction` request.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "documentation": "The publish diagnostic client capabilities." - }, - { - "name": "CallHierarchyClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokensClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - }, - { - "name": "requests", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [] - } - } - ] - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/range` request if\nthe server provides a corresponding handler." - }, - { - "name": "full", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "delta", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/full/delta` request if\nthe server provides a corresponding handler." - } - ] - } - } - ] - }, - "optional": true, - "documentation": "The client will send the `textDocument/semanticTokens/full` request if\nthe server provides a corresponding handler." - } - ] - } - }, - "documentation": "Which requests the client supports and might send to the server\ndepending on the server's capability. Please note that clients might not\nshow semantic tokens or degrade some of the user experience if a range\nor full request is advertised by the client but not provided by the\nserver. If for example the client capability `requests.full` and\n`request.range` are both set to true but the server only provides a\nrange provider the client might not render a minimap correctly or might\neven decide to not show any semantic tokens at all." - }, - { - "name": "tokenTypes", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The token types that the client supports." - }, - { - "name": "tokenModifiers", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The token modifiers that the client supports." - }, - { - "name": "formats", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "TokenFormat" - } - }, - "documentation": "The token formats the clients supports." - }, - { - "name": "overlappingTokenSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports tokens that can overlap each other." - }, - { - "name": "multilineTokenSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports tokens that can span multiple lines." - }, - { - "name": "serverCancelSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client allows the server to actively cancel a\nsemantic token request, e.g. supports returning\nLSPErrorCodes.ServerCancelled. If a server does the client\nneeds to retrigger the request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "augmentsSyntaxTokens", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client uses semantic tokens to augment existing\nsyntax tokens. If set to `true` client side created syntax\ntokens and semantic tokens are both used for colorization. If\nset to `false` the client only uses the returned semantic tokens\nfor colorization.\n\nIf the value is `undefined` then the client behavior is not\nspecified.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "LinkedEditingRangeClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - } - ], - "documentation": "Client capabilities for the linked editing range request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MonikerClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether moniker supports dynamic registration. If this is set to `true`\nthe client supports the new `MonikerRegistrationOptions` return value\nfor the corresponding server capability as well." - } - ], - "documentation": "Client capabilities specific to the moniker request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "TypeHierarchyClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - } - ], - "documentation": "@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlineValueClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration for inline value providers." - } - ], - "documentation": "Client capabilities specific to inline values.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "InlayHintClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether inlay hints support dynamic registration." - }, - { - "name": "resolveSupport", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "properties", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "documentation": "The properties that a client can resolve lazily." - } - ] - } - }, - "optional": true, - "documentation": "Indicates which properties a client can resolve lazily on an inlay\nhint." - } - ], - "documentation": "Inlay hint client capabilities.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DiagnosticClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is set to `true`\nthe client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - }, - { - "name": "relatedDocumentSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the clients supports related documents for document diagnostic pulls." - } - ], - "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentSyncClientCapabilities", - "properties": [ - { - "name": "dynamicRegistration", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether implementation supports dynamic registration. If this is\nset to `true` the client supports the new\n`(TextDocumentRegistrationOptions & StaticRegistrationOptions)`\nreturn value for the corresponding server capability as well." - }, - { - "name": "executionSummarySupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "The client supports sending execution summary data per cell." - } - ], - "documentation": "Notebook specific client capabilities.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ShowMessageRequestClientCapabilities", - "properties": [ - { - "name": "messageActionItem", - "type": { - "kind": "literal", - "value": { - "properties": [ - { - "name": "additionalPropertiesSupport", - "type": { - "kind": "base", - "name": "boolean" - }, - "optional": true, - "documentation": "Whether the client supports additional attributes which\nare preserved and send back to the server in the\nrequest's response." - } - ] - } - }, - "optional": true, - "documentation": "Capabilities specific to the `MessageActionItem` type." - } - ], - "documentation": "Show message request client capabilities" - }, - { - "name": "ShowDocumentClientCapabilities", - "properties": [ - { - "name": "support", - "type": { - "kind": "base", - "name": "boolean" - }, - "documentation": "The client has support for the showDocument\nrequest." - } - ], - "documentation": "Client capabilities for the showDocument request.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "RegularExpressionsClientCapabilities", - "properties": [ - { - "name": "engine", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The engine's name." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The engine's version." - } - ], - "documentation": "Client capabilities specific to regular expressions.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MarkdownClientCapabilities", - "properties": [ - { - "name": "parser", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The name of the parser." - }, - { - "name": "version", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The version of the parser." - }, - { - "name": "allowedTags", - "type": { - "kind": "array", - "element": { - "kind": "base", - "name": "string" - } - }, - "optional": true, - "documentation": "A list of HTML tags that the client allows / supports in\nMarkdown.\n\n@since 3.17.0", - "since": "3.17.0" - } - ], - "documentation": "Client capabilities specific to the used markdown parser.\n\n@since 3.16.0", - "since": "3.16.0" - } - ], - "enumerations": [ - { - "name": "SemanticTokenTypes", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "namespace", - "value": "namespace" - }, - { - "name": "type", - "value": "type", - "documentation": "Represents a generic type. Acts as a fallback for types which can't be mapped to\na specific type like class or enum." - }, - { - "name": "class", - "value": "class" - }, - { - "name": "enum", - "value": "enum" - }, - { - "name": "interface", - "value": "interface" - }, - { - "name": "struct", - "value": "struct" - }, - { - "name": "typeParameter", - "value": "typeParameter" - }, - { - "name": "parameter", - "value": "parameter" - }, - { - "name": "variable", - "value": "variable" - }, - { - "name": "property", - "value": "property" - }, - { - "name": "enumMember", - "value": "enumMember" - }, - { - "name": "event", - "value": "event" - }, - { - "name": "function", - "value": "function" - }, - { - "name": "method", - "value": "method" - }, - { - "name": "macro", - "value": "macro" - }, - { - "name": "keyword", - "value": "keyword" - }, - { - "name": "modifier", - "value": "modifier" - }, - { - "name": "comment", - "value": "comment" - }, - { - "name": "string", - "value": "string" - }, - { - "name": "number", - "value": "number" - }, - { - "name": "regexp", - "value": "regexp" - }, - { - "name": "operator", - "value": "operator" - }, - { - "name": "decorator", - "value": "decorator", - "documentation": "@since 3.17.0", - "since": "3.17.0" - } - ], - "supportsCustomValues": true, - "documentation": "A set of predefined token types. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "SemanticTokenModifiers", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "declaration", - "value": "declaration" - }, - { - "name": "definition", - "value": "definition" - }, - { - "name": "readonly", - "value": "readonly" - }, - { - "name": "static", - "value": "static" - }, - { - "name": "deprecated", - "value": "deprecated" - }, - { - "name": "abstract", - "value": "abstract" - }, - { - "name": "async", - "value": "async" - }, - { - "name": "modification", - "value": "modification" - }, - { - "name": "documentation", - "value": "documentation" - }, - { - "name": "defaultLibrary", - "value": "defaultLibrary" - } - ], - "supportsCustomValues": true, - "documentation": "A set of predefined token modifiers. This set is not fixed\nan clients can specify additional token types via the\ncorresponding client capabilities.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "DocumentDiagnosticReportKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Full", - "value": "full", - "documentation": "A diagnostic report with a full\nset of problems." - }, - { - "name": "Unchanged", - "value": "unchanged", - "documentation": "A report indicating that the last\nreturned report is still accurate." - } - ], - "documentation": "The document diagnostic report kinds.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ErrorCodes", - "type": { - "kind": "base", - "name": "integer" - }, - "values": [ - { - "name": "ParseError", - "value": -32700 - }, - { - "name": "InvalidRequest", - "value": -32600 - }, - { - "name": "MethodNotFound", - "value": -32601 - }, - { - "name": "InvalidParams", - "value": -32602 - }, - { - "name": "InternalError", - "value": -32603 - }, - { - "name": "ServerNotInitialized", - "value": -32002, - "documentation": "Error code indicating that a server received a notification or\nrequest before the server has received the `initialize` request." - }, - { - "name": "UnknownErrorCode", - "value": -32001 - } - ], - "supportsCustomValues": true, - "documentation": "Predefined error codes." - }, - { - "name": "LSPErrorCodes", - "type": { - "kind": "base", - "name": "integer" - }, - "values": [ - { - "name": "RequestFailed", - "value": -32803, - "documentation": "A request failed but it was syntactically correct, e.g the\nmethod name was known and the parameters were valid. The error\nmessage should contain human readable information about why\nthe request failed.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ServerCancelled", - "value": -32802, - "documentation": "The server cancelled the request. This error code should\nonly be used for requests that explicitly support being\nserver cancellable.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ContentModified", - "value": -32801, - "documentation": "The server detected that the content of a document got\nmodified outside normal conditions. A server should\nNOT send this error code if it detects a content change\nin it unprocessed messages. The result even computed\non an older state might still be useful for the client.\n\nIf a client decides that a result is not of any use anymore\nthe client should cancel the request." - }, - { - "name": "RequestCancelled", - "value": -32800, - "documentation": "The client has canceled a request and a server as detected\nthe cancel." - } - ], - "supportsCustomValues": true - }, - { - "name": "FoldingRangeKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Comment", - "value": "comment", - "documentation": "Folding range for a comment" - }, - { - "name": "Imports", - "value": "imports", - "documentation": "Folding range for an import or include" - }, - { - "name": "Region", - "value": "region", - "documentation": "Folding range for a region (e.g. `#region`)" - } - ], - "supportsCustomValues": true, - "documentation": "A set of predefined range kinds." - }, - { - "name": "SymbolKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "File", - "value": 1 - }, - { - "name": "Module", - "value": 2 - }, - { - "name": "Namespace", - "value": 3 - }, - { - "name": "Package", - "value": 4 - }, - { - "name": "Class", - "value": 5 - }, - { - "name": "Method", - "value": 6 - }, - { - "name": "Property", - "value": 7 - }, - { - "name": "Field", - "value": 8 - }, - { - "name": "Constructor", - "value": 9 - }, - { - "name": "Enum", - "value": 10 - }, - { - "name": "Interface", - "value": 11 - }, - { - "name": "Function", - "value": 12 - }, - { - "name": "Variable", - "value": 13 - }, - { - "name": "Constant", - "value": 14 - }, - { - "name": "String", - "value": 15 - }, - { - "name": "Number", - "value": 16 - }, - { - "name": "Boolean", - "value": 17 - }, - { - "name": "Array", - "value": 18 - }, - { - "name": "Object", - "value": 19 - }, - { - "name": "Key", - "value": 20 - }, - { - "name": "Null", - "value": 21 - }, - { - "name": "EnumMember", - "value": 22 - }, - { - "name": "Struct", - "value": 23 - }, - { - "name": "Event", - "value": 24 - }, - { - "name": "Operator", - "value": 25 - }, - { - "name": "TypeParameter", - "value": 26 - } - ], - "documentation": "A symbol kind." - }, - { - "name": "SymbolTag", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Deprecated", - "value": 1, - "documentation": "Render a symbol as obsolete, usually using a strike-out." - } - ], - "documentation": "Symbol tags are extra annotations that tweak the rendering of a symbol.\n\n@since 3.16", - "since": "3.16" - }, - { - "name": "UniquenessLevel", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "document", - "value": "document", - "documentation": "The moniker is only unique inside a document" - }, - { - "name": "project", - "value": "project", - "documentation": "The moniker is unique inside a project for which a dump got created" - }, - { - "name": "group", - "value": "group", - "documentation": "The moniker is unique inside the group to which a project belongs" - }, - { - "name": "scheme", - "value": "scheme", - "documentation": "The moniker is unique inside the moniker scheme." - }, - { - "name": "global", - "value": "global", - "documentation": "The moniker is globally unique" - } - ], - "documentation": "Moniker uniqueness level to define scope of the moniker.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "MonikerKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "import", - "value": "import", - "documentation": "The moniker represent a symbol that is imported into a project" - }, - { - "name": "export", - "value": "export", - "documentation": "The moniker represents a symbol that is exported from a project" - }, - { - "name": "local", - "value": "local", - "documentation": "The moniker represents a symbol that is local to a project (e.g. a local\nvariable of a function, a class not visible outside the project, ...)" - } - ], - "documentation": "The moniker kind.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "InlayHintKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Type", - "value": 1, - "documentation": "An inlay hint that for a type annotation." - }, - { - "name": "Parameter", - "value": 2, - "documentation": "An inlay hint that is for a parameter." - } - ], - "documentation": "Inlay hint kinds.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "MessageType", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Error", - "value": 1, - "documentation": "An error message." - }, - { - "name": "Warning", - "value": 2, - "documentation": "A warning message." - }, - { - "name": "Info", - "value": 3, - "documentation": "An information message." - }, - { - "name": "Log", - "value": 4, - "documentation": "A log message." - } - ], - "documentation": "The message type" - }, - { - "name": "TextDocumentSyncKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "None", - "value": 0, - "documentation": "Documents should not be synced at all." - }, - { - "name": "Full", - "value": 1, - "documentation": "Documents are synced by always sending the full content\nof the document." - }, - { - "name": "Incremental", - "value": 2, - "documentation": "Documents are synced by sending the full content on open.\nAfter that only incremental updates to the document are\nsend." - } - ], - "documentation": "Defines how the host (editor) should sync\ndocument changes to the language server." - }, - { - "name": "TextDocumentSaveReason", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Manual", - "value": 1, - "documentation": "Manually triggered, e.g. by the user pressing save, by starting debugging,\nor by an API call." - }, - { - "name": "AfterDelay", - "value": 2, - "documentation": "Automatic after a delay." - }, - { - "name": "FocusOut", - "value": 3, - "documentation": "When the editor lost focus." - } - ], - "documentation": "Represents reasons why a text document is saved." - }, - { - "name": "CompletionItemKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Text", - "value": 1 - }, - { - "name": "Method", - "value": 2 - }, - { - "name": "Function", - "value": 3 - }, - { - "name": "Constructor", - "value": 4 - }, - { - "name": "Field", - "value": 5 - }, - { - "name": "Variable", - "value": 6 - }, - { - "name": "Class", - "value": 7 - }, - { - "name": "Interface", - "value": 8 - }, - { - "name": "Module", - "value": 9 - }, - { - "name": "Property", - "value": 10 - }, - { - "name": "Unit", - "value": 11 - }, - { - "name": "Value", - "value": 12 - }, - { - "name": "Enum", - "value": 13 - }, - { - "name": "Keyword", - "value": 14 - }, - { - "name": "Snippet", - "value": 15 - }, - { - "name": "Color", - "value": 16 - }, - { - "name": "File", - "value": 17 - }, - { - "name": "Reference", - "value": 18 - }, - { - "name": "Folder", - "value": 19 - }, - { - "name": "EnumMember", - "value": 20 - }, - { - "name": "Constant", - "value": 21 - }, - { - "name": "Struct", - "value": 22 - }, - { - "name": "Event", - "value": 23 - }, - { - "name": "Operator", - "value": 24 - }, - { - "name": "TypeParameter", - "value": 25 - } - ], - "documentation": "The kind of a completion entry." - }, - { - "name": "CompletionItemTag", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Deprecated", - "value": 1, - "documentation": "Render a completion as obsolete, usually using a strike-out." - } - ], - "documentation": "Completion item tags are extra annotations that tweak the rendering of a completion\nitem.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "InsertTextFormat", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "PlainText", - "value": 1, - "documentation": "The primary text to be inserted is treated as a plain string." - }, - { - "name": "Snippet", - "value": 2, - "documentation": "The primary text to be inserted is treated as a snippet.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Placeholders with equal identifiers are linked,\nthat is typing in one will update others too.\n\nSee also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax" - } - ], - "documentation": "Defines whether the insert text in a completion item should be interpreted as\nplain text or a snippet." - }, - { - "name": "InsertTextMode", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "asIs", - "value": 1, - "documentation": "The insertion or replace strings is taken as it is. If the\nvalue is multi line the lines below the cursor will be\ninserted using the indentation defined in the string value.\nThe client will not apply any kind of adjustments to the\nstring." - }, - { - "name": "adjustIndentation", - "value": 2, - "documentation": "The editor adjusts leading whitespace of new lines so that\nthey match the indentation up to the cursor of the line for\nwhich the item is accepted.\n\nConsider a line like this: <2tabs><3tabs>foo. Accepting a\nmulti line completion item is indented using 2 tabs and all\nfollowing lines inserted will be indented using 2 tabs as well." - } - ], - "documentation": "How whitespace and indentation is handled during completion\nitem insertion.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "DocumentHighlightKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Text", - "value": 1, - "documentation": "A textual occurrence." - }, - { - "name": "Read", - "value": 2, - "documentation": "Read-access of a symbol, like reading a variable." - }, - { - "name": "Write", - "value": 3, - "documentation": "Write-access of a symbol, like writing to a variable." - } - ], - "documentation": "A document highlight kind." - }, - { - "name": "CodeActionKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Empty", - "value": "", - "documentation": "Empty kind." - }, - { - "name": "QuickFix", - "value": "quickfix", - "documentation": "Base kind for quickfix actions: 'quickfix'" - }, - { - "name": "Refactor", - "value": "refactor", - "documentation": "Base kind for refactoring actions: 'refactor'" - }, - { - "name": "RefactorExtract", - "value": "refactor.extract", - "documentation": "Base kind for refactoring extraction actions: 'refactor.extract'\n\nExample extract actions:\n\n- Extract method\n- Extract function\n- Extract variable\n- Extract interface from class\n- ..." - }, - { - "name": "RefactorInline", - "value": "refactor.inline", - "documentation": "Base kind for refactoring inline actions: 'refactor.inline'\n\nExample inline actions:\n\n- Inline function\n- Inline variable\n- Inline constant\n- ..." - }, - { - "name": "RefactorRewrite", - "value": "refactor.rewrite", - "documentation": "Base kind for refactoring rewrite actions: 'refactor.rewrite'\n\nExample rewrite actions:\n\n- Convert JavaScript function to class\n- Add or remove parameter\n- Encapsulate field\n- Make method static\n- Move method to base class\n- ..." - }, - { - "name": "Source", - "value": "source", - "documentation": "Base kind for source actions: `source`\n\nSource code actions apply to the entire file." - }, - { - "name": "SourceOrganizeImports", - "value": "source.organizeImports", - "documentation": "Base kind for an organize imports source action: `source.organizeImports`" - }, - { - "name": "SourceFixAll", - "value": "source.fixAll", - "documentation": "Base kind for auto-fix source actions: `source.fixAll`.\n\nFix all actions automatically fix errors that have a clear fix that do not require user input.\nThey should not suppress errors or perform unsafe fixes such as generating new types or classes.\n\n@since 3.15.0", - "since": "3.15.0" - } - ], - "supportsCustomValues": true, - "documentation": "A set of predefined code action kinds" - }, - { - "name": "TraceValues", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Off", - "value": "off", - "documentation": "Turn tracing off." - }, - { - "name": "Messages", - "value": "messages", - "documentation": "Trace messages only." - }, - { - "name": "Verbose", - "value": "verbose", - "documentation": "Verbose message tracing." - } - ] - }, - { - "name": "MarkupKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "PlainText", - "value": "plaintext", - "documentation": "Plain text is supported as a content format" - }, - { - "name": "Markdown", - "value": "markdown", - "documentation": "Markdown is supported as a content format" - } - ], - "documentation": "Describes the content type that a client supports in various\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\nare reserved for internal usage." - }, - { - "name": "PositionEncodingKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "UTF8", - "value": "utf-8", - "documentation": "Character offsets count UTF-8 code units." - }, - { - "name": "UTF16", - "value": "utf-16", - "documentation": "Character offsets count UTF-16 code units.\n\nThis is the default and must always be supported\nby servers" - }, - { - "name": "UTF32", - "value": "utf-32", - "documentation": "Character offsets count UTF-32 code units.\n\nImplementation note: these are the same as Unicode code points,\nso this `PositionEncodingKind` may also be used for an\nencoding-agnostic representation of character offsets." - } - ], - "supportsCustomValues": true, - "documentation": "A set of predefined position encoding kinds.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "FileChangeType", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Created", - "value": 1, - "documentation": "The file got created." - }, - { - "name": "Changed", - "value": 2, - "documentation": "The file got changed." - }, - { - "name": "Deleted", - "value": 3, - "documentation": "The file got deleted." - } - ], - "documentation": "The file event type" - }, - { - "name": "WatchKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Create", - "value": 1, - "documentation": "Interested in create events." - }, - { - "name": "Change", - "value": 2, - "documentation": "Interested in change events" - }, - { - "name": "Delete", - "value": 4, - "documentation": "Interested in delete events" - } - ], - "supportsCustomValues": true - }, - { - "name": "DiagnosticSeverity", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Error", - "value": 1, - "documentation": "Reports an error." - }, - { - "name": "Warning", - "value": 2, - "documentation": "Reports a warning." - }, - { - "name": "Information", - "value": 3, - "documentation": "Reports an information." - }, - { - "name": "Hint", - "value": 4, - "documentation": "Reports a hint." - } - ], - "documentation": "The diagnostic's severity." - }, - { - "name": "DiagnosticTag", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Unnecessary", - "value": 1, - "documentation": "Unused or unnecessary code.\n\nClients are allowed to render diagnostics with this tag faded out instead of having\nan error squiggle." - }, - { - "name": "Deprecated", - "value": 2, - "documentation": "Deprecated or obsolete code.\n\nClients are allowed to rendered diagnostics with this tag strike through." - } - ], - "documentation": "The diagnostic tags.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "CompletionTriggerKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Invoked", - "value": 1, - "documentation": "Completion was triggered by typing an identifier (24x7 code\ncomplete), manual invocation (e.g Ctrl+Space) or via API." - }, - { - "name": "TriggerCharacter", - "value": 2, - "documentation": "Completion was triggered by a trigger character specified by\nthe `triggerCharacters` properties of the `CompletionRegistrationOptions`." - }, - { - "name": "TriggerForIncompleteCompletions", - "value": 3, - "documentation": "Completion was re-triggered as current completion list is incomplete" - } - ], - "documentation": "How a completion was triggered" - }, - { - "name": "SignatureHelpTriggerKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Invoked", - "value": 1, - "documentation": "Signature help was invoked manually by the user or by a command." - }, - { - "name": "TriggerCharacter", - "value": 2, - "documentation": "Signature help was triggered by a trigger character." - }, - { - "name": "ContentChange", - "value": 3, - "documentation": "Signature help was triggered by the cursor moving or by the document content changing." - } - ], - "documentation": "How a signature help was triggered.\n\n@since 3.15.0", - "since": "3.15.0" - }, - { - "name": "CodeActionTriggerKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Invoked", - "value": 1, - "documentation": "Code actions were explicitly requested by the user or by an extension." - }, - { - "name": "Automatic", - "value": 2, - "documentation": "Code actions were requested automatically.\n\nThis typically happens when current selection in a file changes, but can\nalso be triggered when file content changes." - } - ], - "documentation": "The reason why code actions were requested.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "FileOperationPatternKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "file", - "value": "file", - "documentation": "The pattern matches a file only." - }, - { - "name": "folder", - "value": "folder", - "documentation": "The pattern matches a folder only." - } - ], - "documentation": "A pattern kind describing if a glob pattern matches a file a folder or\nboth.\n\n@since 3.16.0", - "since": "3.16.0" - }, - { - "name": "NotebookCellKind", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Markup", - "value": 1, - "documentation": "A markup-cell is formatted source that is used for display." - }, - { - "name": "Code", - "value": 2, - "documentation": "A code-cell is source code." - } - ], - "documentation": "A notebook cell kind.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "ResourceOperationKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Create", - "value": "create", - "documentation": "Supports creating new files and folders." - }, - { - "name": "Rename", - "value": "rename", - "documentation": "Supports renaming existing files and folders." - }, - { - "name": "Delete", - "value": "delete", - "documentation": "Supports deleting existing files and folders." - } - ] - }, - { - "name": "FailureHandlingKind", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Abort", - "value": "abort", - "documentation": "Applying the workspace change is simply aborted if one of the changes provided\nfails. All operations executed before the failing operation stay executed." - }, - { - "name": "Transactional", - "value": "transactional", - "documentation": "All operations are executed transactional. That means they either all\nsucceed or no changes at all are applied to the workspace." - }, - { - "name": "TextOnlyTransactional", - "value": "textOnlyTransactional", - "documentation": "If the workspace edit contains only textual file changes they are executed transactional.\nIf resource changes (create, rename or delete file) are part of the change the failure\nhandling strategy is abort." - }, - { - "name": "Undo", - "value": "undo", - "documentation": "The client tries to undo the operations already executed. But there is no\nguarantee that this is succeeding." - } - ] - }, - { - "name": "PrepareSupportDefaultBehavior", - "type": { - "kind": "base", - "name": "uinteger" - }, - "values": [ - { - "name": "Identifier", - "value": 1, - "documentation": "The client's default behavior is to select the identifier\naccording the to language's syntax rule." - } - ] - }, - { - "name": "TokenFormat", - "type": { - "kind": "base", - "name": "string" - }, - "values": [ - { - "name": "Relative", - "value": "relative" - } - ] - } - ], - "typeAliases": [ - { - "name": "Definition", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Location" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - } - ] - }, - "documentation": "The definition of a symbol represented as one or many [locations](#Location).\nFor most programming languages there is only one location at which a symbol is\ndefined.\n\nServers should prefer returning `DefinitionLink` over `Definition` if supported\nby the client." - }, - { - "name": "DefinitionLink", - "type": { - "kind": "reference", - "name": "LocationLink" - }, - "documentation": "Information about where a symbol is defined.\n\nProvides additional metadata over normal [location](#Location) definitions, including the range of\nthe defining symbol" - }, - { - "name": "LSPArray", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "LSPAny" - } - }, - "documentation": "LSP arrays.\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "LSPAny", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "LSPObject" - }, - { - "kind": "reference", - "name": "LSPArray" - }, - { - "kind": "base", - "name": "string" - }, - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "uinteger" - }, - { - "kind": "base", - "name": "decimal" - }, - { - "kind": "base", - "name": "boolean" - }, - { - "kind": "base", - "name": "null" - } - ] - }, - "documentation": "The LSP any type.\nPlease note that strictly speaking a property with the value `undefined`\ncan't be converted into JSON preserving the property name. However for\nconvenience it is allowed and assumed that all these properties are\noptional as well.\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "Declaration", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Location" - }, - { - "kind": "array", - "element": { - "kind": "reference", - "name": "Location" - } - } - ] - }, - "documentation": "The declaration of a symbol representation as one or many [locations](#Location)." - }, - { - "name": "DeclarationLink", - "type": { - "kind": "reference", - "name": "LocationLink" - }, - "documentation": "Information about where a symbol is declared.\n\nProvides additional metadata over normal [location](#Location) declarations, including the range of\nthe declaring symbol.\n\nServers should prefer returning `DeclarationLink` over `Declaration` if supported\nby the client." - }, - { - "name": "InlineValue", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "InlineValueText" - }, - { - "kind": "reference", - "name": "InlineValueVariableLookup" - }, - { - "kind": "reference", - "name": "InlineValueEvaluatableExpression" - } - ] - }, - "documentation": "Inline value information can be provided by different means:\n- directly as a text value (class InlineValueText).\n- as a name to use for a variable lookup (class InlineValueVariableLookup)\n- as an evaluatable expression (class InlineValueEvaluatableExpression)\nThe InlineValue types combines all inline value types into one type.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "DocumentDiagnosticReport", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "RelatedFullDocumentDiagnosticReport" - }, - { - "kind": "reference", - "name": "RelatedUnchangedDocumentDiagnosticReport" - } - ] - }, - "documentation": "The result of a document diagnostic pull request. A report can\neither be a full report containing all diagnostics for the\nrequested document or an unchanged report indicating that nothing\nhas changed in terms of diagnostics in comparison to the last\npull request.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "PrepareRenameResult", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Range" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - } - }, - { - "name": "placeholder", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "defaultBehavior", - "type": { - "kind": "base", - "name": "boolean" - } - } - ] - } - } - ] - } - }, - { - "name": "ProgressToken", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "integer" - }, - { - "kind": "base", - "name": "string" - } - ] - } - }, - { - "name": "DocumentSelector", - "type": { - "kind": "array", - "element": { - "kind": "reference", - "name": "DocumentFilter" - } - }, - "documentation": "A document selector is the combination of one or many document filters.\n\n@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;\n\nThe use of a string as a document filter is deprecated @since 3.16.0.", - "since": "3.16.0." - }, - { - "name": "ChangeAnnotationIdentifier", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "An identifier to refer to a change annotation stored with a workspace edit." - }, - { - "name": "WorkspaceDocumentDiagnosticReport", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "WorkspaceFullDocumentDiagnosticReport" - }, - { - "kind": "reference", - "name": "WorkspaceUnchangedDocumentDiagnosticReport" - } - ] - }, - "documentation": "A workspace diagnostic document report.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TextDocumentContentChangeEvent", - "type": { - "kind": "or", - "items": [ - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "range", - "type": { - "kind": "reference", - "name": "Range" - }, - "documentation": "The range of the document that changed." - }, - { - "name": "rangeLength", - "type": { - "kind": "base", - "name": "uinteger" - }, - "optional": true, - "documentation": "The optional length of the range that got replaced.\n\n@deprecated use range instead." - }, - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new text for the provided range." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "text", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The new text of the whole document." - } - ] - } - } - ] - }, - "documentation": "An event describing a change to a text document. If only a text is provided\nit is considered to be the full content of the document." - }, - { - "name": "MarkedString", - "type": { - "kind": "or", - "items": [ - { - "kind": "base", - "name": "string" - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - } - }, - { - "name": "value", - "type": { - "kind": "base", - "name": "string" - } - } - ] - } - } - ] - }, - "documentation": "MarkedString can be used to render human readable text. It is either a markdown string\nor a code-block that provides a language and a code snippet. The language identifier\nis semantically equal to the optional language identifier in fenced code blocks in GitHub\nissues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting\n\nThe pair of a language and a value is an equivalent to markdown:\n```${language}\n${value}\n```\n\nNote that markdown strings will be sanitized - that means html will be escaped.\n@deprecated use MarkupContent instead." - }, - { - "name": "DocumentFilter", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "TextDocumentFilter" - }, - { - "kind": "reference", - "name": "NotebookCellTextDocumentFilter" - } - ] - }, - "documentation": "A document filter describes a top level text document or\na notebook cell document.\n\n@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.", - "since": "3.17.0 - proposed support for NotebookCellTextDocumentFilter." - }, - { - "name": "GlobPattern", - "type": { - "kind": "or", - "items": [ - { - "kind": "reference", - "name": "Pattern" - }, - { - "kind": "reference", - "name": "RelativePattern" - } - ] - }, - "documentation": "The glob pattern. Either a string pattern or a relative pattern.\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "TextDocumentFilter", - "type": { - "kind": "or", - "items": [ - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like `*.{ts,js}`." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern, like `*.{ts,js}`." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "language", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A language id, like `typescript`." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern, like `*.{ts,js}`." - } - ] - } - } - ] - }, - "documentation": "A document filter denotes a document by different properties like\nthe [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of\nits resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).\n\nGlob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`\n@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "NotebookDocumentFilter", - "type": { - "kind": "or", - "items": [ - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A glob pattern." - } - ] - } - }, - { - "kind": "literal", - "value": { - "properties": [ - { - "name": "notebookType", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "The type of the enclosing notebook." - }, - { - "name": "scheme", - "type": { - "kind": "base", - "name": "string" - }, - "optional": true, - "documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`." - }, - { - "name": "pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "A glob pattern." - } - ] - } - } - ] - }, - "documentation": "A notebook document filter denotes a notebook document by\ndifferent properties. The properties will be match\nagainst the notebook's URI (same as with documents)\n\n@since 3.17.0", - "since": "3.17.0" - }, - { - "name": "Pattern", - "type": { - "kind": "base", - "name": "string" - }, - "documentation": "The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:\n- `*` to match one or more characters in a path segment\n- `?` to match on one character in a path segment\n- `**` to match any number of path segments, including none\n- `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)\n- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)\n- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)\n\n@since 3.17.0", - "since": "3.17.0" - } - ] -} diff --git a/apps/proto/lib/mix/tasks/lsp/type_mappings.json b/apps/proto/lib/mix/tasks/lsp/type_mappings.json deleted file mode 100644 index b96a8010..00000000 --- a/apps/proto/lib/mix/tasks/lsp/type_mappings.json +++ /dev/null @@ -1,1852 +0,0 @@ -[ - { - "destination": "TextEdit.Annotated", - "imported_version": "3.17", - "source": "AnnotatedTextEdit" - }, - { - "destination": "ApplyWorkspaceEdit.Params", - "imported_version": "3.17", - "source": "ApplyWorkspaceEditParams" - }, - { - "destination": "ApplyWorkspaceEdit.Result", - "imported_version": "3.17", - "source": "ApplyWorkspaceEditResult" - }, - { - "destination": "BaseSymbolInformation", - "imported_version": "3.17", - "source": "BaseSymbolInformation" - }, - { - "destination": "CallHierarchy.ClientCapabilities", - "imported_version": "3.17", - "source": "CallHierarchyClientCapabilities" - }, - { - "destination": "CallHierarchy.IncomingCall", - "imported_version": "3.17", - "source": "CallHierarchyIncomingCall" - }, - { - "destination": "CallHierarchy.IncomingCalls.Params", - "imported_version": "3.17", - "source": "CallHierarchyIncomingCallsParams" - }, - { - "destination": "CallHierarchy.Item", - "imported_version": "3.17", - "source": "CallHierarchyItem" - }, - { - "destination": "CallHierarchy.Options", - "imported_version": "3.17", - "source": "CallHierarchyOptions" - }, - { - "destination": "CallHierarchy.OutgoingCall", - "imported_version": "3.17", - "source": "CallHierarchyOutgoingCall" - }, - { - "destination": "CallHierarchy.OutgoingCalls.Params", - "imported_version": "3.17", - "source": "CallHierarchyOutgoingCallsParams" - }, - { - "destination": "CallHierarchy.Prepare.Params", - "imported_version": "3.17", - "source": "CallHierarchyPrepareParams" - }, - { - "destination": "CallHierarchy.Registration.Options", - "imported_version": "3.17", - "source": "CallHierarchyRegistrationOptions" - }, - { - "destination": "Cancel.Params", - "imported_version": "3.17", - "source": "CancelParams" - }, - { - "destination": "ChangeAnnotation", - "imported_version": "3.17", - "source": "ChangeAnnotation" - }, - { - "destination": "ChangeAnnotation.Identifier", - "imported_version": "3.17", - "source": "ChangeAnnotationIdentifier" - }, - { - "destination": "ClientCapabilities", - "imported_version": "3.17", - "source": "ClientCapabilities" - }, - { - "destination": "CodeAction", - "imported_version": "3.17", - "source": "CodeAction" - }, - { - "destination": "CodeAction.ClientCapabilities", - "imported_version": "3.17", - "source": "CodeActionClientCapabilities" - }, - { - "destination": "CodeAction.Context", - "imported_version": "3.17", - "source": "CodeActionContext" - }, - { - "destination": "CodeAction.Kind", - "imported_version": "3.17", - "source": "CodeActionKind" - }, - { - "destination": "CodeAction.Options", - "imported_version": "3.17", - "source": "CodeActionOptions" - }, - { - "destination": "CodeAction.Params", - "imported_version": "3.17", - "source": "CodeActionParams" - }, - { - "destination": "CodeAction.Registration.Options", - "imported_version": "3.17", - "source": "CodeActionRegistrationOptions" - }, - { - "destination": "CodeAction.Trigger.Kind", - "imported_version": "3.17", - "source": "CodeActionTriggerKind" - }, - { - "destination": "CodeDescription", - "imported_version": "3.17", - "source": "CodeDescription" - }, - { - "destination": "CodeLens", - "imported_version": "3.17", - "source": "CodeLens" - }, - { - "destination": "CodeLens.ClientCapabilities", - "imported_version": "3.17", - "source": "CodeLensClientCapabilities" - }, - { - "destination": "CodeLens.Options", - "imported_version": "3.17", - "source": "CodeLensOptions" - }, - { - "destination": "CodeLens.Params", - "imported_version": "3.17", - "source": "CodeLensParams" - }, - { - "destination": "CodeLens.Registration.Options", - "imported_version": "3.17", - "source": "CodeLensRegistrationOptions" - }, - { - "destination": "CodeLens.Workspace.ClientCapabilities", - "imported_version": "3.17", - "source": "CodeLensWorkspaceClientCapabilities" - }, - { - "destination": "Color", - "imported_version": "3.17", - "source": "Color" - }, - { - "destination": "Color.Information", - "imported_version": "3.17", - "source": "ColorInformation" - }, - { - "destination": "Color.Presentation", - "imported_version": "3.17", - "source": "ColorPresentation" - }, - { - "destination": "Color.Presentation.Params", - "imported_version": "3.17", - "source": "ColorPresentationParams" - }, - { - "destination": "Command", - "imported_version": "3.17", - "source": "Command" - }, - { - "destination": "Completion.ClientCapabilities", - "imported_version": "3.17", - "source": "CompletionClientCapabilities" - }, - { - "destination": "Completion.Context", - "imported_version": "3.17", - "source": "CompletionContext" - }, - { - "destination": "Completion.Item", - "imported_version": "3.17", - "source": "CompletionItem" - }, - { - "destination": "Completion.Item.Kind", - "imported_version": "3.17", - "source": "CompletionItemKind" - }, - { - "destination": "Completion.Item.LabelDetails", - "imported_version": "3.17", - "source": "CompletionItemLabelDetails" - }, - { - "destination": "Completion.Item.Tag", - "imported_version": "3.17", - "source": "CompletionItemTag" - }, - { - "destination": "Completion.List", - "imported_version": "3.17", - "source": "CompletionList" - }, - { - "destination": "Completion.Options", - "imported_version": "3.17", - "source": "CompletionOptions" - }, - { - "destination": "Completion.Params", - "imported_version": "3.17", - "source": "CompletionParams" - }, - { - "destination": "Completion.Registration.Options", - "imported_version": "3.17", - "source": "CompletionRegistrationOptions" - }, - { - "destination": "Completion.Trigger.Kind", - "imported_version": "3.17", - "source": "CompletionTriggerKind" - }, - { - "destination": "Configuration.Item", - "imported_version": "3.17", - "source": "ConfigurationItem" - }, - { - "destination": "Configuration.Params", - "imported_version": "3.17", - "source": "ConfigurationParams" - }, - { - "destination": "CreateFile", - "imported_version": "3.17", - "source": "CreateFile" - }, - { - "destination": "CreateFile.Options", - "imported_version": "3.17", - "source": "CreateFileOptions" - }, - { - "destination": "CreateFiles.Params", - "imported_version": "3.17", - "source": "CreateFilesParams" - }, - { - "destination": "Declaration", - "imported_version": "3.17", - "source": "Declaration" - }, - { - "destination": "Declaration.ClientCapabilities", - "imported_version": "3.17", - "source": "DeclarationClientCapabilities" - }, - { - "destination": "Declaration.Link", - "imported_version": "3.17", - "source": "DeclarationLink" - }, - { - "destination": "Declaration.Options", - "imported_version": "3.17", - "source": "DeclarationOptions" - }, - { - "destination": "Declaration.Params", - "imported_version": "3.17", - "source": "DeclarationParams" - }, - { - "destination": "Declaration.Registration.Options", - "imported_version": "3.17", - "source": "DeclarationRegistrationOptions" - }, - { - "destination": "Definition", - "imported_version": "3.17", - "source": "Definition" - }, - { - "destination": "Definition.ClientCapabilities", - "imported_version": "3.17", - "source": "DefinitionClientCapabilities" - }, - { - "destination": "Definition.Link", - "imported_version": "3.17", - "source": "DefinitionLink" - }, - { - "destination": "Definition.Options", - "imported_version": "3.17", - "source": "DefinitionOptions" - }, - { - "destination": "Definition.Params", - "imported_version": "3.17", - "source": "DefinitionParams" - }, - { - "destination": "Definition.Registration.Options", - "imported_version": "3.17", - "source": "DefinitionRegistrationOptions" - }, - { - "destination": "DeleteFile", - "imported_version": "3.17", - "source": "DeleteFile" - }, - { - "destination": "DeleteFile.Options", - "imported_version": "3.17", - "source": "DeleteFileOptions" - }, - { - "destination": "DeleteFiles.Params", - "imported_version": "3.17", - "source": "DeleteFilesParams" - }, - { - "destination": "Diagnostic", - "imported_version": "3.17", - "source": "Diagnostic" - }, - { - "destination": "Diagnostic.ClientCapabilities", - "imported_version": "3.17", - "source": "DiagnosticClientCapabilities" - }, - { - "destination": "Diagnostic.Options", - "imported_version": "3.17", - "source": "DiagnosticOptions" - }, - { - "destination": "Diagnostic.Registration.Options", - "imported_version": "3.17", - "source": "DiagnosticRegistrationOptions" - }, - { - "destination": "Diagnostic.RelatedInformation", - "imported_version": "3.17", - "source": "DiagnosticRelatedInformation" - }, - { - "destination": "Diagnostic.ServerCancellationData", - "imported_version": "3.17", - "source": "DiagnosticServerCancellationData" - }, - { - "destination": "Diagnostic.Severity", - "imported_version": "3.17", - "source": "DiagnosticSeverity" - }, - { - "destination": "Diagnostic.Tag", - "imported_version": "3.17", - "source": "DiagnosticTag" - }, - { - "destination": "Diagnostic.Workspace.ClientCapabilities", - "imported_version": "3.17", - "source": "DiagnosticWorkspaceClientCapabilities" - }, - { - "destination": "DidChangeConfiguration.ClientCapabilities", - "imported_version": "3.17", - "source": "DidChangeConfigurationClientCapabilities" - }, - { - "destination": "DidChangeConfiguration.Params", - "imported_version": "3.17", - "source": "DidChangeConfigurationParams" - }, - { - "destination": "DidChangeConfiguration.Registration.Options", - "imported_version": "3.17", - "source": "DidChangeConfigurationRegistrationOptions" - }, - { - "destination": "DidChangeNotebookDocument.Params", - "imported_version": "3.17", - "source": "DidChangeNotebookDocumentParams" - }, - { - "destination": "DidChangeTextDocument.Params", - "imported_version": "3.17", - "source": "DidChangeTextDocumentParams" - }, - { - "destination": "DidChangeWatchedFiles.ClientCapabilities", - "imported_version": "3.17", - "source": "DidChangeWatchedFilesClientCapabilities" - }, - { - "destination": "DidChangeWatchedFiles.Params", - "imported_version": "3.17", - "source": "DidChangeWatchedFilesParams" - }, - { - "destination": "DidChangeWatchedFiles.Registration.Options", - "imported_version": "3.17", - "source": "DidChangeWatchedFilesRegistrationOptions" - }, - { - "destination": "DidChangeWorkspaceFolders.Params", - "imported_version": "3.17", - "source": "DidChangeWorkspaceFoldersParams" - }, - { - "destination": "DidCloseNotebookDocument.Params", - "imported_version": "3.17", - "source": "DidCloseNotebookDocumentParams" - }, - { - "destination": "DidCloseTextDocument.Params", - "imported_version": "3.17", - "source": "DidCloseTextDocumentParams" - }, - { - "destination": "DidOpenNotebookDocument.Params", - "imported_version": "3.17", - "source": "DidOpenNotebookDocumentParams" - }, - { - "destination": "DidOpenTextDocument.Params", - "imported_version": "3.17", - "source": "DidOpenTextDocumentParams" - }, - { - "destination": "DidSaveNotebookDocument.Params", - "imported_version": "3.17", - "source": "DidSaveNotebookDocumentParams" - }, - { - "destination": "DidSaveTextDocument.Params", - "imported_version": "3.17", - "source": "DidSaveTextDocumentParams" - }, - { - "destination": "Document.Color.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentColorClientCapabilities" - }, - { - "destination": "Document.Color.Options", - "imported_version": "3.17", - "source": "DocumentColorOptions" - }, - { - "destination": "Document.Color.Params", - "imported_version": "3.17", - "source": "DocumentColorParams" - }, - { - "destination": "Document.Color.Registration.Options", - "imported_version": "3.17", - "source": "DocumentColorRegistrationOptions" - }, - { - "destination": "Document.Diagnostic.Params", - "imported_version": "3.17", - "source": "DocumentDiagnosticParams" - }, - { - "destination": "DocumentDiagnosticReport", - "imported_version": "3.17", - "source": "DocumentDiagnosticReport" - }, - { - "destination": "Document.DiagnosticReport.Kind", - "imported_version": "3.17", - "source": "DocumentDiagnosticReportKind" - }, - { - "destination": "Document.DiagnosticReport.PartialResult", - "imported_version": "3.17", - "source": "DocumentDiagnosticReportPartialResult" - }, - { - "destination": "Document.Filter", - "imported_version": "3.17", - "source": "DocumentFilter" - }, - { - "destination": "Document.Formatting.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentFormattingClientCapabilities" - }, - { - "destination": "Document.Formatting.Options", - "imported_version": "3.17", - "source": "DocumentFormattingOptions" - }, - { - "destination": "Document.Formatting.Params", - "imported_version": "3.17", - "source": "DocumentFormattingParams" - }, - { - "destination": "Document.Formatting.Registration.Options", - "imported_version": "3.17", - "source": "DocumentFormattingRegistrationOptions" - }, - { - "destination": "Document.Highlight", - "imported_version": "3.17", - "source": "DocumentHighlight" - }, - { - "destination": "Document.Highlight.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentHighlightClientCapabilities" - }, - { - "destination": "Document.HighlightKind", - "imported_version": "3.17", - "source": "DocumentHighlightKind" - }, - { - "destination": "Document.Highlight.Options", - "imported_version": "3.17", - "source": "DocumentHighlightOptions" - }, - { - "destination": "Document.Highlight.Params", - "imported_version": "3.17", - "source": "DocumentHighlightParams" - }, - { - "destination": "Document.Highlight.Registration.Options", - "imported_version": "3.17", - "source": "DocumentHighlightRegistrationOptions" - }, - { - "destination": "Document.Link", - "imported_version": "3.17", - "source": "DocumentLink" - }, - { - "destination": "Document.Link.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentLinkClientCapabilities" - }, - { - "destination": "Document.Link.Options", - "imported_version": "3.17", - "source": "DocumentLinkOptions" - }, - { - "destination": "Document.Link.Params", - "imported_version": "3.17", - "source": "DocumentLinkParams" - }, - { - "destination": "Document.Link.Registration.Options", - "imported_version": "3.17", - "source": "DocumentLinkRegistrationOptions" - }, - { - "destination": "Document.OnTypeFormatting.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentOnTypeFormattingClientCapabilities" - }, - { - "destination": "Document.OnTypeFormatting.Options", - "imported_version": "3.17", - "source": "DocumentOnTypeFormattingOptions" - }, - { - "destination": "Document.OnTypeFormatting.Params", - "imported_version": "3.17", - "source": "DocumentOnTypeFormattingParams" - }, - { - "destination": "Document.OnTypeFormatting.Registration.Options", - "imported_version": "3.17", - "source": "DocumentOnTypeFormattingRegistrationOptions" - }, - { - "destination": "Document.RangeFormatting.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentRangeFormattingClientCapabilities" - }, - { - "destination": "Document.RangeFormatting.Options", - "imported_version": "3.17", - "source": "DocumentRangeFormattingOptions" - }, - { - "destination": "Document.RangeFormatting.Params", - "imported_version": "3.17", - "source": "DocumentRangeFormattingParams" - }, - { - "destination": "Document.RangeFormatting.Registration.Options", - "imported_version": "3.17", - "source": "DocumentRangeFormattingRegistrationOptions" - }, - { - "destination": "Document.Selector", - "imported_version": "3.17", - "source": "DocumentSelector" - }, - { - "destination": "Document.Symbol", - "imported_version": "3.17", - "source": "DocumentSymbol" - }, - { - "destination": "Document.Symbol.ClientCapabilities", - "imported_version": "3.17", - "source": "DocumentSymbolClientCapabilities" - }, - { - "destination": "Document.Symbol.Options", - "imported_version": "3.17", - "source": "DocumentSymbolOptions" - }, - { - "destination": "Document.Symbol.Params", - "imported_version": "3.17", - "source": "DocumentSymbolParams" - }, - { - "destination": "Document.Symbol.Registration.Options", - "imported_version": "3.17", - "source": "DocumentSymbolRegistrationOptions" - }, - { - "destination": "ErrorCodes", - "imported_version": "3.17", - "source": "ErrorCodes" - }, - { - "destination": "ExecuteCommand.ClientCapabilities", - "imported_version": "3.17", - "source": "ExecuteCommandClientCapabilities" - }, - { - "destination": "ExecuteCommand.Options", - "imported_version": "3.17", - "source": "ExecuteCommandOptions" - }, - { - "destination": "ExecuteCommand.Params", - "imported_version": "3.17", - "source": "ExecuteCommandParams" - }, - { - "destination": "ExecuteCommand.Registration.Options", - "imported_version": "3.17", - "source": "ExecuteCommandRegistrationOptions" - }, - { - "destination": "ExecutionSummary", - "imported_version": "3.17", - "source": "ExecutionSummary" - }, - { - "destination": "FailureHandling.Kind", - "imported_version": "3.17", - "source": "FailureHandlingKind" - }, - { - "destination": "FileChangeType", - "imported_version": "3.17", - "source": "FileChangeType" - }, - { - "destination": "FileCreate", - "imported_version": "3.17", - "source": "FileCreate" - }, - { - "destination": "FileDelete", - "imported_version": "3.17", - "source": "FileDelete" - }, - { - "destination": "FileEvent", - "imported_version": "3.17", - "source": "FileEvent" - }, - { - "destination": "FileOperation.ClientCapabilities", - "imported_version": "3.17", - "source": "FileOperationClientCapabilities" - }, - { - "destination": "FileOperation.Filter", - "imported_version": "3.17", - "source": "FileOperationFilter" - }, - { - "destination": "FileOperation.Options", - "imported_version": "3.17", - "source": "FileOperationOptions" - }, - { - "destination": "FileOperation.Pattern", - "imported_version": "3.17", - "source": "FileOperationPattern" - }, - { - "destination": "FileOperation.Pattern.Kind", - "imported_version": "3.17", - "source": "FileOperationPatternKind" - }, - { - "destination": "FileOperation.Pattern.Options", - "imported_version": "3.17", - "source": "FileOperationPatternOptions" - }, - { - "destination": "FileOperation.Registration.Options", - "imported_version": "3.17", - "source": "FileOperationRegistrationOptions" - }, - { - "destination": "FileRename", - "imported_version": "3.17", - "source": "FileRename" - }, - { - "destination": "FileSystemWatcher", - "imported_version": "3.17", - "source": "FileSystemWatcher" - }, - { - "destination": "FoldingRange", - "imported_version": "3.17", - "source": "FoldingRange" - }, - { - "destination": "FoldingRange.ClientCapabilities", - "imported_version": "3.17", - "source": "FoldingRangeClientCapabilities" - }, - { - "destination": "FoldingRange.Kind", - "imported_version": "3.17", - "source": "FoldingRangeKind" - }, - { - "destination": "FoldingRange.Options", - "imported_version": "3.17", - "source": "FoldingRangeOptions" - }, - { - "destination": "FoldingRange.Params", - "imported_version": "3.17", - "source": "FoldingRangeParams" - }, - { - "destination": "FoldingRange.Registration.Options", - "imported_version": "3.17", - "source": "FoldingRangeRegistrationOptions" - }, - { - "destination": "Formatting.Options", - "imported_version": "3.17", - "source": "FormattingOptions" - }, - { - "destination": "FullDocumentDiagnosticReport", - "imported_version": "3.17", - "source": "FullDocumentDiagnosticReport" - }, - { - "destination": "General.ClientCapabilities", - "imported_version": "3.17", - "source": "GeneralClientCapabilities" - }, - { - "destination": "GlobPattern", - "imported_version": "3.17", - "source": "GlobPattern" - }, - { - "destination": "Hover", - "imported_version": "3.17", - "source": "Hover" - }, - { - "destination": "Hover.ClientCapabilities", - "imported_version": "3.17", - "source": "HoverClientCapabilities" - }, - { - "destination": "Hover.Options", - "imported_version": "3.17", - "source": "HoverOptions" - }, - { - "destination": "Hover.Params", - "imported_version": "3.17", - "source": "HoverParams" - }, - { - "destination": "Hover.Registration.Options", - "imported_version": "3.17", - "source": "HoverRegistrationOptions" - }, - { - "destination": "Implementation.ClientCapabilities", - "imported_version": "3.17", - "source": "ImplementationClientCapabilities" - }, - { - "destination": "Implementation.Options", - "imported_version": "3.17", - "source": "ImplementationOptions" - }, - { - "destination": "Implementation.Params", - "imported_version": "3.17", - "source": "ImplementationParams" - }, - { - "destination": "Implementation.Registration.Options", - "imported_version": "3.17", - "source": "ImplementationRegistrationOptions" - }, - { - "destination": "Initialize.Error", - "imported_version": "3.17", - "source": "InitializeError" - }, - { - "destination": "Initialize.Params", - "imported_version": "3.17", - "source": "InitializeParams" - }, - { - "destination": "Initialize.Result", - "imported_version": "3.17", - "source": "InitializeResult" - }, - { - "destination": "Initialized.Params", - "imported_version": "3.17", - "source": "InitializedParams" - }, - { - "destination": "InlayHint", - "imported_version": "3.17", - "source": "InlayHint" - }, - { - "destination": "InlayHint.ClientCapabilities", - "imported_version": "3.17", - "source": "InlayHintClientCapabilities" - }, - { - "destination": "InlayHint.Kind", - "imported_version": "3.17", - "source": "InlayHintKind" - }, - { - "destination": "InlayHint.LabelPart", - "imported_version": "3.17", - "source": "InlayHintLabelPart" - }, - { - "destination": "InlayHint.Options", - "imported_version": "3.17", - "source": "InlayHintOptions" - }, - { - "destination": "InlayHint.Params", - "imported_version": "3.17", - "source": "InlayHintParams" - }, - { - "destination": "InlayHint.Registration.Options", - "imported_version": "3.17", - "source": "InlayHintRegistrationOptions" - }, - { - "destination": "InlayHintWorkspace.ClientCapabilities", - "imported_version": "3.17", - "source": "InlayHintWorkspaceClientCapabilities" - }, - { - "destination": "InlineValue", - "imported_version": "3.17", - "source": "InlineValue" - }, - { - "destination": "InlineValue.ClientCapabilities", - "imported_version": "3.17", - "source": "InlineValueClientCapabilities" - }, - { - "destination": "InlineValue.Context", - "imported_version": "3.17", - "source": "InlineValueContext" - }, - { - "destination": "InlineValue.EvaluatableExpression", - "imported_version": "3.17", - "source": "InlineValueEvaluatableExpression" - }, - { - "destination": "InlineValue.Options", - "imported_version": "3.17", - "source": "InlineValueOptions" - }, - { - "destination": "InlineValue.Params", - "imported_version": "3.17", - "source": "InlineValueParams" - }, - { - "destination": "InlineValue.Registration.Options", - "imported_version": "3.17", - "source": "InlineValueRegistrationOptions" - }, - { - "destination": "InlineValue.Text", - "imported_version": "3.17", - "source": "InlineValueText" - }, - { - "destination": "InlineValue.VariableLookup", - "imported_version": "3.17", - "source": "InlineValueVariableLookup" - }, - { - "destination": "InlineValue.Workspace.ClientCapabilities", - "imported_version": "3.17", - "source": "InlineValueWorkspaceClientCapabilities" - }, - { - "destination": "InsertReplaceEdit", - "imported_version": "3.17", - "source": "InsertReplaceEdit" - }, - { - "destination": "InsertTextFormat", - "imported_version": "3.17", - "source": "InsertTextFormat" - }, - { - "destination": "InsertTextMode", - "imported_version": "3.17", - "source": "InsertTextMode" - }, - { - "destination": "LSPAny", - "imported_version": "3.17", - "source": "LSPAny" - }, - { - "destination": "LSPArray", - "imported_version": "3.17", - "source": "LSPArray" - }, - { - "destination": "LSPErrorCodes", - "imported_version": "3.17", - "source": "LSPErrorCodes" - }, - { - "destination": "LSPObject", - "imported_version": "3.17", - "source": "LSPObject" - }, - { - "destination": "LinkedEditingRange.ClientCapabilities", - "imported_version": "3.17", - "source": "LinkedEditingRangeClientCapabilities" - }, - { - "destination": "LinkedEditingRange.Options", - "imported_version": "3.17", - "source": "LinkedEditingRangeOptions" - }, - { - "destination": "LinkedEditingRange.Params", - "imported_version": "3.17", - "source": "LinkedEditingRangeParams" - }, - { - "destination": "LinkedEditingRange.Registration.Options", - "imported_version": "3.17", - "source": "LinkedEditingRangeRegistrationOptions" - }, - { - "destination": "LinkedEditingRanges", - "imported_version": "3.17", - "source": "LinkedEditingRanges" - }, - { - "destination": "Location", - "imported_version": "3.17", - "source": "Location" - }, - { - "destination": "Location.Link", - "imported_version": "3.17", - "source": "LocationLink" - }, - { - "destination": "LogMessage.Params", - "imported_version": "3.17", - "source": "LogMessageParams" - }, - { - "destination": "LogTrace.Params", - "imported_version": "3.17", - "source": "LogTraceParams" - }, - { - "destination": "Markdown.ClientCapabilities", - "imported_version": "3.17", - "source": "MarkdownClientCapabilities" - }, - { - "destination": "MarkedString", - "imported_version": "3.17", - "source": "MarkedString" - }, - { - "destination": "Markup.Content", - "imported_version": "3.17", - "source": "MarkupContent" - }, - { - "destination": "Markup.Kind", - "imported_version": "3.17", - "source": "MarkupKind" - }, - { - "destination": "Message.ActionItem", - "imported_version": "3.17", - "source": "MessageActionItem" - }, - { - "destination": "Message.Type", - "imported_version": "3.17", - "source": "MessageType" - }, - { - "destination": "Moniker", - "imported_version": "3.17", - "source": "Moniker" - }, - { - "destination": "Moniker.ClientCapabilities", - "imported_version": "3.17", - "source": "MonikerClientCapabilities" - }, - { - "destination": "Moniker.Kind", - "imported_version": "3.17", - "source": "MonikerKind" - }, - { - "destination": "Moniker.Options", - "imported_version": "3.17", - "source": "MonikerOptions" - }, - { - "destination": "Moniker.Params", - "imported_version": "3.17", - "source": "MonikerParams" - }, - { - "destination": "Moniker.Registration.Options", - "imported_version": "3.17", - "source": "MonikerRegistrationOptions" - }, - { - "destination": "Notebook.Cell", - "imported_version": "3.17", - "source": "NotebookCell" - }, - { - "destination": "Notebook.Cell.ArrayChange", - "imported_version": "3.17", - "source": "NotebookCellArrayChange" - }, - { - "destination": "Notebook.Cell.Kind", - "imported_version": "3.17", - "source": "NotebookCellKind" - }, - { - "destination": "Notebook.Cell.TextDocument.Filter", - "imported_version": "3.17", - "source": "NotebookCellTextDocumentFilter" - }, - { - "destination": "Notebook.Document", - "imported_version": "3.17", - "source": "NotebookDocument" - }, - { - "destination": "Notebook.Document.ChangeEvent", - "imported_version": "3.17", - "source": "NotebookDocumentChangeEvent" - }, - { - "destination": "Notebook.Document.ClientCapabilities", - "imported_version": "3.17", - "source": "NotebookDocumentClientCapabilities" - }, - { - "destination": "Notebook.Document.Filter", - "imported_version": "3.17", - "source": "NotebookDocumentFilter" - }, - { - "destination": "Notebook.Document.Identifier", - "imported_version": "3.17", - "source": "NotebookDocumentIdentifier" - }, - { - "destination": "Notebook.Document.Sync.ClientCapabilities", - "imported_version": "3.17", - "source": "NotebookDocumentSyncClientCapabilities" - }, - { - "destination": "Notebook.Document.Sync.Options", - "imported_version": "3.17", - "source": "NotebookDocumentSyncOptions" - }, - { - "destination": "Notebook.Document.Sync.Registration.Options", - "imported_version": "3.17", - "source": "NotebookDocumentSyncRegistrationOptions" - }, - { - "destination": "TextDocument.OptionalVersioned.Identifier", - "imported_version": "3.17", - "source": "OptionalVersionedTextDocumentIdentifier" - }, - { - "destination": "ParameterInformation", - "imported_version": "3.17", - "source": "ParameterInformation" - }, - { - "destination": "PartialResult.Params", - "imported_version": "3.17", - "source": "PartialResultParams" - }, - { - "destination": "Pattern", - "imported_version": "3.17", - "source": "Pattern" - }, - { - "destination": "Position", - "imported_version": "3.17", - "source": "Position" - }, - { - "destination": "Position.Encoding.Kind", - "imported_version": "3.17", - "source": "PositionEncodingKind" - }, - { - "destination": "PrepareRename.Params", - "imported_version": "3.17", - "source": "PrepareRenameParams" - }, - { - "destination": "PrepareRenameResult", - "imported_version": "3.17", - "source": "PrepareRenameResult" - }, - { - "destination": "PrepareSupportDefaultBehavior", - "imported_version": "3.17", - "source": "PrepareSupportDefaultBehavior" - }, - { - "destination": "PreviousResultId", - "imported_version": "3.17", - "source": "PreviousResultId" - }, - { - "destination": "Progress.Params", - "imported_version": "3.17", - "source": "ProgressParams" - }, - { - "destination": "Progress.Token", - "imported_version": "3.17", - "source": "ProgressToken" - }, - { - "destination": "PublishDiagnostics.ClientCapabilities", - "imported_version": "3.17", - "source": "PublishDiagnosticsClientCapabilities" - }, - { - "destination": "PublishDiagnostics.Params", - "imported_version": "3.17", - "source": "PublishDiagnosticsParams" - }, - { - "destination": "Range", - "imported_version": "3.17", - "source": "Range" - }, - { - "destination": "Reference.ClientCapabilities", - "imported_version": "3.17", - "source": "ReferenceClientCapabilities" - }, - { - "destination": "Reference.Context", - "imported_version": "3.17", - "source": "ReferenceContext" - }, - { - "destination": "Reference.Options", - "imported_version": "3.17", - "source": "ReferenceOptions" - }, - { - "destination": "Reference.Params", - "imported_version": "3.17", - "source": "ReferenceParams" - }, - { - "destination": "Reference.Registration.Options", - "imported_version": "3.17", - "source": "ReferenceRegistrationOptions" - }, - { - "destination": "Registration", - "imported_version": "3.17", - "source": "Registration" - }, - { - "destination": "Registration.Params", - "imported_version": "3.17", - "source": "RegistrationParams" - }, - { - "destination": "RegularExpressions.ClientCapabilities", - "imported_version": "3.17", - "source": "RegularExpressionsClientCapabilities" - }, - { - "destination": "RelatedFullDocumentDiagnosticReport", - "imported_version": "3.17", - "source": "RelatedFullDocumentDiagnosticReport" - }, - { - "destination": "RelatedUnchangedDocumentDiagnosticReport", - "imported_version": "3.17", - "source": "RelatedUnchangedDocumentDiagnosticReport" - }, - { - "destination": "RelativePattern", - "imported_version": "3.17", - "source": "RelativePattern" - }, - { - "destination": "Rename.ClientCapabilities", - "imported_version": "3.17", - "source": "RenameClientCapabilities" - }, - { - "destination": "RenameFile", - "imported_version": "3.17", - "source": "RenameFile" - }, - { - "destination": "RenameFile.Options", - "imported_version": "3.17", - "source": "RenameFileOptions" - }, - { - "destination": "RenameFiles.Params", - "imported_version": "3.17", - "source": "RenameFilesParams" - }, - { - "destination": "Rename.Options", - "imported_version": "3.17", - "source": "RenameOptions" - }, - { - "destination": "Rename.Params", - "imported_version": "3.17", - "source": "RenameParams" - }, - { - "destination": "Rename.Registration.Options", - "imported_version": "3.17", - "source": "RenameRegistrationOptions" - }, - { - "destination": "ResourceOperation", - "imported_version": "3.17", - "source": "ResourceOperation" - }, - { - "destination": "ResourceOperation.Kind", - "imported_version": "3.17", - "source": "ResourceOperationKind" - }, - { - "destination": "Save.Options", - "imported_version": "3.17", - "source": "SaveOptions" - }, - { - "destination": "SelectionRange", - "imported_version": "3.17", - "source": "SelectionRange" - }, - { - "destination": "SelectionRange.ClientCapabilities", - "imported_version": "3.17", - "source": "SelectionRangeClientCapabilities" - }, - { - "destination": "SelectionRange.Options", - "imported_version": "3.17", - "source": "SelectionRangeOptions" - }, - { - "destination": "SelectionRange.Params", - "imported_version": "3.17", - "source": "SelectionRangeParams" - }, - { - "destination": "SelectionRange.Registration.Options", - "imported_version": "3.17", - "source": "SelectionRangeRegistrationOptions" - }, - { - "destination": "SemanticTokenModifiers", - "imported_version": "3.17", - "source": "SemanticTokenModifiers" - }, - { - "destination": "SemanticTokenTypes", - "imported_version": "3.17", - "source": "SemanticTokenTypes" - }, - { - "destination": "SemanticTokens", - "imported_version": "3.17", - "source": "SemanticTokens" - }, - { - "destination": "SemanticTokens.ClientCapabilities", - "imported_version": "3.17", - "source": "SemanticTokensClientCapabilities" - }, - { - "destination": "SemanticTokens.Delta", - "imported_version": "3.17", - "source": "SemanticTokensDelta" - }, - { - "destination": "SemanticTokens.Delta.Params", - "imported_version": "3.17", - "source": "SemanticTokensDeltaParams" - }, - { - "destination": "SemanticTokens.Delta.PartialResult", - "imported_version": "3.17", - "source": "SemanticTokensDeltaPartialResult" - }, - { - "destination": "SemanticTokens.Edit", - "imported_version": "3.17", - "source": "SemanticTokensEdit" - }, - { - "destination": "SemanticTokens.Legend", - "imported_version": "3.17", - "source": "SemanticTokensLegend" - }, - { - "destination": "SemanticTokens.Options", - "imported_version": "3.17", - "source": "SemanticTokensOptions" - }, - { - "destination": "SemanticTokens.Params", - "imported_version": "3.17", - "source": "SemanticTokensParams" - }, - { - "destination": "SemanticTokens.PartialResult", - "imported_version": "3.17", - "source": "SemanticTokensPartialResult" - }, - { - "destination": "SemanticTokens.Range.Params", - "imported_version": "3.17", - "source": "SemanticTokensRangeParams" - }, - { - "destination": "SemanticTokens.Registration.Options", - "imported_version": "3.17", - "source": "SemanticTokensRegistrationOptions" - }, - { - "destination": "SemanticTokens.Workspace.ClientCapabilities", - "imported_version": "3.17", - "source": "SemanticTokensWorkspaceClientCapabilities" - }, - { - "destination": "ServerCapabilities", - "imported_version": "3.17", - "source": "ServerCapabilities" - }, - { - "destination": "SetTrace.Params", - "imported_version": "3.17", - "source": "SetTraceParams" - }, - { - "destination": "ShowDocument.ClientCapabilities", - "imported_version": "3.17", - "source": "ShowDocumentClientCapabilities" - }, - { - "destination": "ShowDocument.Params", - "imported_version": "3.17", - "source": "ShowDocumentParams" - }, - { - "destination": "ShowDocumentResult", - "imported_version": "3.17", - "source": "ShowDocumentResult" - }, - { - "destination": "ShowMessage.Params", - "imported_version": "3.17", - "source": "ShowMessageParams" - }, - { - "destination": "ShowMessageRequest.ClientCapabilities", - "imported_version": "3.17", - "source": "ShowMessageRequestClientCapabilities" - }, - { - "destination": "ShowMessageRequest.Params", - "imported_version": "3.17", - "source": "ShowMessageRequestParams" - }, - { - "destination": "SignatureHelp", - "imported_version": "3.17", - "source": "SignatureHelp" - }, - { - "destination": "SignatureHelp.ClientCapabilities", - "imported_version": "3.17", - "source": "SignatureHelpClientCapabilities" - }, - { - "destination": "SignatureHelp.Context", - "imported_version": "3.17", - "source": "SignatureHelpContext" - }, - { - "destination": "SignatureHelp.Options", - "imported_version": "3.17", - "source": "SignatureHelpOptions" - }, - { - "destination": "SignatureHelp.Params", - "imported_version": "3.17", - "source": "SignatureHelpParams" - }, - { - "destination": "SignatureHelp.Registration.Options", - "imported_version": "3.17", - "source": "SignatureHelpRegistrationOptions" - }, - { - "destination": "SignatureHelp.Trigger.Kind", - "imported_version": "3.17", - "source": "SignatureHelpTriggerKind" - }, - { - "destination": "SignatureInformation", - "imported_version": "3.17", - "source": "SignatureInformation" - }, - { - "destination": "Static.Registration.Options", - "imported_version": "3.17", - "source": "StaticRegistrationOptions" - }, - { - "destination": "Symbol.Information", - "imported_version": "3.17", - "source": "SymbolInformation" - }, - { - "destination": "Symbol.Kind", - "imported_version": "3.17", - "source": "SymbolKind" - }, - { - "destination": "Symbol.Tag", - "imported_version": "3.17", - "source": "SymbolTag" - }, - { - "destination": "TextDocument.Change.Registration.Options", - "imported_version": "3.17", - "source": "TextDocumentChangeRegistrationOptions" - }, - { - "destination": "TextDocument.ClientCapabilities", - "imported_version": "3.17", - "source": "TextDocumentClientCapabilities" - }, - { - "destination": "TextDocument.ContentChangeEvent", - "imported_version": "3.17", - "source": "TextDocumentContentChangeEvent" - }, - { - "destination": "TextDocument.Edit", - "imported_version": "3.17", - "source": "TextDocumentEdit" - }, - { - "destination": "TextDocument.Filter", - "imported_version": "3.17", - "source": "TextDocumentFilter" - }, - { - "destination": "TextDocument.Identifier", - "imported_version": "3.17", - "source": "TextDocumentIdentifier" - }, - { - "destination": "TextDocument.Item", - "imported_version": "3.17", - "source": "TextDocumentItem" - }, - { - "destination": "TextDocument.Position.Params", - "imported_version": "3.17", - "source": "TextDocumentPositionParams" - }, - { - "destination": "TextDocument.Registration.Options", - "imported_version": "3.17", - "source": "TextDocumentRegistrationOptions" - }, - { - "destination": "TextDocument.Save.Reason", - "imported_version": "3.17", - "source": "TextDocumentSaveReason" - }, - { - "destination": "TextDocument.Save.Registration.Options", - "imported_version": "3.17", - "source": "TextDocumentSaveRegistrationOptions" - }, - { - "destination": "TextDocument.Sync.ClientCapabilities", - "imported_version": "3.17", - "source": "TextDocumentSyncClientCapabilities" - }, - { - "destination": "TextDocument.Sync.Kind", - "imported_version": "3.17", - "source": "TextDocumentSyncKind" - }, - { - "destination": "TextDocument.Sync.Options", - "imported_version": "3.17", - "source": "TextDocumentSyncOptions" - }, - { - "destination": "TextEdit", - "imported_version": "3.17", - "source": "TextEdit" - }, - { - "destination": "TokenFormat", - "imported_version": "3.17", - "source": "TokenFormat" - }, - { - "destination": "TraceValues", - "imported_version": "3.17", - "source": "TraceValues" - }, - { - "destination": "TypeDefinition.ClientCapabilities", - "imported_version": "3.17", - "source": "TypeDefinitionClientCapabilities" - }, - { - "destination": "TypeDefinition.Options", - "imported_version": "3.17", - "source": "TypeDefinitionOptions" - }, - { - "destination": "TypeDefinition.Params", - "imported_version": "3.17", - "source": "TypeDefinitionParams" - }, - { - "destination": "TypeDefinition.Registration.Options", - "imported_version": "3.17", - "source": "TypeDefinitionRegistrationOptions" - }, - { - "destination": "TypeHierarchy.ClientCapabilities", - "imported_version": "3.17", - "source": "TypeHierarchyClientCapabilities" - }, - { - "destination": "TypeHierarchy.Item", - "imported_version": "3.17", - "source": "TypeHierarchyItem" - }, - { - "destination": "TypeHierarchy.Options", - "imported_version": "3.17", - "source": "TypeHierarchyOptions" - }, - { - "destination": "TypeHierarchy.Prepare.Params", - "imported_version": "3.17", - "source": "TypeHierarchyPrepareParams" - }, - { - "destination": "TypeHierarchy.Registration.Options", - "imported_version": "3.17", - "source": "TypeHierarchyRegistrationOptions" - }, - { - "destination": "TypeHierarchy.Subtypes.Params", - "imported_version": "3.17", - "source": "TypeHierarchySubtypesParams" - }, - { - "destination": "TypeHierarchy.Supertypes.Params", - "imported_version": "3.17", - "source": "TypeHierarchySupertypesParams" - }, - { - "destination": "UnchangedDocumentDiagnosticReport", - "imported_version": "3.17", - "source": "UnchangedDocumentDiagnosticReport" - }, - { - "destination": "UniquenessLevel", - "imported_version": "3.17", - "source": "UniquenessLevel" - }, - { - "destination": "Unregistration", - "imported_version": "3.17", - "source": "Unregistration" - }, - { - "destination": "Unregistration.Params", - "imported_version": "3.17", - "source": "UnregistrationParams" - }, - { - "destination": "Notebook.VersionedDocument.Identifier", - "imported_version": "3.17", - "source": "VersionedNotebookDocumentIdentifier" - }, - { - "destination": "TextDocument.Versioned.Identifier", - "imported_version": "3.17", - "source": "VersionedTextDocumentIdentifier" - }, - { - "destination": "Watch.Kind", - "imported_version": "3.17", - "source": "WatchKind" - }, - { - "destination": "WillSaveTextDocument.Params", - "imported_version": "3.17", - "source": "WillSaveTextDocumentParams" - }, - { - "destination": "Window.ClientCapabilities", - "imported_version": "3.17", - "source": "WindowClientCapabilities" - }, - { - "destination": "WorkDone.Progress.Begin", - "imported_version": "3.17", - "source": "WorkDoneProgressBegin" - }, - { - "destination": "WorkDone.Progress.Cancel.Params", - "imported_version": "3.17", - "source": "WorkDoneProgressCancelParams" - }, - { - "destination": "WorkDone.Progress.Create.Params", - "imported_version": "3.17", - "source": "WorkDoneProgressCreateParams" - }, - { - "destination": "WorkDone.Progress.End", - "imported_version": "3.17", - "source": "WorkDoneProgressEnd" - }, - { - "destination": "WorkDone.Progress.Options", - "imported_version": "3.17", - "source": "WorkDoneProgressOptions" - }, - { - "destination": "WorkDone.Progress.Params", - "imported_version": "3.17", - "source": "WorkDoneProgressParams" - }, - { - "destination": "WorkDone.Progress.Report", - "imported_version": "3.17", - "source": "WorkDoneProgressReport" - }, - { - "destination": "Workspace.ClientCapabilities", - "imported_version": "3.17", - "source": "WorkspaceClientCapabilities" - }, - { - "destination": "Workspace.Diagnostic.Params", - "imported_version": "3.17", - "source": "WorkspaceDiagnosticParams" - }, - { - "destination": "Workspace.Diagnostic.Report", - "imported_version": "3.17", - "source": "WorkspaceDiagnosticReport" - }, - { - "destination": "Workspace.Diagnostic.Report.PartialResult", - "imported_version": "3.17", - "source": "WorkspaceDiagnosticReportPartialResult" - }, - { - "destination": "WorkspaceDocumentDiagnosticReport", - "imported_version": "3.17", - "source": "WorkspaceDocumentDiagnosticReport" - }, - { - "destination": "Workspace.Edit", - "imported_version": "3.17", - "source": "WorkspaceEdit" - }, - { - "destination": "Workspace.Edit.ClientCapabilities", - "imported_version": "3.17", - "source": "WorkspaceEditClientCapabilities" - }, - { - "destination": "Workspace.Folder", - "imported_version": "3.17", - "source": "WorkspaceFolder" - }, - { - "destination": "Workspace.FoldersChangeEvent", - "imported_version": "3.17", - "source": "WorkspaceFoldersChangeEvent" - }, - { - "destination": "Workspace.FoldersInitialize.Params", - "imported_version": "3.17", - "source": "WorkspaceFoldersInitializeParams" - }, - { - "destination": "Workspace.FoldersServerCapabilities", - "imported_version": "3.17", - "source": "WorkspaceFoldersServerCapabilities" - }, - { - "destination": "Workspace.FullDocument.Diagnostic.Report", - "imported_version": "3.17", - "source": "WorkspaceFullDocumentDiagnosticReport" - }, - { - "destination": "Workspace.Symbol", - "imported_version": "3.17", - "source": "WorkspaceSymbol" - }, - { - "destination": "Workspace.Symbol.ClientCapabilities", - "imported_version": "3.17", - "source": "WorkspaceSymbolClientCapabilities" - }, - { - "destination": "Workspace.Symbol.Options", - "imported_version": "3.17", - "source": "WorkspaceSymbolOptions" - }, - { - "destination": "Workspace.Symbol.Params", - "imported_version": "3.17", - "source": "WorkspaceSymbolParams" - }, - { - "destination": "Workspace.Symbol.Registration.Options", - "imported_version": "3.17", - "source": "WorkspaceSymbolRegistrationOptions" - }, - { - "destination": "Workspace.UnchangedDocument.Diagnostic.Report", - "imported_version": "3.17", - "source": "WorkspaceUnchangedDocumentDiagnosticReport" - }, - { - "destination": "_InitializeParams", - "imported_version": "3.17", - "source": "_InitializeParams" - } -] diff --git a/apps/proto/lib/proto.ex b/apps/proto/lib/proto.ex deleted file mode 100644 index 829b30a6..00000000 --- a/apps/proto/lib/proto.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule Proto do - @moduledoc """ - Generators and a DSL for creating stuctures that represent the LSP protocol - """ -end diff --git a/apps/proto/mix.exs b/apps/proto/mix.exs deleted file mode 100644 index 03b5d844..00000000 --- a/apps/proto/mix.exs +++ /dev/null @@ -1,32 +0,0 @@ -defmodule Proto.MixProject do - use Mix.Project - Code.require_file("../../mix_includes.exs") - - def project do - [ - app: :proto, - version: "0.7.2", - elixir: "~> 1.15", - start_permanent: Mix.env() == :prod, - deps: deps(), - dialyzer: Mix.Dialyzer.config(add_apps: [:jason]) - ] - end - - # Run "mix help compile.app" to learn about applications. - def application do - [ - extra_applications: [:logger] - ] - end - - # Run "mix help deps" to learn about dependencies. - defp deps do - [ - {:forge, path: "../forge", env: Mix.env()}, - Mix.Credo.dependency(), - Mix.Dialyzer.dependency(), - {:jason, "~> 1.4", optional: true} - ] - end -end diff --git a/apps/proto/mix.lock b/apps/proto/mix.lock deleted file mode 100644 index be2b7ed0..00000000 --- a/apps/proto/mix.lock +++ /dev/null @@ -1,14 +0,0 @@ -%{ - "benchee": {:hex, :benchee, "1.3.1", "c786e6a76321121a44229dde3988fc772bca73ea75170a73fd5f4ddf1af95ccf", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "76224c58ea1d0391c8309a8ecbfe27d71062878f59bd41a390266bf4ac1cc56d"}, - "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, - "credo": {:hex, :credo, "1.7.11", "d3e805f7ddf6c9c854fd36f089649d7cf6ba74c42bc3795d587814e3c9847102", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "56826b4306843253a66e47ae45e98e7d284ee1f95d53d1612bb483f88a8cf219"}, - "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"}, - "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, - "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, - "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, - "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, - "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, - "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, - "stream_data": {:hex, :stream_data, "1.1.3", "15fdb14c64e84437901258bb56fc7d80aaf6ceaf85b9324f359e219241353bfb", [:mix], [], "hexpm", "859eb2be72d74be26c1c4f272905667672a52e44f743839c57c7ee73a1a66420"}, -} diff --git a/apps/proto/test/test_helper.exs b/apps/proto/test/test_helper.exs deleted file mode 100644 index 869559e7..00000000 --- a/apps/proto/test/test_helper.exs +++ /dev/null @@ -1 +0,0 @@ -ExUnit.start() diff --git a/apps/protocol/.credo.exs b/apps/protocol/.credo.exs deleted file mode 100644 index 0e9ed7f4..00000000 --- a/apps/protocol/.credo.exs +++ /dev/null @@ -1,3 +0,0 @@ -Code.require_file("../../mix_credo.exs") - -Mix.Credo.config() diff --git a/apps/protocol/.formatter.exs b/apps/protocol/.formatter.exs deleted file mode 100644 index 3489f1c3..00000000 --- a/apps/protocol/.formatter.exs +++ /dev/null @@ -1,5 +0,0 @@ -# Used by "mix format" -[ - import_deps: [:proto], - inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] -] diff --git a/apps/protocol/.gitignore b/apps/protocol/.gitignore deleted file mode 100644 index d40a35eb..00000000 --- a/apps/protocol/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -# The directory Mix will write compiled artifacts to. -/_build/ - -# If you run "mix test --cover", coverage assets end up here. -/cover/ - -# The directory Mix downloads your dependencies sources to. -/deps/ - -# Where third-party dependencies like ExDoc output generated docs. -/doc/ - -# Ignore .fetch files in case you like to edit your project deps locally. -/.fetch - -# If the VM crashes, it generates a dump, let's ignore it too. -erl_crash.dump - -# Also ignore archive artifacts (built via "mix archive.build"). -*.ez - -# Ignore package tarball (built via "mix hex.build"). -protocol-*.tar - -# Temporary files, for example, from tests. -/tmp/ diff --git a/apps/protocol/README.md b/apps/protocol/README.md deleted file mode 100644 index dc900400..00000000 --- a/apps/protocol/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Expert.Protocol - -Language Server Protocol data structures and conversion utilities. diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.position.ex b/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.position.ex deleted file mode 100644 index 9c2c7c06..00000000 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.position.ex +++ /dev/null @@ -1,12 +0,0 @@ -defimpl Forge.Convertible, for: Expert.Protocol.Types.Position do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types - - def to_lsp(%Types.Position{} = position) do - Conversions.to_lsp(position) - end - - def to_native(%Types.Position{} = position, context_document) do - Conversions.to_elixir(position, context_document) - end -end diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.range.ex b/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.range.ex deleted file mode 100644 index 11b1198d..00000000 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.range.ex +++ /dev/null @@ -1,23 +0,0 @@ -defimpl Forge.Convertible, for: Expert.Protocol.Types.Range do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types - - def to_lsp(%Types.Range{} = range) do - Conversions.to_lsp(range) - end - - def to_native( - %Types.Range{ - start: %Types.Position{line: start_line, character: start_character}, - end: %Types.Position{line: end_line, character: end_character} - } = range, - _context_document - ) - when start_line < 0 or start_character < 0 or end_line < 0 or end_character < 0 do - {:error, {:invalid_range, range}} - end - - def to_native(%Types.Range{} = range, context_document) do - Conversions.to_elixir(range, context_document) - end -end diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1.ex b/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1.ex deleted file mode 100644 index 7623f95f..00000000 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1.ex +++ /dev/null @@ -1,13 +0,0 @@ -alias Forge.Convertible -alias Forge.Document.Edit -alias Expert.Protocol.Types.TextDocument.ContentChangeEvent - -defimpl Convertible, for: ContentChangeEvent.TextDocumentContentChangeEvent1 do - def to_lsp(event) do - {:ok, event} - end - - def to_native(%ContentChangeEvent.TextDocumentContentChangeEvent1{} = event, _context_document) do - {:ok, Edit.new(event.text)} - end -end diff --git a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_edit.ex b/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_edit.ex deleted file mode 100644 index 989e6094..00000000 --- a/apps/protocol/lib/expert/protocol/convertibles/expert.protocol.types.text_edit.ex +++ /dev/null @@ -1,22 +0,0 @@ -defimpl Forge.Convertible, for: Expert.Protocol.Types.TextEdit do - alias Expert.Protocol.Conversions - alias Expert.Protocol.Types - alias Forge.Document - - def to_lsp(%Types.TextEdit{} = text_edit) do - with {:ok, range} <- Conversions.to_lsp(text_edit.range) do - {:ok, %Types.TextEdit{text_edit | range: range}} - end - end - - def to_native(%Types.TextEdit{range: nil} = text_edit, _context_document) do - {:ok, Document.Edit.new(text_edit.new_text)} - end - - def to_native(%Types.TextEdit{} = text_edit, context_document) do - with {:ok, %Document.Range{} = range} <- - Conversions.to_elixir(text_edit.range, context_document) do - {:ok, Document.Edit.new(text_edit.new_text, range)} - end - end -end diff --git a/apps/protocol/lib/expert/protocol/document_containers/expert.document.changes.ex b/apps/protocol/lib/expert/protocol/document_containers/expert.document.changes.ex deleted file mode 100644 index 1aa1fc99..00000000 --- a/apps/protocol/lib/expert/protocol/document_containers/expert.document.changes.ex +++ /dev/null @@ -1,7 +0,0 @@ -defimpl Forge.Document.Container, for: Forge.Document.Changes do - alias Forge.Document - - def context_document(%Document.Changes{} = edits, prior_context_document) do - edits.document || prior_context_document - end -end diff --git a/apps/protocol/lib/expert/protocol/document_containers/expert.document.location.ex b/apps/protocol/lib/expert/protocol/document_containers/expert.document.location.ex deleted file mode 100644 index 96c8edea..00000000 --- a/apps/protocol/lib/expert/protocol/document_containers/expert.document.location.ex +++ /dev/null @@ -1,18 +0,0 @@ -defimpl Forge.Document.Container, for: Forge.Document.Location do - alias Forge.Document - alias Forge.Document.Location - - def context_document(%Location{document: %Document{} = context_document}, _) do - context_document - end - - def context_document(%Location{uri: uri}, context_document) when is_binary(uri) do - case Document.Store.fetch(uri) do - {:ok, %Document{} = document} -> - document - - _ -> - context_document - end - end -end diff --git a/apps/protocol/lib/expert/protocol/document_containers/expert.notifications.publish_diagnostics.ex b/apps/protocol/lib/expert/protocol/document_containers/expert.notifications.publish_diagnostics.ex deleted file mode 100644 index 0344f066..00000000 --- a/apps/protocol/lib/expert/protocol/document_containers/expert.notifications.publish_diagnostics.ex +++ /dev/null @@ -1,21 +0,0 @@ -defimpl Forge.Document.Container, for: Expert.Protocol.Notifications.PublishDiagnostics do - alias Expert.Protocol.Notifications.PublishDiagnostics - alias Forge.Document - require Logger - - def context_document(%PublishDiagnostics{uri: uri} = publish, context_document) - when is_binary(uri) do - case Document.Store.open_temporary(publish.uri) do - {:ok, source_doc} -> - source_doc - - error -> - Logger.error("Failed to open #{uri} temporarily because #{inspect(error)}") - context_document - end - end - - def context_document(_, context_doc) do - context_doc - end -end diff --git a/apps/protocol/lib/expert/protocol/document_containers/expert.protocol.types.location.ex b/apps/protocol/lib/expert/protocol/document_containers/expert.protocol.types.location.ex deleted file mode 100644 index 518f06c8..00000000 --- a/apps/protocol/lib/expert/protocol/document_containers/expert.protocol.types.location.ex +++ /dev/null @@ -1,11 +0,0 @@ -defimpl Forge.Document.Container, for: Expert.Protocol.Types.Location do - alias Expert.Protocol.Types - alias Forge.Document - - def context_document(%Types.Location{} = location, parent_document) do - case Document.Store.fetch(location.uri) do - {:ok, doc} -> doc - _ -> parent_document - end - end -end diff --git a/apps/protocol/lib/expert/protocol/notifications.ex b/apps/protocol/lib/expert/protocol/notifications.ex deleted file mode 100644 index 5a034be3..00000000 --- a/apps/protocol/lib/expert/protocol/notifications.ex +++ /dev/null @@ -1,97 +0,0 @@ -defmodule Expert.Protocol.Notifications do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Initialized do - use Proto - defnotification "initialized" - end - - defmodule Exit do - use Proto - - defnotification "exit" - end - - defmodule Cancel do - use Proto - - defnotification "$/cancelRequest", Types.Cancel.Params - end - - defmodule DidOpen do - use Proto - - defnotification "textDocument/didOpen", Types.DidOpenTextDocument.Params - end - - defmodule DidClose do - use Proto - - defnotification "textDocument/didClose", Types.DidCloseTextDocument.Params - end - - defmodule DidChange do - use Proto - - defnotification "textDocument/didChange", Types.DidChangeTextDocument.Params - end - - defmodule DidChangeConfiguration do - use Proto - - defnotification "workspace/didChangeConfiguration", Types.DidChangeConfiguration.Params - end - - defmodule DidChangeWatchedFiles do - use Proto - - defnotification "workspace/didChangeWatchedFiles", Types.DidChangeWatchedFiles.Params - end - - defmodule DidSave do - use Proto - - defnotification "textDocument/didSave", Types.DidSaveTextDocument.Params - end - - defmodule PublishDiagnostics do - use Proto - - defnotification "textDocument/publishDiagnostics", Types.PublishDiagnostics.Params - end - - defmodule LogMessage do - use Proto - require Types.Message.Type - - defnotification "window/logMessage", Types.LogMessage.Params - - for type <- [:error, :warning, :info, :log] do - def unquote(type)(message) do - new(message: message, type: Types.Message.Type.unquote(type)()) - end - end - end - - defmodule ShowMessage do - use Proto - require Types.Message.Type - - defnotification "window/showMessage", Types.ShowMessage.Params - - for type <- [:error, :warning, :info, :log] do - def unquote(type)(message) do - new(message: message, type: Types.Message.Type.unquote(type)()) - end - end - end - - defmodule Progress do - use Proto - - defnotification "$/progress", Types.Progress.Params - end - - use Proto, decoders: :notifications -end diff --git a/apps/protocol/lib/expert/protocol/requests.ex b/apps/protocol/lib/expert/protocol/requests.ex deleted file mode 100644 index a761832f..00000000 --- a/apps/protocol/lib/expert/protocol/requests.ex +++ /dev/null @@ -1,114 +0,0 @@ -defmodule Expert.Protocol.Requests do - alias Expert.Proto - alias Expert.Protocol.Responses - alias Expert.Protocol.Types - - # Client -> Server request - defmodule Initialize do - use Proto - - defrequest "initialize", Types.Initialize.Params - end - - defmodule Cancel do - use Proto - - defrequest "$/cancelRequest", Types.Cancel.Params - end - - defmodule Shutdown do - use Proto - - defrequest "shutdown" - end - - defmodule FindReferences do - use Proto - - defrequest "textDocument/references", Types.Reference.Params - end - - defmodule GoToDefinition do - use Proto - - defrequest "textDocument/definition", Types.Definition.Params - end - - defmodule CreateWorkDoneProgress do - use Proto - - defrequest "window/workDoneProgress/create", Types.WorkDone.Progress.Create.Params - end - - defmodule Formatting do - use Proto - - defrequest "textDocument/formatting", Types.Document.Formatting.Params - end - - defmodule CodeAction do - use Proto - - defrequest "textDocument/codeAction", Types.CodeAction.Params - end - - defmodule CodeLens do - use Proto - - defrequest "textDocument/codeLens", Types.CodeLens.Params - end - - defmodule Completion do - use Proto - - defrequest "textDocument/completion", Types.Completion.Params - end - - defmodule Hover do - use Proto - - defrequest "textDocument/hover", Types.Hover.Params - end - - defmodule ExecuteCommand do - use Proto - - defrequest "workspace/executeCommand", Types.ExecuteCommand.Params - end - - defmodule DocumentSymbols do - use Proto - - defrequest "textDocument/documentSymbol", Types.Document.Symbol.Params - end - - defmodule WorkspaceSymbol do - use Proto - - defrequest "workspace/symbol", Types.Workspace.Symbol.Params - end - - # Server -> Client requests - - defmodule RegisterCapability do - use Proto - - server_request "client/registerCapability", Types.Registration.Params, Responses.Empty - end - - defmodule ShowMessageRequest do - use Proto - - server_request "window/showMessageRequest", - Types.ShowMessageRequest.Params, - Responses.ShowMessage - end - - defmodule CodeLensRefresh do - use Proto - - server_request "workspace/codeLens/refresh", Responses.Empty - end - - use Proto, decoders: :requests -end diff --git a/apps/protocol/lib/expert/protocol/responses.ex b/apps/protocol/lib/expert/protocol/responses.ex deleted file mode 100644 index 9f57284f..00000000 --- a/apps/protocol/lib/expert/protocol/responses.ex +++ /dev/null @@ -1,91 +0,0 @@ -defmodule Expert.Protocol.Responses do - alias Expert.Proto - alias Expert.Proto.Typespecs - alias Expert.Protocol.Types - - defmodule Empty do - use Proto - - defresponse optional(Types.LSPObject) - end - - defmodule InitializeResult do - use Proto - - defresponse Types.Initialize.Result - end - - defmodule FindReferences do - use Proto - - defresponse optional(list_of(Types.Location)) - end - - defmodule GoToDefinition do - use Proto - - defresponse optional(Types.Location) - end - - defmodule Formatting do - use Proto - - defresponse optional(list_of(Types.TextEdit)) - end - - defmodule CodeAction do - use Proto - - defresponse optional(list_of(Types.CodeAction)) - end - - defmodule CodeLens do - use Proto - defresponse optional(list_of(Types.CodeLens)) - end - - defmodule Completion do - use Proto - - defresponse optional(list_of(one_of([list_of(Types.Completion.Item), Types.Completion.List]))) - end - - defmodule DocumentSymbols do - use Proto - - defresponse optional(list_of(Types.Document.Symbol)) - end - - defmodule WorkspaceSymbol do - use Proto - - defresponse optional(list_of(Types.Workspace.Symbol)) - end - - defmodule Shutdown do - use Proto - # yeah, this is odd... it has no params - defresponse [] - end - - defmodule Hover do - use Proto - - defresponse optional(Types.Hover) - end - - defmodule ExecuteCommand do - use Proto - - defresponse optional(any()) - end - - # Client -> Server responses - - defmodule ShowMessage do - use Proto - defresponse optional(Types.Message.ActionItem) - end - - use Typespecs, for: :responses -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/client_capabilities.ex deleted file mode 100644 index 5e9dc4e0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CallHierarchy.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/options.ex b/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/options.ex deleted file mode 100644 index 9dd4a126..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CallHierarchy.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/registration/options.ex deleted file mode 100644 index 9faa191c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/call_hierarchy/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CallHierarchy.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/cancel/params.ex b/apps/protocol/lib/generated/expert/protocol/types/cancel/params.ex deleted file mode 100644 index a9587430..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/cancel/params.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Cancel.Params do - alias Expert.Proto - use Proto - deftype id: one_of([integer(), string()]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/change_annotation.ex b/apps/protocol/lib/generated/expert/protocol/types/change_annotation.ex deleted file mode 100644 index 196d6b5f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/change_annotation.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ChangeAnnotation do - alias Expert.Proto - use Proto - - deftype description: optional(string()), - label: string(), - needs_confirmation: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/change_annotation/identifier.ex b/apps/protocol/lib/generated/expert/protocol/types/change_annotation/identifier.ex deleted file mode 100644 index 31f55063..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/change_annotation/identifier.ex +++ /dev/null @@ -1,4 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ChangeAnnotation.Identifier do - @type t :: String.t() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/client_capabilities.ex deleted file mode 100644 index a9738a63..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/client_capabilities.ex +++ /dev/null @@ -1,13 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype experimental: optional(any()), - general: optional(Types.General.ClientCapabilities), - notebook_document: optional(Types.Notebook.Document.ClientCapabilities), - text_document: optional(Types.TextDocument.ClientCapabilities), - window: optional(Types.Window.ClientCapabilities), - workspace: optional(Types.Workspace.ClientCapabilities) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action.ex deleted file mode 100644 index 3ad16db4..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action.ex +++ /dev/null @@ -1,21 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Disabled do - use Proto - deftype reason: string() - end - - use Proto - - deftype command: optional(Types.Command), - data: optional(any()), - diagnostics: optional(list_of(Types.Diagnostic)), - disabled: optional(Expert.Protocol.Types.CodeAction.Disabled), - edit: optional(Types.Workspace.Edit), - is_preferred: optional(boolean()), - kind: optional(Types.CodeAction.Kind), - title: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/client_capabilities.ex deleted file mode 100644 index 83989aae..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/client_capabilities.ex +++ /dev/null @@ -1,32 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule CodeActionKind do - use Proto - deftype value_set: list_of(Types.CodeAction.Kind) - end - - defmodule CodeActionLiteralSupport do - use Proto - deftype code_action_kind: Expert.Protocol.Types.CodeAction.ClientCapabilities.CodeActionKind - end - - defmodule ResolveSupport do - use Proto - deftype properties: list_of(string()) - end - - use Proto - - deftype code_action_literal_support: - optional(Expert.Protocol.Types.CodeAction.ClientCapabilities.CodeActionLiteralSupport), - data_support: optional(boolean()), - disabled_support: optional(boolean()), - dynamic_registration: optional(boolean()), - honors_change_annotations: optional(boolean()), - is_preferred_support: optional(boolean()), - resolve_support: - optional(Expert.Protocol.Types.CodeAction.ClientCapabilities.ResolveSupport) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/context.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/context.ex deleted file mode 100644 index 749652c5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/context.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.Context do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype diagnostics: list_of(Types.Diagnostic), - only: optional(list_of(Types.CodeAction.Kind)), - trigger_kind: optional(Types.CodeAction.Trigger.Kind) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/kind.ex deleted file mode 100644 index cb271df6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/kind.ex +++ /dev/null @@ -1,15 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.Kind do - alias Expert.Proto - use Proto - - defenum empty: "", - quick_fix: "quickfix", - refactor: "refactor", - refactor_extract: "refactor.extract", - refactor_inline: "refactor.inline", - refactor_rewrite: "refactor.rewrite", - source: "source", - source_organize_imports: "source.organizeImports", - source_fix_all: "source.fixAll" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/options.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/options.ex deleted file mode 100644 index a6291e17..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype code_action_kinds: optional(list_of(Types.CodeAction.Kind)), - resolve_provider: optional(boolean()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/params.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/params.ex deleted file mode 100644 index 12606d1a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/params.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype context: Types.CodeAction.Context, - partial_result_token: optional(Types.Progress.Token), - range: Types.Range, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_action/trigger/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/code_action/trigger/kind.ex deleted file mode 100644 index 1964bc3c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_action/trigger/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeAction.Trigger.Kind do - alias Expert.Proto - use Proto - defenum invoked: 1, automatic: 2 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_description.ex b/apps/protocol/lib/generated/expert/protocol/types/code_description.ex deleted file mode 100644 index d2bc8cb3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_description.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeDescription do - alias Expert.Proto - use Proto - deftype href: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_lens.ex b/apps/protocol/lib/generated/expert/protocol/types/code_lens.ex deleted file mode 100644 index 1c2e8d95..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_lens.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeLens do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype command: optional(Types.Command), data: optional(any()), range: Types.Range -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_lens/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/code_lens/client_capabilities.ex deleted file mode 100644 index 0ef685c8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_lens/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeLens.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_lens/options.ex b/apps/protocol/lib/generated/expert/protocol/types/code_lens/options.ex deleted file mode 100644 index 271a98eb..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_lens/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeLens.Options do - alias Expert.Proto - use Proto - deftype resolve_provider: optional(boolean()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_lens/params.ex b/apps/protocol/lib/generated/expert/protocol/types/code_lens/params.ex deleted file mode 100644 index 2e5df794..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_lens/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeLens.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype partial_result_token: optional(Types.Progress.Token), - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/code_lens/workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/code_lens/workspace/client_capabilities.ex deleted file mode 100644 index 10610323..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/code_lens/workspace/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CodeLens.Workspace.ClientCapabilities do - alias Expert.Proto - use Proto - deftype refresh_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/command.ex b/apps/protocol/lib/generated/expert/protocol/types/command.ex deleted file mode 100644 index 4d6704d3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/command.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Command do - alias Expert.Proto - use Proto - deftype arguments: optional(list_of(any())), command: string(), title: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/client_capabilities.ex deleted file mode 100644 index e998fd22..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/client_capabilities.ex +++ /dev/null @@ -1,59 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule CompletionItem do - use Proto - - deftype commit_characters_support: optional(boolean()), - deprecated_support: optional(boolean()), - documentation_format: optional(list_of(Types.Markup.Kind)), - insert_replace_support: optional(boolean()), - insert_text_mode_support: - optional(Expert.Protocol.Types.Completion.ClientCapabilities.InsertTextModeSupport), - label_details_support: optional(boolean()), - preselect_support: optional(boolean()), - resolve_support: - optional(Expert.Protocol.Types.Completion.ClientCapabilities.ResolveSupport), - snippet_support: optional(boolean()), - tag_support: optional(Expert.Protocol.Types.Completion.ClientCapabilities.TagSupport) - end - - defmodule CompletionItemKind do - use Proto - deftype value_set: optional(list_of(Types.Completion.Item.Kind)) - end - - defmodule CompletionList do - use Proto - deftype item_defaults: optional(list_of(string())) - end - - defmodule InsertTextModeSupport do - use Proto - deftype value_set: list_of(Types.InsertTextMode) - end - - defmodule ResolveSupport do - use Proto - deftype properties: list_of(string()) - end - - defmodule TagSupport do - use Proto - deftype value_set: list_of(Types.Completion.Item.Tag) - end - - use Proto - - deftype completion_item: - optional(Expert.Protocol.Types.Completion.ClientCapabilities.CompletionItem), - completion_item_kind: - optional(Expert.Protocol.Types.Completion.ClientCapabilities.CompletionItemKind), - completion_list: - optional(Expert.Protocol.Types.Completion.ClientCapabilities.CompletionList), - context_support: optional(boolean()), - dynamic_registration: optional(boolean()), - insert_text_mode: optional(Types.InsertTextMode) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/context.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/context.ex deleted file mode 100644 index f3be6d2e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/context.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Context do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype trigger_character: optional(string()), trigger_kind: Types.Completion.Trigger.Kind -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/item.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/item.ex deleted file mode 100644 index 784544f0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/item.ex +++ /dev/null @@ -1,26 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Item do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype additional_text_edits: optional(list_of(Types.TextEdit)), - command: optional(Types.Command), - commit_characters: optional(list_of(string())), - data: optional(any()), - deprecated: optional(boolean()), - detail: optional(string()), - documentation: optional(one_of([string(), Types.Markup.Content])), - filter_text: optional(string()), - insert_text: optional(string()), - insert_text_format: optional(Types.InsertTextFormat), - insert_text_mode: optional(Types.InsertTextMode), - kind: optional(Types.Completion.Item.Kind), - label: string(), - label_details: optional(Types.Completion.Item.LabelDetails), - preselect: optional(boolean()), - sort_text: optional(string()), - tags: optional(list_of(Types.Completion.Item.Tag)), - text_edit: optional(one_of([Types.TextEdit, Types.InsertReplaceEdit])), - text_edit_text: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/item/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/item/kind.ex deleted file mode 100644 index 9d69b4d1..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/item/kind.ex +++ /dev/null @@ -1,31 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Item.Kind do - alias Expert.Proto - use Proto - - defenum text: 1, - method: 2, - function: 3, - constructor: 4, - field: 5, - variable: 6, - class: 7, - interface: 8, - module: 9, - property: 10, - unit: 11, - value: 12, - enum: 13, - keyword: 14, - snippet: 15, - color: 16, - file: 17, - reference: 18, - folder: 19, - enum_member: 20, - constant: 21, - struct: 22, - event: 23, - operator: 24, - type_parameter: 25 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/item/label_details.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/item/label_details.ex deleted file mode 100644 index 4bd581ad..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/item/label_details.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Item.LabelDetails do - alias Expert.Proto - use Proto - deftype description: optional(string()), detail: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/item/tag.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/item/tag.ex deleted file mode 100644 index 2d8c8243..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/item/tag.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Item.Tag do - alias Expert.Proto - use Proto - defenum deprecated: 1 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/list.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/list.ex deleted file mode 100644 index fe625d1a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/list.ex +++ /dev/null @@ -1,27 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.List do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule EditRange do - use Proto - deftype insert: Types.Range, replace: Types.Range - end - - defmodule ItemDefaults do - use Proto - - deftype commit_characters: optional(list_of(string())), - data: optional(any()), - edit_range: - optional(one_of([Types.Range, Expert.Protocol.Types.Completion.List.EditRange])), - insert_text_format: optional(Types.InsertTextFormat), - insert_text_mode: optional(Types.InsertTextMode) - end - - use Proto - - deftype is_incomplete: boolean(), - item_defaults: optional(Expert.Protocol.Types.Completion.List.ItemDefaults), - items: list_of(Types.Completion.Item) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/options.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/options.ex deleted file mode 100644 index 47ec9d8d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/options.ex +++ /dev/null @@ -1,17 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Options do - alias Expert.Proto - - defmodule CompletionItem do - use Proto - deftype label_details_support: optional(boolean()) - end - - use Proto - - deftype all_commit_characters: optional(list_of(string())), - completion_item: optional(Expert.Protocol.Types.Completion.Options.CompletionItem), - resolve_provider: optional(boolean()), - trigger_characters: optional(list_of(string())), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/params.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/params.ex deleted file mode 100644 index 48ac20a2..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/params.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype context: optional(Types.Completion.Context), - partial_result_token: optional(Types.Progress.Token), - position: Types.Position, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/completion/trigger/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/completion/trigger/kind.ex deleted file mode 100644 index 13abba0a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/completion/trigger/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Completion.Trigger.Kind do - alias Expert.Proto - use Proto - defenum invoked: 1, trigger_character: 2, trigger_for_incomplete_completions: 3 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/create_file.ex b/apps/protocol/lib/generated/expert/protocol/types/create_file.ex deleted file mode 100644 index 29fbb49d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/create_file.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CreateFile do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype annotation_id: optional(Types.ChangeAnnotation.Identifier), - kind: literal("create"), - options: optional(Types.CreateFile.Options), - uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/create_file/options.ex b/apps/protocol/lib/generated/expert/protocol/types/create_file/options.ex deleted file mode 100644 index 0eb7491b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/create_file/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.CreateFile.Options do - alias Expert.Proto - use Proto - deftype ignore_if_exists: optional(boolean()), overwrite: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/declaration/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/declaration/client_capabilities.ex deleted file mode 100644 index ba32281a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/declaration/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Declaration.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), link_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/declaration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/declaration/options.ex deleted file mode 100644 index ecf4321f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/declaration/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Declaration.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/declaration/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/declaration/registration/options.ex deleted file mode 100644 index c3aec425..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/declaration/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Declaration.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/definition/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/definition/client_capabilities.ex deleted file mode 100644 index 5b5fa62c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/definition/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Definition.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), link_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/definition/options.ex b/apps/protocol/lib/generated/expert/protocol/types/definition/options.ex deleted file mode 100644 index ad27401e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/definition/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Definition.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/definition/params.ex b/apps/protocol/lib/generated/expert/protocol/types/definition/params.ex deleted file mode 100644 index e8b4312e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/definition/params.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Definition.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype partial_result_token: optional(Types.Progress.Token), - position: Types.Position, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/delete_file.ex b/apps/protocol/lib/generated/expert/protocol/types/delete_file.ex deleted file mode 100644 index 8ada2989..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/delete_file.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DeleteFile do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype annotation_id: optional(Types.ChangeAnnotation.Identifier), - kind: literal("delete"), - options: optional(Types.DeleteFile.Options), - uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/delete_file/options.ex b/apps/protocol/lib/generated/expert/protocol/types/delete_file/options.ex deleted file mode 100644 index 2a2c74a1..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/delete_file/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DeleteFile.Options do - alias Expert.Proto - use Proto - deftype ignore_if_not_exists: optional(boolean()), recursive: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic.ex deleted file mode 100644 index cb457815..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic.ex +++ /dev/null @@ -1,16 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype code: optional(one_of([integer(), string()])), - code_description: optional(Types.CodeDescription), - data: optional(any()), - message: string(), - range: Types.Range, - related_information: optional(list_of(Types.Diagnostic.RelatedInformation)), - severity: optional(Types.Diagnostic.Severity), - source: optional(string()), - tags: optional(list_of(Types.Diagnostic.Tag)) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/client_capabilities.ex deleted file mode 100644 index b703dbff..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), related_document_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/options.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/options.ex deleted file mode 100644 index a0be73f3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.Options do - alias Expert.Proto - use Proto - - deftype identifier: optional(string()), - inter_file_dependencies: boolean(), - work_done_progress: optional(boolean()), - workspace_diagnostics: boolean() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/registration/options.ex deleted file mode 100644 index f0493f99..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/registration/options.ex +++ /dev/null @@ -1,13 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - identifier: optional(string()), - inter_file_dependencies: boolean(), - work_done_progress: optional(boolean()), - workspace_diagnostics: boolean() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/related_information.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/related_information.ex deleted file mode 100644 index a300f8fa..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/related_information.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.RelatedInformation do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype location: Types.Location, message: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/severity.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/severity.ex deleted file mode 100644 index 9b86ac6e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/severity.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.Severity do - alias Expert.Proto - use Proto - defenum error: 1, warning: 2, information: 3, hint: 4 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/tag.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/tag.ex deleted file mode 100644 index 0f4759f1..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/tag.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.Tag do - alias Expert.Proto - use Proto - defenum unnecessary: 1, deprecated: 2 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/diagnostic/workspace/client_capabilities.ex deleted file mode 100644 index bded8e95..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/diagnostic/workspace/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Diagnostic.Workspace.ClientCapabilities do - alias Expert.Proto - use Proto - deftype refresh_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/client_capabilities.ex deleted file mode 100644 index 03e77bb6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeConfiguration.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/params.ex deleted file mode 100644 index 6bd449bc..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_configuration/params.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeConfiguration.Params do - alias Expert.Proto - use Proto - deftype settings: any() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_text_document/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_text_document/params.ex deleted file mode 100644 index e984c159..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_text_document/params.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeTextDocument.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype content_changes: list_of(Types.TextDocument.ContentChangeEvent), - text_document: Types.TextDocument.Versioned.Identifier -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/client_capabilities.ex deleted file mode 100644 index 22a1e16c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeWatchedFiles.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), relative_pattern_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/params.ex deleted file mode 100644 index 6e5365f9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeWatchedFiles.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype changes: list_of(Types.FileEvent) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/registration/options.ex deleted file mode 100644 index 9fe45520..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_change_watched_files/registration/options.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidChangeWatchedFiles.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype watchers: list_of(Types.FileSystemWatcher) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_close_text_document/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_close_text_document/params.ex deleted file mode 100644 index 647322a8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_close_text_document/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidCloseTextDocument.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype text_document: Types.TextDocument.Identifier -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_open_text_document/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_open_text_document/params.ex deleted file mode 100644 index df7c0121..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_open_text_document/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidOpenTextDocument.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype text_document: Types.TextDocument.Item -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/did_save_text_document/params.ex b/apps/protocol/lib/generated/expert/protocol/types/did_save_text_document/params.ex deleted file mode 100644 index dafa99dd..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/did_save_text_document/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.DidSaveTextDocument.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype text: optional(string()), text_document: Types.TextDocument.Identifier -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/color/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/color/client_capabilities.ex deleted file mode 100644 index ca0bb219..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/color/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Color.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/color/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/color/options.ex deleted file mode 100644 index b410f3d0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/color/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Color.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/color/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/color/registration/options.ex deleted file mode 100644 index 8ccd60fe..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/color/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Color.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/filter.ex b/apps/protocol/lib/generated/expert/protocol/types/document/filter.ex deleted file mode 100644 index 3c7494ac..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/filter.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Filter do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - defalias one_of([Types.TextDocument.Filter, Types.Notebook.Cell.TextDocument.Filter]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/formatting/client_capabilities.ex deleted file mode 100644 index 6b383fa5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Formatting.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/formatting/options.ex deleted file mode 100644 index 7094c366..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Formatting.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/params.ex b/apps/protocol/lib/generated/expert/protocol/types/document/formatting/params.ex deleted file mode 100644 index ff925ebd..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/formatting/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Formatting.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype options: Types.Formatting.Options, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/highlight/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/highlight/client_capabilities.ex deleted file mode 100644 index 2b446f4f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/highlight/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Highlight.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/highlight/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/highlight/options.ex deleted file mode 100644 index 74724d64..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/highlight/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Highlight.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/link/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/link/client_capabilities.ex deleted file mode 100644 index 2d4962b0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/link/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Link.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), tooltip_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/link/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/link/options.ex deleted file mode 100644 index 7b274caa..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/link/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Link.Options do - alias Expert.Proto - use Proto - deftype resolve_provider: optional(boolean()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/client_capabilities.ex deleted file mode 100644 index 2a47a9a3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.OnTypeFormatting.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/options.ex deleted file mode 100644 index 9b5fdda0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/on_type_formatting/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.OnTypeFormatting.Options do - alias Expert.Proto - use Proto - deftype first_trigger_character: string(), more_trigger_character: optional(list_of(string())) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/client_capabilities.ex deleted file mode 100644 index 8d578145..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.RangeFormatting.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/options.ex deleted file mode 100644 index a8676f6b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/range_formatting/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.RangeFormatting.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/selector.ex b/apps/protocol/lib/generated/expert/protocol/types/document/selector.ex deleted file mode 100644 index b43bff12..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/selector.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Selector do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - defalias list_of(Types.Document.Filter) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/symbol.ex b/apps/protocol/lib/generated/expert/protocol/types/document/symbol.ex deleted file mode 100644 index 39f1b660..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/symbol.ex +++ /dev/null @@ -1,15 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Symbol do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype children: optional(list_of(Types.Document.Symbol)), - deprecated: optional(boolean()), - detail: optional(string()), - kind: Types.Symbol.Kind, - name: string(), - range: Types.Range, - selection_range: Types.Range, - tags: optional(list_of(Types.Symbol.Tag)) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/document/symbol/client_capabilities.ex deleted file mode 100644 index a4cd6ca8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/client_capabilities.ex +++ /dev/null @@ -1,25 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Symbol.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule SymbolKind do - use Proto - deftype value_set: optional(list_of(Types.Symbol.Kind)) - end - - defmodule TagSupport do - use Proto - deftype value_set: list_of(Types.Symbol.Tag) - end - - use Proto - - deftype dynamic_registration: optional(boolean()), - hierarchical_document_symbol_support: optional(boolean()), - label_support: optional(boolean()), - symbol_kind: - optional(Expert.Protocol.Types.Document.Symbol.ClientCapabilities.SymbolKind), - tag_support: - optional(Expert.Protocol.Types.Document.Symbol.ClientCapabilities.TagSupport) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/options.ex b/apps/protocol/lib/generated/expert/protocol/types/document/symbol/options.ex deleted file mode 100644 index a2b8c54e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Symbol.Options do - alias Expert.Proto - use Proto - deftype label: optional(string()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/params.ex b/apps/protocol/lib/generated/expert/protocol/types/document/symbol/params.ex deleted file mode 100644 index 52bedbc2..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/document/symbol/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Document.Symbol.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype partial_result_token: optional(Types.Progress.Token), - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/error_codes.ex b/apps/protocol/lib/generated/expert/protocol/types/error_codes.ex deleted file mode 100644 index 1eee55ce..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/error_codes.ex +++ /dev/null @@ -1,13 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ErrorCodes do - alias Expert.Proto - use Proto - - defenum parse_error: -32_700, - invalid_request: -32_600, - method_not_found: -32_601, - invalid_params: -32_602, - internal_error: -32_603, - server_not_initialized: -32_002, - unknown_error_code: -32_001 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/execute_command/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/execute_command/client_capabilities.ex deleted file mode 100644 index 92734a10..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/execute_command/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ExecuteCommand.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/execute_command/options.ex b/apps/protocol/lib/generated/expert/protocol/types/execute_command/options.ex deleted file mode 100644 index e7d87f42..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/execute_command/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ExecuteCommand.Options do - alias Expert.Proto - use Proto - deftype commands: list_of(string()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/execute_command/params.ex b/apps/protocol/lib/generated/expert/protocol/types/execute_command/params.ex deleted file mode 100644 index a10f7483..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/execute_command/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ExecuteCommand.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype arguments: optional(list_of(any())), - command: string(), - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/execute_command/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/execute_command/registration/options.ex deleted file mode 100644 index 6670a8ec..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/execute_command/registration/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ExecuteCommand.Registration.Options do - alias Expert.Proto - use Proto - deftype commands: list_of(string()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/failure_handling/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/failure_handling/kind.ex deleted file mode 100644 index 2f493d2b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/failure_handling/kind.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FailureHandling.Kind do - alias Expert.Proto - use Proto - - defenum abort: "abort", - transactional: "transactional", - text_only_transactional: "textOnlyTransactional", - undo: "undo" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_change_type.ex b/apps/protocol/lib/generated/expert/protocol/types/file_change_type.ex deleted file mode 100644 index 5c0005e6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_change_type.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileChangeType do - alias Expert.Proto - use Proto - defenum created: 1, changed: 2, deleted: 3 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_event.ex b/apps/protocol/lib/generated/expert/protocol/types/file_event.ex deleted file mode 100644 index 0548ffa5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_event.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileEvent do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype type: Types.FileChangeType, uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/client_capabilities.ex deleted file mode 100644 index 5929a9f0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/client_capabilities.ex +++ /dev/null @@ -1,13 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.ClientCapabilities do - alias Expert.Proto - use Proto - - deftype did_create: optional(boolean()), - did_delete: optional(boolean()), - did_rename: optional(boolean()), - dynamic_registration: optional(boolean()), - will_create: optional(boolean()), - will_delete: optional(boolean()), - will_rename: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/filter.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/filter.ex deleted file mode 100644 index c30fd576..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/filter.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Filter do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype pattern: Types.FileOperation.Pattern, scheme: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/options.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/options.ex deleted file mode 100644 index eda1ac4b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/options.ex +++ /dev/null @@ -1,13 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype did_create: optional(Types.FileOperation.Registration.Options), - did_delete: optional(Types.FileOperation.Registration.Options), - did_rename: optional(Types.FileOperation.Registration.Options), - will_create: optional(Types.FileOperation.Registration.Options), - will_delete: optional(Types.FileOperation.Registration.Options), - will_rename: optional(Types.FileOperation.Registration.Options) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern.ex deleted file mode 100644 index bba8f71f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Pattern do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype glob: string(), - matches: optional(Types.FileOperation.Pattern.Kind), - options: optional(Types.FileOperation.Pattern.Options) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/kind.ex deleted file mode 100644 index 93930230..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Pattern.Kind do - alias Expert.Proto - use Proto - defenum file: "file", folder: "folder" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/options.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/options.ex deleted file mode 100644 index 7b1ab11e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/pattern/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Pattern.Options do - alias Expert.Proto - use Proto - deftype ignore_case: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_operation/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/file_operation/registration/options.ex deleted file mode 100644 index dba1ca71..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_operation/registration/options.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileOperation.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype filters: list_of(Types.FileOperation.Filter) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/file_system_watcher.ex b/apps/protocol/lib/generated/expert/protocol/types/file_system_watcher.ex deleted file mode 100644 index 412f5a96..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/file_system_watcher.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FileSystemWatcher do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype glob_pattern: Types.GlobPattern, kind: optional(Types.Watch.Kind) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/folding_range/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/folding_range/client_capabilities.ex deleted file mode 100644 index 36acb428..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/folding_range/client_capabilities.ex +++ /dev/null @@ -1,25 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FoldingRange.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule FoldingRange do - use Proto - deftype collapsed_text: optional(boolean()) - end - - defmodule FoldingRangeKind do - use Proto - deftype value_set: optional(list_of(Types.FoldingRange.Kind)) - end - - use Proto - - deftype dynamic_registration: optional(boolean()), - folding_range: - optional(Expert.Protocol.Types.FoldingRange.ClientCapabilities.FoldingRange), - folding_range_kind: - optional(Expert.Protocol.Types.FoldingRange.ClientCapabilities.FoldingRangeKind), - line_folding_only: optional(boolean()), - range_limit: optional(integer()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/folding_range/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/folding_range/kind.ex deleted file mode 100644 index 6b3eff01..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/folding_range/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FoldingRange.Kind do - alias Expert.Proto - use Proto - defenum comment: "comment", imports: "imports", region: "region" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/folding_range/options.ex b/apps/protocol/lib/generated/expert/protocol/types/folding_range/options.ex deleted file mode 100644 index d83dc3e6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/folding_range/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FoldingRange.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/folding_range/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/folding_range/registration/options.ex deleted file mode 100644 index 24c459d0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/folding_range/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.FoldingRange.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/formatting/options.ex b/apps/protocol/lib/generated/expert/protocol/types/formatting/options.ex deleted file mode 100644 index a468e85b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/formatting/options.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Formatting.Options do - alias Expert.Proto - use Proto - - deftype insert_final_newline: optional(boolean()), - insert_spaces: boolean(), - tab_size: integer(), - trim_final_newlines: optional(boolean()), - trim_trailing_whitespace: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/general/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/general/client_capabilities.ex deleted file mode 100644 index 34ffc02f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/general/client_capabilities.ex +++ /dev/null @@ -1,18 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.General.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule StaleRequestSupport do - use Proto - deftype cancel: boolean(), retry_on_content_modified: list_of(string()) - end - - use Proto - - deftype markdown: optional(Types.Markdown.ClientCapabilities), - position_encodings: optional(list_of(Types.Position.Encoding.Kind)), - regular_expressions: optional(Types.RegularExpressions.ClientCapabilities), - stale_request_support: - optional(Expert.Protocol.Types.General.ClientCapabilities.StaleRequestSupport) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/glob_pattern.ex b/apps/protocol/lib/generated/expert/protocol/types/glob_pattern.ex deleted file mode 100644 index 8c8050e2..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/glob_pattern.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.GlobPattern do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - defalias one_of([Types.Pattern, Types.RelativePattern]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/hover.ex b/apps/protocol/lib/generated/expert/protocol/types/hover.ex deleted file mode 100644 index 29dcb3ea..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/hover.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Hover do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype contents: - one_of([Types.Markup.Content, Types.MarkedString, list_of(Types.MarkedString)]), - range: optional(Types.Range) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/hover/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/hover/client_capabilities.ex deleted file mode 100644 index 4c4e3542..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/hover/client_capabilities.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Hover.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype content_format: optional(list_of(Types.Markup.Kind)), - dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/hover/options.ex b/apps/protocol/lib/generated/expert/protocol/types/hover/options.ex deleted file mode 100644 index f9716a92..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/hover/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Hover.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/hover/params.ex b/apps/protocol/lib/generated/expert/protocol/types/hover/params.ex deleted file mode 100644 index 33b21c43..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/hover/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Hover.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype position: Types.Position, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/implementation/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/implementation/client_capabilities.ex deleted file mode 100644 index f6dbe9b5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/implementation/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Implementation.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), link_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/implementation/options.ex b/apps/protocol/lib/generated/expert/protocol/types/implementation/options.ex deleted file mode 100644 index 49a91073..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/implementation/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Implementation.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/implementation/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/implementation/registration/options.ex deleted file mode 100644 index 1348b0bc..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/implementation/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Implementation.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/initialize/params.ex b/apps/protocol/lib/generated/expert/protocol/types/initialize/params.ex deleted file mode 100644 index a82a7ef6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/initialize/params.ex +++ /dev/null @@ -1,26 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Initialize.Params do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule ClientInfo1 do - use Proto - deftype name: string(), version: optional(string()) - end - - use Proto - - deftype capabilities: Types.ClientCapabilities, - client_info: optional(Expert.Protocol.Types.Initialize.Params.ClientInfo1), - initialization_options: optional(any()), - locale: optional(string()), - process_id: one_of([integer(), nil]), - root_path: optional(one_of([string(), nil])), - root_uri: one_of([string(), nil]), - trace: - optional( - one_of([literal("off"), literal("messages"), literal("compact"), literal("verbose")]) - ), - work_done_token: optional(Types.Progress.Token), - workspace_folders: optional(one_of([list_of(Types.Workspace.Folder), nil])) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/initialize/result.ex b/apps/protocol/lib/generated/expert/protocol/types/initialize/result.ex deleted file mode 100644 index f67eafb3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/initialize/result.ex +++ /dev/null @@ -1,15 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Initialize.Result do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule ServerInfo do - use Proto - deftype name: string(), version: optional(string()) - end - - use Proto - - deftype capabilities: Types.ServerCapabilities, - server_info: optional(Expert.Protocol.Types.Initialize.Result.ServerInfo) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/client_capabilities.ex deleted file mode 100644 index e452bf11..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/client_capabilities.ex +++ /dev/null @@ -1,15 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlayHint.ClientCapabilities do - alias Expert.Proto - - defmodule ResolveSupport do - use Proto - deftype properties: list_of(string()) - end - - use Proto - - deftype dynamic_registration: optional(boolean()), - resolve_support: - optional(Expert.Protocol.Types.InlayHint.ClientCapabilities.ResolveSupport) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/options.ex b/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/options.ex deleted file mode 100644 index dcca9d72..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlayHint.Options do - alias Expert.Proto - use Proto - deftype resolve_provider: optional(boolean()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/registration/options.ex deleted file mode 100644 index 066c448a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint/registration/options.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlayHint.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - resolve_provider: optional(boolean()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint_workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/inlay_hint_workspace/client_capabilities.ex deleted file mode 100644 index eea32e90..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inlay_hint_workspace/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlayHintWorkspace.ClientCapabilities do - alias Expert.Proto - use Proto - deftype refresh_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inline_value/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/inline_value/client_capabilities.ex deleted file mode 100644 index cfe897af..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inline_value/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlineValue.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inline_value/options.ex b/apps/protocol/lib/generated/expert/protocol/types/inline_value/options.ex deleted file mode 100644 index b7318185..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inline_value/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlineValue.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inline_value/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/inline_value/registration/options.ex deleted file mode 100644 index 17b80cc7..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inline_value/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlineValue.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/inline_value/workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/inline_value/workspace/client_capabilities.ex deleted file mode 100644 index ef3a01d8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/inline_value/workspace/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InlineValue.Workspace.ClientCapabilities do - alias Expert.Proto - use Proto - deftype refresh_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/insert_replace_edit.ex b/apps/protocol/lib/generated/expert/protocol/types/insert_replace_edit.ex deleted file mode 100644 index 2d1bf556..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/insert_replace_edit.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InsertReplaceEdit do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype insert: Types.Range, new_text: string(), replace: Types.Range -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/insert_text_format.ex b/apps/protocol/lib/generated/expert/protocol/types/insert_text_format.ex deleted file mode 100644 index 3657d2b9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/insert_text_format.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InsertTextFormat do - alias Expert.Proto - use Proto - defenum plain_text: 1, snippet: 2 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/insert_text_mode.ex b/apps/protocol/lib/generated/expert/protocol/types/insert_text_mode.ex deleted file mode 100644 index ee48f1ab..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/insert_text_mode.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.InsertTextMode do - alias Expert.Proto - use Proto - defenum as_is: 1, adjust_indentation: 2 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/client_capabilities.ex deleted file mode 100644 index 3941e6b3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LinkedEditingRange.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/options.ex b/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/options.ex deleted file mode 100644 index dd2a2f28..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LinkedEditingRange.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/registration/options.ex deleted file mode 100644 index 060b7f97..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/linked_editing_range/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LinkedEditingRange.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/location.ex b/apps/protocol/lib/generated/expert/protocol/types/location.ex deleted file mode 100644 index cd6e0796..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/location.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Location do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype range: Types.Range, uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/location/link.ex b/apps/protocol/lib/generated/expert/protocol/types/location/link.ex deleted file mode 100644 index cb607fae..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/location/link.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Location.Link do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype origin_selection_range: optional(Types.Range), - target_range: Types.Range, - target_selection_range: Types.Range, - target_uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/log_message/params.ex b/apps/protocol/lib/generated/expert/protocol/types/log_message/params.ex deleted file mode 100644 index c22cae29..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/log_message/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LogMessage.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype message: string(), type: Types.Message.Type -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/lsp_error_codes.ex b/apps/protocol/lib/generated/expert/protocol/types/lsp_error_codes.ex deleted file mode 100644 index afdb0a95..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/lsp_error_codes.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LSPErrorCodes do - alias Expert.Proto - use Proto - - defenum request_failed: -32_803, - server_cancelled: -32_802, - content_modified: -32_801, - request_cancelled: -32_800 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/lsp_object.ex b/apps/protocol/lib/generated/expert/protocol/types/lsp_object.ex deleted file mode 100644 index f0914b00..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/lsp_object.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.LSPObject do - alias Expert.Proto - use Proto - deftype [] -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/markdown/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/markdown/client_capabilities.ex deleted file mode 100644 index 208f2088..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/markdown/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Markdown.ClientCapabilities do - alias Expert.Proto - use Proto - deftype allowed_tags: optional(list_of(string())), parser: string(), version: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/marked_string.ex b/apps/protocol/lib/generated/expert/protocol/types/marked_string.ex deleted file mode 100644 index 45e41fbf..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/marked_string.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.MarkedString do - alias Expert.Proto - - defmodule MarkedString do - use Proto - deftype language: string(), value: string() - end - - use Proto - defalias one_of([string(), Expert.Protocol.Types.MarkedString.MarkedString]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/markup/content.ex b/apps/protocol/lib/generated/expert/protocol/types/markup/content.ex deleted file mode 100644 index 7d79d30e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/markup/content.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Markup.Content do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype kind: Types.Markup.Kind, value: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/markup/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/markup/kind.ex deleted file mode 100644 index 47326be9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/markup/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Markup.Kind do - alias Expert.Proto - use Proto - defenum plain_text: "plaintext", markdown: "markdown" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/message/action_item.ex b/apps/protocol/lib/generated/expert/protocol/types/message/action_item.ex deleted file mode 100644 index 9ce129f5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/message/action_item.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Message.ActionItem do - alias Expert.Proto - use Proto - deftype title: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/message/type.ex b/apps/protocol/lib/generated/expert/protocol/types/message/type.ex deleted file mode 100644 index 868a9af4..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/message/type.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Message.Type do - alias Expert.Proto - use Proto - defenum error: 1, warning: 2, info: 3, log: 4 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/moniker/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/moniker/client_capabilities.ex deleted file mode 100644 index 4cc0332c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/moniker/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Moniker.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/moniker/options.ex b/apps/protocol/lib/generated/expert/protocol/types/moniker/options.ex deleted file mode 100644 index be3f1d92..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/moniker/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Moniker.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/moniker/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/moniker/registration/options.ex deleted file mode 100644 index 228f012d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/moniker/registration/options.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Moniker.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/cell/text_document/filter.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/cell/text_document/filter.ex deleted file mode 100644 index d2286f41..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/cell/text_document/filter.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Cell.TextDocument.Filter do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype language: optional(string()), - notebook: one_of([string(), Types.Notebook.Document.Filter]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/document/client_capabilities.ex deleted file mode 100644 index d74f9cd5..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/client_capabilities.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Document.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype synchronization: Types.Notebook.Document.Sync.ClientCapabilities -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/filter.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/document/filter.ex deleted file mode 100644 index 81858b53..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/filter.ex +++ /dev/null @@ -1,27 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Document.Filter do - alias Expert.Proto - - defmodule NotebookDocumentFilter do - use Proto - deftype notebook_type: string(), pattern: optional(string()), scheme: optional(string()) - end - - defmodule NotebookDocumentFilter1 do - use Proto - deftype notebook_type: optional(string()), pattern: optional(string()), scheme: string() - end - - defmodule NotebookDocumentFilter2 do - use Proto - deftype notebook_type: optional(string()), pattern: string(), scheme: optional(string()) - end - - use Proto - - defalias one_of([ - Expert.Protocol.Types.Notebook.Document.Filter.NotebookDocumentFilter, - Expert.Protocol.Types.Notebook.Document.Filter.NotebookDocumentFilter1, - Expert.Protocol.Types.Notebook.Document.Filter.NotebookDocumentFilter2 - ]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/client_capabilities.ex deleted file mode 100644 index 965d9bd2..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/client_capabilities.ex +++ /dev/null @@ -1,8 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Document.Sync.ClientCapabilities do - alias Expert.Proto - use Proto - - deftype dynamic_registration: optional(boolean()), - execution_summary_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/options.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/options.ex deleted file mode 100644 index 21d1d7ea..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/options.ex +++ /dev/null @@ -1,40 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Document.Sync.Options do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Cells do - use Proto - deftype language: string() - end - - defmodule Cells1 do - use Proto - deftype language: string() - end - - defmodule NotebookSelector do - use Proto - - deftype cells: optional(list_of(Expert.Protocol.Types.Notebook.Document.Sync.Options.Cells)), - notebook: one_of([string(), Types.Notebook.Document.Filter]) - end - - defmodule NotebookSelector1 do - use Proto - - deftype cells: list_of(Expert.Protocol.Types.Notebook.Document.Sync.Options.Cells1), - notebook: optional(one_of([string(), Types.Notebook.Document.Filter])) - end - - use Proto - - deftype notebook_selector: - list_of( - one_of([ - Expert.Protocol.Types.Notebook.Document.Sync.Options.NotebookSelector, - Expert.Protocol.Types.Notebook.Document.Sync.Options.NotebookSelector1 - ]) - ), - save: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/registration/options.ex deleted file mode 100644 index 4d46661d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/notebook/document/sync/registration/options.ex +++ /dev/null @@ -1,45 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Notebook.Document.Sync.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Cells2 do - use Proto - deftype language: string() - end - - defmodule Cells3 do - use Proto - deftype language: string() - end - - defmodule NotebookSelector2 do - use Proto - - deftype cells: - optional( - list_of(Expert.Protocol.Types.Notebook.Document.Sync.Registration.Options.Cells2) - ), - notebook: one_of([string(), Types.Notebook.Document.Filter]) - end - - defmodule NotebookSelector3 do - use Proto - - deftype cells: - list_of(Expert.Protocol.Types.Notebook.Document.Sync.Registration.Options.Cells3), - notebook: optional(one_of([string(), Types.Notebook.Document.Filter])) - end - - use Proto - - deftype id: optional(string()), - notebook_selector: - list_of( - one_of([ - Expert.Protocol.Types.Notebook.Document.Sync.Registration.Options.NotebookSelector2, - Expert.Protocol.Types.Notebook.Document.Sync.Registration.Options.NotebookSelector3 - ]) - ), - save: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/pattern.ex b/apps/protocol/lib/generated/expert/protocol/types/pattern.ex deleted file mode 100644 index bb59bc0b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/pattern.ex +++ /dev/null @@ -1,4 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Pattern do - @type t :: String.t() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/position.ex b/apps/protocol/lib/generated/expert/protocol/types/position.ex deleted file mode 100644 index fb00273f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/position.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Position do - alias Expert.Proto - use Proto - deftype character: integer(), line: integer() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/position/encoding/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/position/encoding/kind.ex deleted file mode 100644 index 6fb803a8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/position/encoding/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Position.Encoding.Kind do - alias Expert.Proto - use Proto - defenum utf8: "utf-8", utf16: "utf-16", utf32: "utf-32" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/prepare_support_default_behavior.ex b/apps/protocol/lib/generated/expert/protocol/types/prepare_support_default_behavior.ex deleted file mode 100644 index 2a6a53c9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/prepare_support_default_behavior.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.PrepareSupportDefaultBehavior do - alias Expert.Proto - use Proto - defenum identifier: 1 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/progress/params.ex b/apps/protocol/lib/generated/expert/protocol/types/progress/params.ex deleted file mode 100644 index 88be4f27..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/progress/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Progress.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype token: Types.Progress.Token, value: any() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/progress/token.ex b/apps/protocol/lib/generated/expert/protocol/types/progress/token.ex deleted file mode 100644 index 43686a81..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/progress/token.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Progress.Token do - alias Expert.Proto - use Proto - defalias one_of([integer(), string()]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/client_capabilities.ex deleted file mode 100644 index 2ed3a693..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/client_capabilities.ex +++ /dev/null @@ -1,19 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.PublishDiagnostics.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule TagSupport do - use Proto - deftype value_set: list_of(Types.Diagnostic.Tag) - end - - use Proto - - deftype code_description_support: optional(boolean()), - data_support: optional(boolean()), - related_information: optional(boolean()), - tag_support: - optional(Expert.Protocol.Types.PublishDiagnostics.ClientCapabilities.TagSupport), - version_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/params.ex b/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/params.ex deleted file mode 100644 index 9e26370b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/publish_diagnostics/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.PublishDiagnostics.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype diagnostics: list_of(Types.Diagnostic), uri: string(), version: optional(integer()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/range.ex b/apps/protocol/lib/generated/expert/protocol/types/range.ex deleted file mode 100644 index b0bc1bfc..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/range.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Range do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype end: Types.Position, start: Types.Position -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/reference/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/reference/client_capabilities.ex deleted file mode 100644 index e8ba6270..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/reference/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Reference.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/reference/context.ex b/apps/protocol/lib/generated/expert/protocol/types/reference/context.ex deleted file mode 100644 index 66518ff8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/reference/context.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Reference.Context do - alias Expert.Proto - use Proto - deftype include_declaration: boolean() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/reference/options.ex b/apps/protocol/lib/generated/expert/protocol/types/reference/options.ex deleted file mode 100644 index 1bc42d64..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/reference/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Reference.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/reference/params.ex b/apps/protocol/lib/generated/expert/protocol/types/reference/params.ex deleted file mode 100644 index b61cfe47..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/reference/params.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Reference.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype context: Types.Reference.Context, - partial_result_token: optional(Types.Progress.Token), - position: Types.Position, - text_document: Types.TextDocument.Identifier, - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/registration.ex b/apps/protocol/lib/generated/expert/protocol/types/registration.ex deleted file mode 100644 index c5e24e0f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/registration.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Registration do - alias Expert.Proto - use Proto - deftype id: string(), method: string(), register_options: optional(any()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/registration/params.ex b/apps/protocol/lib/generated/expert/protocol/types/registration/params.ex deleted file mode 100644 index 23fc0dd8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/registration/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Registration.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype registrations: list_of(Types.Registration) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/regular_expressions/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/regular_expressions/client_capabilities.ex deleted file mode 100644 index 44cc951b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/regular_expressions/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.RegularExpressions.ClientCapabilities do - alias Expert.Proto - use Proto - deftype engine: string(), version: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/relative_pattern.ex b/apps/protocol/lib/generated/expert/protocol/types/relative_pattern.ex deleted file mode 100644 index 64107d03..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/relative_pattern.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.RelativePattern do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype base_uri: one_of([Types.Workspace.Folder, string()]), pattern: Types.Pattern -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/rename/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/rename/client_capabilities.ex deleted file mode 100644 index 6e73460b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/rename/client_capabilities.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Rename.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype dynamic_registration: optional(boolean()), - honors_change_annotations: optional(boolean()), - prepare_support: optional(boolean()), - prepare_support_default_behavior: optional(Types.PrepareSupportDefaultBehavior) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/rename/options.ex b/apps/protocol/lib/generated/expert/protocol/types/rename/options.ex deleted file mode 100644 index 06c609e0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/rename/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Rename.Options do - alias Expert.Proto - use Proto - deftype prepare_provider: optional(boolean()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/rename_file.ex b/apps/protocol/lib/generated/expert/protocol/types/rename_file.ex deleted file mode 100644 index 0b6f4323..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/rename_file.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.RenameFile do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype annotation_id: optional(Types.ChangeAnnotation.Identifier), - kind: literal("rename"), - new_uri: string(), - old_uri: string(), - options: optional(Types.RenameFile.Options) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/rename_file/options.ex b/apps/protocol/lib/generated/expert/protocol/types/rename_file/options.ex deleted file mode 100644 index 9c819384..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/rename_file/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.RenameFile.Options do - alias Expert.Proto - use Proto - deftype ignore_if_exists: optional(boolean()), overwrite: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/resource_operation/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/resource_operation/kind.ex deleted file mode 100644 index a2a4e2bd..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/resource_operation/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ResourceOperation.Kind do - alias Expert.Proto - use Proto - defenum create: "create", rename: "rename", delete: "delete" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/save/options.ex b/apps/protocol/lib/generated/expert/protocol/types/save/options.ex deleted file mode 100644 index 83991424..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/save/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Save.Options do - alias Expert.Proto - use Proto - deftype include_text: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/selection_range/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/selection_range/client_capabilities.ex deleted file mode 100644 index 1afa51d3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/selection_range/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SelectionRange.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/selection_range/options.ex b/apps/protocol/lib/generated/expert/protocol/types/selection_range/options.ex deleted file mode 100644 index e1a39156..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/selection_range/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SelectionRange.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/selection_range/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/selection_range/registration/options.ex deleted file mode 100644 index dce3bd31..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/selection_range/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SelectionRange.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/client_capabilities.ex deleted file mode 100644 index e63204f4..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/client_capabilities.ex +++ /dev/null @@ -1,40 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SemanticTokens.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Full do - use Proto - deftype delta: optional(boolean()) - end - - defmodule Range do - use Proto - deftype [] - end - - defmodule Requests do - use Proto - - deftype full: - optional( - one_of([boolean(), Expert.Protocol.Types.SemanticTokens.ClientCapabilities.Full]) - ), - range: - optional( - one_of([boolean(), Expert.Protocol.Types.SemanticTokens.ClientCapabilities.Range]) - ) - end - - use Proto - - deftype augments_syntax_tokens: optional(boolean()), - dynamic_registration: optional(boolean()), - formats: list_of(Types.TokenFormat), - multiline_token_support: optional(boolean()), - overlapping_token_support: optional(boolean()), - requests: Expert.Protocol.Types.SemanticTokens.ClientCapabilities.Requests, - server_cancel_support: optional(boolean()), - token_modifiers: list_of(string()), - token_types: list_of(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/legend.ex b/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/legend.ex deleted file mode 100644 index c04a3620..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/legend.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SemanticTokens.Legend do - alias Expert.Proto - use Proto - deftype token_modifiers: list_of(string()), token_types: list_of(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/options.ex b/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/options.ex deleted file mode 100644 index 1cff6522..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/options.ex +++ /dev/null @@ -1,23 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SemanticTokens.Options do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Full do - use Proto - deftype delta: optional(boolean()) - end - - defmodule Range do - use Proto - deftype [] - end - - use Proto - - deftype full: optional(one_of([boolean(), Expert.Protocol.Types.SemanticTokens.Options.Full])), - legend: Types.SemanticTokens.Legend, - range: - optional(one_of([boolean(), Expert.Protocol.Types.SemanticTokens.Options.Range])), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/registration/options.ex deleted file mode 100644 index ebd55c48..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/registration/options.ex +++ /dev/null @@ -1,33 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SemanticTokens.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Full1 do - use Proto - deftype delta: optional(boolean()) - end - - defmodule Range1 do - use Proto - deftype [] - end - - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - full: - optional( - one_of([boolean(), Expert.Protocol.Types.SemanticTokens.Registration.Options.Full1]) - ), - id: optional(string()), - legend: Types.SemanticTokens.Legend, - range: - optional( - one_of([ - boolean(), - Expert.Protocol.Types.SemanticTokens.Registration.Options.Range1 - ]) - ), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/workspace/client_capabilities.ex deleted file mode 100644 index 3c03c673..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/semantic_tokens/workspace/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SemanticTokens.Workspace.ClientCapabilities do - alias Expert.Proto - use Proto - deftype refresh_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/server_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/server_capabilities.ex deleted file mode 100644 index 53bf2867..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/server_capabilities.ex +++ /dev/null @@ -1,140 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ServerCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Workspace do - use Proto - - deftype file_operations: optional(Types.FileOperation.Options), - workspace_folders: optional(Types.Workspace.FoldersServerCapabilities) - end - - use Proto - - deftype call_hierarchy_provider: - optional( - one_of([ - boolean(), - Types.CallHierarchy.Options, - Types.CallHierarchy.Registration.Options - ]) - ), - code_action_provider: optional(one_of([boolean(), Types.CodeAction.Options])), - code_lens_provider: optional(Types.CodeLens.Options), - color_provider: - optional( - one_of([ - boolean(), - Types.Document.Color.Options, - Types.Document.Color.Registration.Options - ]) - ), - completion_provider: optional(Types.Completion.Options), - declaration_provider: - optional( - one_of([ - boolean(), - Types.Declaration.Options, - Types.Declaration.Registration.Options - ]) - ), - definition_provider: optional(one_of([boolean(), Types.Definition.Options])), - diagnostic_provider: - optional(one_of([Types.Diagnostic.Options, Types.Diagnostic.Registration.Options])), - document_formatting_provider: - optional(one_of([boolean(), Types.Document.Formatting.Options])), - document_highlight_provider: - optional(one_of([boolean(), Types.Document.Highlight.Options])), - document_link_provider: optional(Types.Document.Link.Options), - document_on_type_formatting_provider: optional(Types.Document.OnTypeFormatting.Options), - document_range_formatting_provider: - optional(one_of([boolean(), Types.Document.RangeFormatting.Options])), - document_symbol_provider: optional(one_of([boolean(), Types.Document.Symbol.Options])), - execute_command_provider: optional(Types.ExecuteCommand.Options), - experimental: optional(any()), - folding_range_provider: - optional( - one_of([ - boolean(), - Types.FoldingRange.Options, - Types.FoldingRange.Registration.Options - ]) - ), - hover_provider: optional(one_of([boolean(), Types.Hover.Options])), - implementation_provider: - optional( - one_of([ - boolean(), - Types.Implementation.Options, - Types.Implementation.Registration.Options - ]) - ), - inlay_hint_provider: - optional( - one_of([boolean(), Types.InlayHint.Options, Types.InlayHint.Registration.Options]) - ), - inline_value_provider: - optional( - one_of([ - boolean(), - Types.InlineValue.Options, - Types.InlineValue.Registration.Options - ]) - ), - linked_editing_range_provider: - optional( - one_of([ - boolean(), - Types.LinkedEditingRange.Options, - Types.LinkedEditingRange.Registration.Options - ]) - ), - moniker_provider: - optional( - one_of([boolean(), Types.Moniker.Options, Types.Moniker.Registration.Options]) - ), - notebook_document_sync: - optional( - one_of([ - Types.Notebook.Document.Sync.Options, - Types.Notebook.Document.Sync.Registration.Options - ]) - ), - position_encoding: optional(Types.Position.Encoding.Kind), - references_provider: optional(one_of([boolean(), Types.Reference.Options])), - rename_provider: optional(one_of([boolean(), Types.Rename.Options])), - selection_range_provider: - optional( - one_of([ - boolean(), - Types.SelectionRange.Options, - Types.SelectionRange.Registration.Options - ]) - ), - semantic_tokens_provider: - optional( - one_of([Types.SemanticTokens.Options, Types.SemanticTokens.Registration.Options]) - ), - signature_help_provider: optional(Types.SignatureHelp.Options), - text_document_sync: - optional(one_of([Types.TextDocument.Sync.Options, Types.TextDocument.Sync.Kind])), - type_definition_provider: - optional( - one_of([ - boolean(), - Types.TypeDefinition.Options, - Types.TypeDefinition.Registration.Options - ]) - ), - type_hierarchy_provider: - optional( - one_of([ - boolean(), - Types.TypeHierarchy.Options, - Types.TypeHierarchy.Registration.Options - ]) - ), - workspace: optional(Expert.Protocol.Types.ServerCapabilities.Workspace), - workspace_symbol_provider: optional(one_of([boolean(), Types.Workspace.Symbol.Options])) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/show_document/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/show_document/client_capabilities.ex deleted file mode 100644 index 1a7918f4..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/show_document/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ShowDocument.ClientCapabilities do - alias Expert.Proto - use Proto - deftype support: boolean() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/show_message/params.ex b/apps/protocol/lib/generated/expert/protocol/types/show_message/params.ex deleted file mode 100644 index 8d2d9c9a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/show_message/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ShowMessage.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype message: string(), type: Types.Message.Type -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/show_message_request/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/show_message_request/client_capabilities.ex deleted file mode 100644 index 63ae2281..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/show_message_request/client_capabilities.ex +++ /dev/null @@ -1,16 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ShowMessageRequest.ClientCapabilities do - alias Expert.Proto - - defmodule MessageActionItem do - use Proto - deftype additional_properties_support: optional(boolean()) - end - - use Proto - - deftype message_action_item: - optional( - Expert.Protocol.Types.ShowMessageRequest.ClientCapabilities.MessageActionItem - ) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/show_message_request/params.ex b/apps/protocol/lib/generated/expert/protocol/types/show_message_request/params.ex deleted file mode 100644 index 06bb25ba..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/show_message_request/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.ShowMessageRequest.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype actions: optional(list_of(Types.Message.ActionItem)), - message: string(), - type: Types.Message.Type -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/signature_help/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/signature_help/client_capabilities.ex deleted file mode 100644 index 250c1549..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/signature_help/client_capabilities.ex +++ /dev/null @@ -1,28 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SignatureHelp.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule ParameterInformation do - use Proto - deftype label_offset_support: optional(boolean()) - end - - defmodule SignatureInformation do - use Proto - - deftype active_parameter_support: optional(boolean()), - documentation_format: optional(list_of(Types.Markup.Kind)), - parameter_information: - optional( - Expert.Protocol.Types.SignatureHelp.ClientCapabilities.ParameterInformation - ) - end - - use Proto - - deftype context_support: optional(boolean()), - dynamic_registration: optional(boolean()), - signature_information: - optional(Expert.Protocol.Types.SignatureHelp.ClientCapabilities.SignatureInformation) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/signature_help/options.ex b/apps/protocol/lib/generated/expert/protocol/types/signature_help/options.ex deleted file mode 100644 index 99828247..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/signature_help/options.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.SignatureHelp.Options do - alias Expert.Proto - use Proto - - deftype retrigger_characters: optional(list_of(string())), - trigger_characters: optional(list_of(string())), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/symbol/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/symbol/kind.ex deleted file mode 100644 index 990f89fb..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/symbol/kind.ex +++ /dev/null @@ -1,32 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Symbol.Kind do - alias Expert.Proto - use Proto - - defenum 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 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/symbol/tag.ex b/apps/protocol/lib/generated/expert/protocol/types/symbol/tag.ex deleted file mode 100644 index a59090f9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/symbol/tag.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Symbol.Tag do - alias Expert.Proto - use Proto - defenum deprecated: 1 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/client_capabilities.ex deleted file mode 100644 index 62aedfa6..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/client_capabilities.ex +++ /dev/null @@ -1,37 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype call_hierarchy: optional(Types.CallHierarchy.ClientCapabilities), - code_action: optional(Types.CodeAction.ClientCapabilities), - code_lens: optional(Types.CodeLens.ClientCapabilities), - color_provider: optional(Types.Document.Color.ClientCapabilities), - completion: optional(Types.Completion.ClientCapabilities), - declaration: optional(Types.Declaration.ClientCapabilities), - definition: optional(Types.Definition.ClientCapabilities), - diagnostic: optional(Types.Diagnostic.ClientCapabilities), - document_highlight: optional(Types.Document.Highlight.ClientCapabilities), - document_link: optional(Types.Document.Link.ClientCapabilities), - document_symbol: optional(Types.Document.Symbol.ClientCapabilities), - folding_range: optional(Types.FoldingRange.ClientCapabilities), - formatting: optional(Types.Document.Formatting.ClientCapabilities), - hover: optional(Types.Hover.ClientCapabilities), - implementation: optional(Types.Implementation.ClientCapabilities), - inlay_hint: optional(Types.InlayHint.ClientCapabilities), - inline_value: optional(Types.InlineValue.ClientCapabilities), - linked_editing_range: optional(Types.LinkedEditingRange.ClientCapabilities), - moniker: optional(Types.Moniker.ClientCapabilities), - on_type_formatting: optional(Types.Document.OnTypeFormatting.ClientCapabilities), - publish_diagnostics: optional(Types.PublishDiagnostics.ClientCapabilities), - range_formatting: optional(Types.Document.RangeFormatting.ClientCapabilities), - references: optional(Types.Reference.ClientCapabilities), - rename: optional(Types.Rename.ClientCapabilities), - selection_range: optional(Types.SelectionRange.ClientCapabilities), - semantic_tokens: optional(Types.SemanticTokens.ClientCapabilities), - signature_help: optional(Types.SignatureHelp.ClientCapabilities), - synchronization: optional(Types.TextDocument.Sync.ClientCapabilities), - type_definition: optional(Types.TypeDefinition.ClientCapabilities), - type_hierarchy: optional(Types.TypeHierarchy.ClientCapabilities) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/content_change_event.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/content_change_event.ex deleted file mode 100644 index e8117245..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/content_change_event.ex +++ /dev/null @@ -1,22 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.ContentChangeEvent do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule TextDocumentContentChangeEvent do - use Proto - deftype range: Types.Range, range_length: optional(integer()), text: string() - end - - defmodule TextDocumentContentChangeEvent1 do - use Proto - deftype text: string() - end - - use Proto - - defalias one_of([ - Expert.Protocol.Types.TextDocument.ContentChangeEvent.TextDocumentContentChangeEvent, - Expert.Protocol.Types.TextDocument.ContentChangeEvent.TextDocumentContentChangeEvent1 - ]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/edit.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/edit.ex deleted file mode 100644 index af2284fd..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/edit.ex +++ /dev/null @@ -1,9 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Edit do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype edits: list_of(one_of([Types.TextEdit, Types.TextEdit.Annotated])), - text_document: Types.TextDocument.OptionalVersioned.Identifier -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/filter.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/filter.ex deleted file mode 100644 index 88ef77c3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/filter.ex +++ /dev/null @@ -1,27 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Filter do - alias Expert.Proto - - defmodule TextDocumentFilter do - use Proto - deftype language: string(), pattern: optional(string()), scheme: optional(string()) - end - - defmodule TextDocumentFilter1 do - use Proto - deftype language: optional(string()), pattern: optional(string()), scheme: string() - end - - defmodule TextDocumentFilter2 do - use Proto - deftype language: optional(string()), pattern: string(), scheme: optional(string()) - end - - use Proto - - defalias one_of([ - Expert.Protocol.Types.TextDocument.Filter.TextDocumentFilter, - Expert.Protocol.Types.TextDocument.Filter.TextDocumentFilter1, - Expert.Protocol.Types.TextDocument.Filter.TextDocumentFilter2 - ]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/identifier.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/identifier.ex deleted file mode 100644 index 9f20d51d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/identifier.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Identifier do - alias Expert.Proto - use Proto - deftype uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/item.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/item.ex deleted file mode 100644 index 96f59367..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/item.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Item do - alias Expert.Proto - use Proto - deftype language_id: string(), text: string(), uri: string(), version: integer() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/optional_versioned/identifier.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/optional_versioned/identifier.ex deleted file mode 100644 index 043e12b0..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/optional_versioned/identifier.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.OptionalVersioned.Identifier do - alias Expert.Proto - use Proto - deftype uri: string(), version: one_of([integer(), nil]) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/client_capabilities.ex deleted file mode 100644 index 950e13cb..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/client_capabilities.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Sync.ClientCapabilities do - alias Expert.Proto - use Proto - - deftype did_save: optional(boolean()), - dynamic_registration: optional(boolean()), - will_save: optional(boolean()), - will_save_wait_until: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/kind.ex deleted file mode 100644 index 1c891445..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Sync.Kind do - alias Expert.Proto - use Proto - defenum none: 0, full: 1, incremental: 2 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/options.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/options.ex deleted file mode 100644 index 9332d3f1..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/sync/options.ex +++ /dev/null @@ -1,12 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Sync.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype change: optional(Types.TextDocument.Sync.Kind), - open_close: optional(boolean()), - save: optional(one_of([boolean(), Types.Save.Options])), - will_save: optional(boolean()), - will_save_wait_until: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_document/versioned/identifier.ex b/apps/protocol/lib/generated/expert/protocol/types/text_document/versioned/identifier.ex deleted file mode 100644 index 108c252d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_document/versioned/identifier.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextDocument.Versioned.Identifier do - alias Expert.Proto - use Proto - deftype uri: string(), version: integer() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_edit.ex b/apps/protocol/lib/generated/expert/protocol/types/text_edit.ex deleted file mode 100644 index 4d2bf890..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_edit.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextEdit do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype new_text: string(), range: Types.Range -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/text_edit/annotated.ex b/apps/protocol/lib/generated/expert/protocol/types/text_edit/annotated.ex deleted file mode 100644 index fa8c4ddc..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/text_edit/annotated.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TextEdit.Annotated do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype annotation_id: Types.ChangeAnnotation.Identifier, new_text: string(), range: Types.Range -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/token_format.ex b/apps/protocol/lib/generated/expert/protocol/types/token_format.ex deleted file mode 100644 index 1277598d..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/token_format.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TokenFormat do - alias Expert.Proto - use Proto - defenum relative: "relative" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/trace_values.ex b/apps/protocol/lib/generated/expert/protocol/types/trace_values.ex deleted file mode 100644 index 04846420..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/trace_values.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TraceValues do - alias Expert.Proto - use Proto - defenum off: "off", messages: "messages", verbose: "verbose" -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_definition/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/type_definition/client_capabilities.ex deleted file mode 100644 index f89a97ef..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_definition/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeDefinition.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()), link_support: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_definition/options.ex b/apps/protocol/lib/generated/expert/protocol/types/type_definition/options.ex deleted file mode 100644 index 535ac3b9..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_definition/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeDefinition.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_definition/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/type_definition/registration/options.ex deleted file mode 100644 index e3839eb1..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_definition/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeDefinition.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/client_capabilities.ex deleted file mode 100644 index a0bb193a..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/client_capabilities.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeHierarchy.ClientCapabilities do - alias Expert.Proto - use Proto - deftype dynamic_registration: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/options.ex b/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/options.ex deleted file mode 100644 index b3abf94e..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeHierarchy.Options do - alias Expert.Proto - use Proto - deftype work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/registration/options.ex b/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/registration/options.ex deleted file mode 100644 index 22bf931b..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/type_hierarchy/registration/options.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.TypeHierarchy.Registration.Options do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype document_selector: one_of([Types.Document.Selector, nil]), - id: optional(string()), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/watch/kind.ex b/apps/protocol/lib/generated/expert/protocol/types/watch/kind.ex deleted file mode 100644 index 68681f57..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/watch/kind.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Watch.Kind do - alias Expert.Proto - use Proto - defenum create: 1, change: 2, delete: 4 -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/window/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/window/client_capabilities.ex deleted file mode 100644 index 6e8c9cc2..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/window/client_capabilities.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Window.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype show_document: optional(Types.ShowDocument.ClientCapabilities), - show_message: optional(Types.ShowMessageRequest.ClientCapabilities), - work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/begin.ex b/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/begin.ex deleted file mode 100644 index d9f534e8..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/begin.ex +++ /dev/null @@ -1,11 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.WorkDone.Progress.Begin do - alias Expert.Proto - use Proto - - deftype cancellable: optional(boolean()), - kind: literal("begin"), - message: optional(string()), - percentage: optional(integer()), - title: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/create/params.ex b/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/create/params.ex deleted file mode 100644 index 921a2f19..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/create/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.WorkDone.Progress.Create.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype token: Types.Progress.Token -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/end.ex b/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/end.ex deleted file mode 100644 index a71e5c42..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/end.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.WorkDone.Progress.End do - alias Expert.Proto - use Proto - deftype kind: literal("end"), message: optional(string()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/params.ex b/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/params.ex deleted file mode 100644 index 371376af..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/params.ex +++ /dev/null @@ -1,7 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.WorkDone.Progress.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - deftype work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/report.ex b/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/report.ex deleted file mode 100644 index 91774af3..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/work_done/progress/report.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.WorkDone.Progress.Report do - alias Expert.Proto - use Proto - - deftype cancellable: optional(boolean()), - kind: literal("report"), - message: optional(string()), - percentage: optional(integer()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/client_capabilities.ex deleted file mode 100644 index b8c608a7..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/client_capabilities.ex +++ /dev/null @@ -1,21 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype apply_edit: optional(boolean()), - code_lens: optional(Types.CodeLens.Workspace.ClientCapabilities), - configuration: optional(boolean()), - diagnostics: optional(Types.Diagnostic.Workspace.ClientCapabilities), - did_change_configuration: optional(Types.DidChangeConfiguration.ClientCapabilities), - did_change_watched_files: optional(Types.DidChangeWatchedFiles.ClientCapabilities), - execute_command: optional(Types.ExecuteCommand.ClientCapabilities), - file_operations: optional(Types.FileOperation.ClientCapabilities), - inlay_hint: optional(Types.InlayHintWorkspace.ClientCapabilities), - inline_value: optional(Types.InlineValue.Workspace.ClientCapabilities), - semantic_tokens: optional(Types.SemanticTokens.Workspace.ClientCapabilities), - symbol: optional(Types.Workspace.Symbol.ClientCapabilities), - workspace_edit: optional(Types.Workspace.Edit.ClientCapabilities), - workspace_folders: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/edit.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/edit.ex deleted file mode 100644 index 76b931ad..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/edit.ex +++ /dev/null @@ -1,20 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Edit do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype change_annotations: optional(map_of(Types.ChangeAnnotation)), - changes: optional(map_of(list_of(Types.TextEdit))), - document_changes: - optional( - list_of( - one_of([ - Types.TextDocument.Edit, - Types.CreateFile, - Types.RenameFile, - Types.DeleteFile - ]) - ) - ) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/edit/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/edit/client_capabilities.ex deleted file mode 100644 index e25434af..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/edit/client_capabilities.ex +++ /dev/null @@ -1,21 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Edit.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule ChangeAnnotationSupport do - use Proto - deftype groups_on_label: optional(boolean()) - end - - use Proto - - deftype change_annotation_support: - optional( - Expert.Protocol.Types.Workspace.Edit.ClientCapabilities.ChangeAnnotationSupport - ), - document_changes: optional(boolean()), - failure_handling: optional(Types.FailureHandling.Kind), - normalizes_line_endings: optional(boolean()), - resource_operations: optional(list_of(Types.ResourceOperation.Kind)) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/folder.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/folder.ex deleted file mode 100644 index e4656297..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/folder.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Folder do - alias Expert.Proto - use Proto - deftype name: string(), uri: string() -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/folders_server_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/folders_server_capabilities.ex deleted file mode 100644 index 00a22729..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/folders_server_capabilities.ex +++ /dev/null @@ -1,8 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.FoldersServerCapabilities do - alias Expert.Proto - use Proto - - deftype change_notifications: optional(one_of([string(), boolean()])), - supported: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol.ex deleted file mode 100644 index 93a6679c..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol.ex +++ /dev/null @@ -1,19 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Symbol do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule Location do - use Proto - deftype uri: string() - end - - use Proto - - deftype container_name: optional(string()), - data: optional(any()), - kind: Types.Symbol.Kind, - location: one_of([Types.Location, Expert.Protocol.Types.Workspace.Symbol.Location]), - name: string(), - tags: optional(list_of(Types.Symbol.Tag)) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/client_capabilities.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/client_capabilities.ex deleted file mode 100644 index ce84fc33..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/client_capabilities.ex +++ /dev/null @@ -1,30 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Symbol.ClientCapabilities do - alias Expert.Proto - alias Expert.Protocol.Types - - defmodule ResolveSupport do - use Proto - deftype properties: list_of(string()) - end - - defmodule SymbolKind do - use Proto - deftype value_set: optional(list_of(Types.Symbol.Kind)) - end - - defmodule TagSupport do - use Proto - deftype value_set: list_of(Types.Symbol.Tag) - end - - use Proto - - deftype dynamic_registration: optional(boolean()), - resolve_support: - optional(Expert.Protocol.Types.Workspace.Symbol.ClientCapabilities.ResolveSupport), - symbol_kind: - optional(Expert.Protocol.Types.Workspace.Symbol.ClientCapabilities.SymbolKind), - tag_support: - optional(Expert.Protocol.Types.Workspace.Symbol.ClientCapabilities.TagSupport) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/options.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/options.ex deleted file mode 100644 index 856f76ff..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/options.ex +++ /dev/null @@ -1,6 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Symbol.Options do - alias Expert.Proto - use Proto - deftype resolve_provider: optional(boolean()), work_done_progress: optional(boolean()) -end diff --git a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/params.ex b/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/params.ex deleted file mode 100644 index 00fa822f..00000000 --- a/apps/protocol/lib/generated/expert/protocol/types/workspace/symbol/params.ex +++ /dev/null @@ -1,10 +0,0 @@ -# This file's contents are auto-generated. Do not edit. -defmodule Expert.Protocol.Types.Workspace.Symbol.Params do - alias Expert.Proto - alias Expert.Protocol.Types - use Proto - - deftype partial_result_token: optional(Types.Progress.Token), - query: string(), - work_done_token: optional(Types.Progress.Token) -end diff --git a/apps/protocol/mix.exs b/apps/protocol/mix.exs deleted file mode 100644 index 06877c05..00000000 --- a/apps/protocol/mix.exs +++ /dev/null @@ -1,40 +0,0 @@ -defmodule Expert.Protocol.MixProject do - use Mix.Project - Code.require_file("../../mix_includes.exs") - - def project do - [ - app: :protocol, - env: Mix.env(), - version: "0.7.2", - elixir: "~> 1.15", - start_permanent: Mix.env() == :prod, - deps: deps(), - dialyzer: Mix.Dialyzer.config(add_apps: [:jason]), - consolidate_protocols: Mix.env() != :test, - elixirc_paths: elixirc_paths(Mix.env()) - ] - end - - # Run "mix help compile.app" to learn about applications. - def application do - [ - extra_applications: [:logger] - ] - end - - defp elixirc_paths(:test), do: ~w(lib test/support) - defp elixirc_paths(_), do: ~w(lib) - - # Run "mix help deps" to learn about dependencies. - defp deps do - [ - {:forge, path: "../forge", env: Mix.env()}, - Mix.Credo.dependency(), - Mix.Dialyzer.dependency(), - {:jason, "~> 1.4", optional: true}, - {:patch, "~> 0.15", only: [:test]}, - {:proto, path: "../proto", env: Mix.env()} - ] - end -end diff --git a/apps/protocol/mix.lock b/apps/protocol/mix.lock deleted file mode 100644 index 79ae9a96..00000000 --- a/apps/protocol/mix.lock +++ /dev/null @@ -1,15 +0,0 @@ -%{ - "benchee": {:hex, :benchee, "1.3.1", "c786e6a76321121a44229dde3988fc772bca73ea75170a73fd5f4ddf1af95ccf", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "76224c58ea1d0391c8309a8ecbfe27d71062878f59bd41a390266bf4ac1cc56d"}, - "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, - "credo": {:hex, :credo, "1.7.11", "d3e805f7ddf6c9c854fd36f089649d7cf6ba74c42bc3795d587814e3c9847102", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "56826b4306843253a66e47ae45e98e7d284ee1f95d53d1612bb483f88a8cf219"}, - "deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"}, - "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"}, - "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, - "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, - "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, - "patch": {:hex, :patch, "0.15.0", "947dd6a8b24a2d2d1137721f20bb96a8feb4f83248e7b4ad88b4871d52807af5", [:mix], [], "hexpm", "e8dadf9b57b30e92f6b2b1ce2f7f57700d14c66d4ed56ee27777eb73fb77e58d"}, - "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, - "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, - "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, - "stream_data": {:hex, :stream_data, "1.1.3", "15fdb14c64e84437901258bb56fc7d80aaf6ceaf85b9324f359e219241353bfb", [:mix], [], "hexpm", "859eb2be72d74be26c1c4f272905667672a52e44f743839c57c7ee73a1a66420"}, -} diff --git a/apps/protocol/test/expert/proto_test.exs b/apps/protocol/test/expert/proto_test.exs deleted file mode 100644 index 7580a80c..00000000 --- a/apps/protocol/test/expert/proto_test.exs +++ /dev/null @@ -1,769 +0,0 @@ -defmodule Expert.ProtoTest do - alias Expert.Proto - alias Expert.Proto.Convert - alias Expert.Proto.LspTypes - alias Expert.Protocol.Types - alias Expert.Test.Protocol.Fixtures.LspProtocol - alias Forge.Document - - import LspProtocol - - require LspTypes.ErrorCodes - - use ExUnit.Case - use Patch - - defmodule Child do - use Proto - - deftype name: string() - end - - describe "string fields" do - defmodule StringField do - use Proto - - deftype string_field: string() - end - - test "can parse a string field" do - assert {:ok, val} = StringField.parse(%{"stringField" => "value"}) - assert val.string_field == "value" - end - - test "rejects nil string fields" do - assert {:error, {:invalid_value, :string_field, nil}} = - StringField.parse(%{"stringField" => nil}) - end - end - - describe "integer fields" do - defmodule IntegerField do - use Proto - deftype int_field: integer() - end - - test "can parse an integer field" do - assert {:ok, val} = IntegerField.parse(%{"intField" => 494}) - assert val.int_field == 494 - end - - test "rejects nil int fields" do - assert {:error, {:invalid_value, :int_field, "string"}} = - IntegerField.parse(%{"intField" => "string"}) - end - end - - describe "float fields" do - defmodule FloatField do - use Proto - deftype float_field: float() - end - - test "can parse a float field" do - assert {:ok, val} = FloatField.parse(%{"floatField" => 494.02}) - assert val.float_field == 494.02 - end - - test "rejects nil float fields" do - assert {:error, {:invalid_value, :float_field, "string"}} = - FloatField.parse(%{"floatField" => "string"}) - end - end - - describe "list fields" do - defmodule ListField do - use Proto - deftype list_field: list_of(integer()) - end - - test "can parse a list field" do - assert {:ok, proto} = ListField.parse(%{"listField" => [1, 2, 3]}) - assert proto.list_field == [1, 2, 3] - end - - test "rejecting invalid list of integers" do - assert {:error, {:invalid_value, :list_field, 99}} = ListField.parse(%{"listField" => 99}) - - assert {:error, {:invalid_value, :list_field, "hi"}} = - ListField.parse(%{"listField" => ["hi"]}) - - assert {:ok, result} = ListField.parse(%{"listField" => [99]}) - assert result.list_field == [99] - end - end - - describe "tuple fields" do - defmodule TupleField do - use Proto - deftype tuple_field: tuple_of([integer(), string(), map_of(string())]) - end - - test "can be parsed" do - assert {:ok, proto} = - TupleField.parse(%{"tupleField" => [1, "hello", %{"k" => "3", "v" => "9"}]}) - - assert proto.tuple_field == {1, "hello", %{"k" => "3", "v" => "9"}} - end - - test "can be encoded" do - proto = TupleField.new(tuple_field: {1, "hello", %{"k" => "v"}}) - - assert {:ok, encoded} = encode_and_decode(proto) - assert encoded["tupleField"] == [1, "hello", %{"k" => "v"}] - end - end - - describe "proto fields" do - defmodule SingleParent do - use Proto - - deftype name: string(), child: Child - end - - test "can parse another proto" do - assert {:ok, parent} = - SingleParent.parse(%{ - "name" => "stinky", - "child" => %{"name" => "Smelly"} - }) - - assert parent.name == "stinky" - assert parent.child.name == "Smelly" - end - - test "fails to parse another proto" do - assert {:error, {:invalid_map, "bad"}} == - SingleParent.parse(%{"name" => "stinky", "child" => "bad"}) - - assert {:error, {:missing_keys, ["name"], Child}} == - SingleParent.parse(%{"name" => "parent", "child" => %{"oof" => "not good"}}) - end - end - - describe "type aliases" do - defmodule TypeAlias do - use Proto - defalias one_of([string(), list_of(string())]) - end - - defmodule UsesAlias do - use Proto - - deftype alias: type_alias(TypeAlias), name: string() - end - - test "parses a single item correctly" do - assert {:ok, uses} = UsesAlias.parse(%{"name" => "uses", "alias" => "foo"}) - assert uses.name == "uses" - assert uses.alias == "foo" - end - - test "parses a list correctly" do - assert {:ok, uses} = UsesAlias.parse(%{"name" => "uses", "alias" => ["foo", "bar"]}) - assert uses.name == "uses" - assert uses.alias == ~w(foo bar) - end - - test "encodes correctly" do - assert {:ok, encoded} = encode_and_decode(UsesAlias.new(alias: "hi", name: "easy")) - assert encoded["alias"] == "hi" - assert encoded["name"] == "easy" - end - - test "parse fails if the type isn't correct" do - assert {:error, {:incorrect_type, _, %{}}} = - UsesAlias.parse(%{"name" => "ua", "alias" => %{}}) - end - end - - describe "optional fields" do - defmodule OptionalString do - use Proto - deftype required_string: string(), maybe_there: optional(string()) - end - - test "optional fields can be parsed" do - assert {:ok, proto} = - OptionalString.parse(%{"requiredString" => "req", "maybeThere" => "is_there"}) - - assert proto.required_string == "req" - assert proto.maybe_there == "is_there" - end - - test "optional fields can be omitted" do - assert {:ok, proto} = OptionalString.parse(%{"requiredString" => "req"}) - - assert proto.required_string == "req" - assert proto.maybe_there == nil - end - end - - describe "literal string fields" do - defmodule LiteralString do - use Proto - - deftype name: literal("name"), value: string() - end - - test "it should parse correctly" do - assert {:ok, proto} = LiteralString.parse(%{"name" => "name", "value" => "val"}) - assert proto.name == "name" - assert proto.value == "val" - end - - test "parse should fail if the value isn't the expected value" do - assert {:error, {:invalid_value, :name, "not_name"}} = - LiteralString.parse(%{"name" => "not_name", "value" => "val"}) - end - end - - describe "literal list fields" do - defmodule LiteralList do - use Proto - - deftype name: string(), keys: literal([1, 2, 9, 10]) - end - - test "it should parse correctly" do - assert {:ok, _} = LiteralList.parse(%{"name" => "ll", "keys" => [1, 2, 9, 10]}) - end - - test "parse should fail if the list isn't correct" do - assert {:error, {:invalid_value, :keys, _}} = - LiteralList.parse(%{"name" => "name", "keys" => [9, 2, 1, 10]}) - end - end - - describe "any field" do - defmodule AnyTest do - use Proto - deftype any_list: list_of(any()), any_toplevel: any(), any_optional: optional(any()) - end - - test "it should parse correctly" do - assert {:ok, proto} = - AnyTest.parse(%{ - "anyList" => [1, 3, "a", "b", [43]], - "anyToplevel" => 999, - "anyOptional" => ["any"] - }) - - assert proto.any_list == [1, 3, "a", "b", [43]] - assert proto.any_toplevel == 999 - assert proto.any_optional == ["any"] - end - - test "it should let an optional field be omitted" do - assert {:ok, proto} = - AnyTest.parse(%{ - "anyList" => [1, 3, "a", "b", [43]], - "anyToplevel" => 999 - }) - - assert proto.any_optional == nil - end - end - - describe "constants" do - defmodule ConstantTest do - use Proto - - defenum(good: 1, bad: 2, ugly: 3) - end - - defmodule UsesConstants do - use Proto - deftype name: string(), state: ConstantTest - end - - test "it should define a constant module" do - require ConstantTest - assert ConstantTest.good() == 1 - assert ConstantTest.bad() == 2 - assert ConstantTest.ugly() == 3 - end - - test "constants should parse" do - assert {:ok, :good} == ConstantTest.parse(1) - assert {:ok, :bad} == ConstantTest.parse(2) - assert {:ok, :ugly} == ConstantTest.parse(3) - assert {:error, {:invalid_constant, 4}} = ConstantTest.parse(4) - end - - test "constants should parse when used as values" do - assert {:ok, proto} = UsesConstants.parse(%{"name" => "Clint", "state" => 1}) - assert proto.name == "Clint" - assert proto.state == :good - end - - test "constants should render as their values" do - assert {:ok, proto} = UsesConstants.parse(%{"name" => "Clint", "state" => 2}) - assert {:ok, encoded} = Jason.encode(proto) - assert {:ok, decoded} = Jason.decode(encoded) - assert 2 == decoded["state"] - end - end - - describe "constructors" do - defmodule RequiredFields do - use Proto - - deftype name: string(), value: optional(string()), age: integer() - end - - test "required fields are required" do - assert_raise ArgumentError, fn -> - RequiredFields.new() - end - - assert_raise ArgumentError, fn -> - RequiredFields.new(name: "hi", value: "good") - end - - assert RequiredFields.new(name: "hi", value: "good", age: 29) - end - end - - def with_document_store(_) do - document = """ - defmodule MyTest do - def add(a, b), do: a + b - end - """ - - file_uri = "file:///file.ex" - {:ok, _} = start_supervised(Document.Store) - Document.Store.open(file_uri, document, 1) - {:ok, document} = Document.Store.fetch(file_uri) - {:ok, uri: file_uri, document: document} - end - - describe "notifications" do - setup [:with_document_store] - - defmodule Notif.Params do - use Proto - - deftype line: integer(), - notice_message: string(), - column: integer() - end - - defmodule Notif do - use Proto - - defnotification "textDocument/somethingHappened", Notif.Params - end - - test "parse fills out the notification" do - assert {:ok, params} = - params_for(Notif, line: 3, column: 5, notice_message: "This went wrong") - - assert {:ok, notif} = Notif.parse(params) - - assert notif.method == "textDocument/somethingHappened" - assert notif.jsonrpc == "2.0" - assert notif.lsp.line == 3 - assert notif.lsp.column == 5 - assert notif.lsp.notice_message == "This went wrong" - end - - test "the base request is not filled out when parse is called" do - assert {:ok, params} = - params_for(Notif, line: 3, column: 5, notice_message: "This went wrong") - - assert {:ok, notif} = Notif.parse(params) - - refute notif.line - refute notif.column - refute notif.notice_message - end - - test "to_native fills out the elixir fields" do - assert {:ok, params} = - params_for(Notif, line: 3, column: 5, notice_message: "This went wrong") - - assert {:ok, notif} = Notif.parse(params) - assert {:ok, notif} = Convert.to_native(notif) - - assert notif.line == 3 - assert notif.column == 5 - assert notif.notice_message == "This went wrong" - end - - defmodule Notif.WithTextDoc.Params do - use Proto - - deftype text_document: Types.TextDocument.Identifier - end - - defmodule Notif.WithTextDoc do - use Proto - - defnotification "notif/withTextDoc", Notif.WithTextDoc.Params - end - - test "to_native fills out the source file", ctx do - assert {:ok, params} = params_for(Notif.WithTextDoc.LSP, text_document: [uri: ctx.uri]) - assert {:ok, notif} = Notif.WithTextDoc.parse(params) - assert {:ok, notif} = Convert.to_native(notif) - assert %Document{} = notif.document - end - - defmodule Notif.WithPos.Params do - use Proto - - deftype text_document: Types.TextDocument.Identifier, - position: Types.Position - end - - defmodule Notif.WithPos do - use Proto - - defnotification "notif/WithPos", Notif.WithPos.Params - end - - test "to_native fills out a position", ctx do - assert {:ok, params} = - params_for(Notif.WithPos.LSP, - text_document: [uri: ctx.uri], - position: [line: 0, character: 0] - ) - - assert {:ok, notif} = Notif.WithPos.parse(params) - assert {:ok, notif} = Convert.to_native(notif) - - assert %Document{} = notif.document - assert %Document.Position{} = notif.position - - assert notif.position.line == 1 - assert notif.position.character == 1 - end - - defmodule Notif.WithRange.Params do - use Proto - - deftype text_document: Types.TextDocument.Identifier, - range: Types.Range - end - - defmodule Notif.WithRange do - use Proto - - defnotification "notif/WithRange", Notif.WithRange.Params - end - - test "to_native fills out a range", ctx do - assert {:ok, params} = - params_for(Notif.WithRange.LSP, - text_document: [uri: ctx.uri], - range: [ - start: [line: 0, character: 0], - end: [line: 0, character: 3] - ] - ) - - assert {:ok, notif} = Notif.WithRange.parse(params) - assert {:ok, notif} = Convert.to_native(notif) - - assert %Document{} = notif.document - assert %Document.Range{} = notif.range - assert notif.range.start.line == 1 - assert notif.range.start.character == 1 - assert notif.range.end.line == 1 - assert notif.range.end.character == 4 - end - end - - describe "requests" do - setup [:with_document_store] - - defmodule Req.Params do - use Proto - - deftype line: integer(), error_message: string() - end - - defmodule Req do - use Proto - - defrequest "something", Req.Params - end - - defmodule TextDocReq.Params do - use Proto - deftype text_document: Types.TextDocument.Identifier - end - - defmodule TextDocReq do - use Proto - - defrequest "textDoc", TextDocReq.Params - end - - test "parse fills out the request" do - assert {:ok, params} = params_for(Req, id: 3, line: 9, error_message: "borked") - assert {:ok, req} = Req.parse(params) - assert req.id == "3" - assert req.method == "something" - assert req.jsonrpc == "2.0" - assert req.lsp.line == 9 - assert req.lsp.error_message == "borked" - end - - test "the base request is not filled out via parsing" do - assert {:ok, params} = params_for(Req, id: 3, line: 9, error_message: "borked") - assert {:ok, req} = Req.parse(params) - - refute req.line - refute req.error_message - end - - test "parse fills out the raw lsp request" do - assert {:ok, params} = params_for(Req, id: 3, line: 9, error_message: "borked") - assert {:ok, req} = Req.parse(params) - assert req.lsp.line == 9 - assert req.lsp.error_message == "borked" - end - - test "to_native fills out the base request" do - assert {:ok, params} = params_for(Req, id: 3, line: 9, error_message: "borked") - assert {:ok, req} = Req.parse(params) - assert {:ok, req} = Convert.to_native(req) - - assert req.line == 9 - assert req.error_message == "borked" - end - - test "to_native fills out a source file", ctx do - assert {:ok, params} = params_for(TextDocReq.LSP, text_document: [uri: ctx.uri]) - assert {:ok, req} = TextDocReq.parse(params) - assert {:ok, ex_req} = Convert.to_native(req) - - assert %TextDocReq{} = ex_req - assert %Document{} = ex_req.document - end - - defmodule PositionReq.Params do - use Proto - - deftype text_document: Types.TextDocument.Identifier, - position: Types.Position - end - - defmodule PositionReq do - use Proto - - defrequest "posReq", PositionReq.Params - end - - test "to_native fills out a position", ctx do - assert {:ok, params} = - params_for(PositionReq.LSP, - text_document: [uri: ctx.uri], - position: [line: 1, character: 6] - ) - - assert {:ok, req} = PositionReq.parse(params) - - refute req.position - refute req.document - - assert {:ok, ex_req} = Convert.to_native(req) - - assert %Document.Position{} = ex_req.position - assert %Document{} = ex_req.document - end - - defmodule RangeReq.Params do - use Proto - - deftype text_document: Types.TextDocument.Identifier, - range: Types.Range - end - - defmodule RangeReq do - use Proto - - defrequest "rangeReq", RangeReq.Params - end - - test "to_native fills out a range", ctx do - assert {:ok, params} = - params_for(RangeReq.LSP, - text_document: [uri: ctx.uri], - range: [start: [line: 0, character: 0], end: [line: 0, character: 5]] - ) - - assert {:ok, req} = RangeReq.parse(params) - assert {:ok, req} = Convert.to_native(req) - - assert req.range == - Document.Range.new( - Document.Position.new(ctx.document, 1, 1), - Document.Position.new(ctx.document, 1, 6) - ) - end - end - - describe "responses" do - defmodule Resp do - use Proto - - defresponse list_of(integer()) - end - - test "you can create a response" do - response = Resp.new(123, [8, 6, 7, 5]) - assert response.result == [8, 6, 7, 5] - refute response.error - end - - test "you can create an error with a code" do - response = Resp.error(123, 33_816, "this is bad") - assert response.id == 123 - assert response.error.code == 33_816 - end - - test "you can create an error with a message" do - response = Resp.error(123, 33_816, "this is bad") - assert response.id == 123 - assert response.error.code == 33_816 - assert response.error.message == "this is bad" - end - - test "a response can be encoded and decoded" do - response = Resp.new(123, [8, 6, 7, 5]) - - assert {:ok, decoded} = encode_and_decode(response) - - assert decoded["id"] == 123 - assert decoded["result"] == [8, 6, 7, 5] - end - - test "an error can be encoded and decoded" do - error = Resp.error(123, :parse_error, "super bad") - assert {:ok, decoded} = encode_and_decode(error) - - assert decoded["id"] == 123 - assert decoded["error"]["message"] == "super bad" - assert decoded["error"]["code"] == LspTypes.ErrorCodes.parse_error() - end - end - - describe "encoding" do - defmodule Mood do - use Proto - defenum happy: 1, sad: 2, miserable: 3 - end - - defmodule EncodingTest do - use Proto - - deftype s: string(), - a: any(), - l: list_of(string()), - i: integer(), - lit: literal("foo"), - enum: Mood, - c: optional(Child), - snake_case_name: string() - end - - def fixture(:encoding, include_child \\ false) do - base = %{ - "s" => "hello", - "a" => ["a", "there"], - "l" => ~w(these are strings), - "i" => 42, - "enum" => 1, - "lit" => "foo", - "snakeCaseName" => "foo" - } - - if include_child do - Map.put(base, "c", Child.new(name: "eric")) - else - base - end - end - - def encode_and_decode(%_struct{} = proto) do - with {:ok, encoded} <- Jason.encode(proto) do - Jason.decode(encoded) - end - end - - test "it should be able to encode" do - expected = fixture(:encoding) - assert {:ok, proto} = EncodingTest.parse(expected) - assert {:ok, decoded} = encode_and_decode(proto) - assert decoded == expected - end - - test "it camelizes encoded field names" do - expected = fixture(:encoding) - assert {:ok, proto} = EncodingTest.parse(expected) - assert proto.snake_case_name == "foo" - assert {:ok, decoded} = encode_and_decode(proto) - assert decoded["snakeCaseName"] == "foo" - end - end - - describe "spread" do - defmodule SpreadTest do - use Proto - - deftype name: string(), ..: map_of(string(), as: :opts) - end - - test "it should accept any string keys" do - assert {:ok, proto} = SpreadTest.parse(%{"name" => "spread", "key" => "value"}) - assert proto.name == "spread" - assert proto.opts == %{"key" => "value"} - end - - test "it should encode the spread" do - spread = SpreadTest.new(name: "spread", opts: %{"key" => "value"}) - - assert {:ok, decoded} = encode_and_decode(spread) - - assert decoded["key"] == "value" - assert decoded["name"] == "spread" - end - end - - describe "access behavior" do - defmodule Recursive do - use Proto - deftype name: string(), age: integer(), child: optional(__MODULE__) - end - - def family do - grandkid = Recursive.new(name: "grandkid", age: 8) - child = Recursive.new(name: "child", age: 53, child: grandkid) - Recursive.new(name: "parent", age: 65, child: child) - end - - test "access should work" do - parent = family() - assert get_in(parent, [:child, :child, :age]) == parent.child.child.age - assert get_in(parent, [:child, :age]) == parent.child.age - end - - test "put_in should work" do - parent = put_in(family(), [:child, :child, :age], 28) - assert parent.child.child.age == 28 - end - - test "get and update in should work" do - {"grandkid", parent} = - get_and_update_in(family(), [:child, :child, :name], fn old_name -> - {old_name, "erica"} - end) - - assert parent.child.child.name == "erica" - end - end -end diff --git a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1_test.exs b/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1_test.exs deleted file mode 100644 index deec6372..00000000 --- a/apps/protocol/test/expert/protocol/convertibles/expert.protocol.types.text_document.content_change_event1_test.exs +++ /dev/null @@ -1,28 +0,0 @@ -defmodule Expert.Protocol.Convertibles.ContentChangeEvent.TextDocumentContentChangeEvent1Test do - alias Expert.Protocol.Types.TextDocument.ContentChangeEvent.TextDocumentContentChangeEvent1, - as: TextOnlyEvent - - use Expert.Test.Protocol.ConvertibleSupport - - describe "to_lsp/2)" do - setup [:with_an_open_file] - - test "is a no-op", %{uri: uri} do - native_text_edit = TextOnlyEvent.new(text: "hi") - assert {:ok, ^native_text_edit} = to_lsp(native_text_edit, uri) - end - end - - describe "to_native/2" do - setup [:with_an_open_file] - - test "converts to a single replace edit", %{uri: uri} do - replacement_text = "This is the replacement text" - event = TextOnlyEvent.new(text: replacement_text) - {:ok, %Document.Edit{} = converted} = to_native(event, uri) - - assert converted.text == replacement_text - assert converted.range == nil - end - end -end diff --git a/apps/protocol/test/expert/protocol/integration/initialize_test.exs b/apps/protocol/test/expert/protocol/integration/initialize_test.exs deleted file mode 100644 index 93c65724..00000000 --- a/apps/protocol/test/expert/protocol/integration/initialize_test.exs +++ /dev/null @@ -1,345 +0,0 @@ -defmodule Expert.Protocol.Integrations.InitializeTest do - alias Expert.Protocol.Requests - alias Expert.Protocol.Types - alias Expert.Protocol.Types.Completion - alias Expert.Protocol.Types.TextDocument - - use ExUnit.Case - - test "initialize parses a request from neovim" do - assert {:ok, %Requests.Initialize{lsp: %Requests.Initialize.LSP{} = parsed}} = - Requests.Initialize.parse(neovim_initialize()) - - assert parsed.client_info.name == "Neovim" - assert parsed.client_info.version == "0.10.0" - - assert %Types.ClientCapabilities{} = capabilities = parsed.capabilities - - assert %TextDocument.ClientCapabilities{} = text_doc_capabilities = capabilities.text_document - - validate_workspace(capabilities) - - validate_call_hierarchy(text_doc_capabilities) - validate_code_action(text_doc_capabilities) - validate_declaration(text_doc_capabilities) - validate_definition(text_doc_capabilities) - validate_completion(text_doc_capabilities) - end - - test "initialize parse a request from zed" do - assert {:ok, %Requests.Initialize{lsp: %Requests.Initialize.LSP{} = parsed}} = - Requests.Initialize.parse(zed_initialize()) - - assert parsed.client_info == nil - - assert %Types.ClientCapabilities{} = capabilities = parsed.capabilities - validate_workspace(capabilities) - - assert %TextDocument.ClientCapabilities{} = text_doc_capabilities = capabilities.text_document - assert %Completion.ClientCapabilities{} = text_doc_capabilities.completion - - validate_code_action(text_doc_capabilities) - validate_definition(text_doc_capabilities) - end - - def validate_completion(%TextDocument.ClientCapabilities{} = text_doc_capabilities) do - assert %Completion.ClientCapabilities{} = - completion_capabilities = text_doc_capabilities.completion - - assert %Completion.ClientCapabilities.CompletionItemKind{} = - completion_capabilities.completion_item_kind - end - - def validate_call_hierarchy(%TextDocument.ClientCapabilities{} = text_doc_capabilities) do - assert %Types.CallHierarchy.ClientCapabilities{} = text_doc_capabilities.call_hierarchy - end - - def validate_code_action(%TextDocument.ClientCapabilities{} = text_doc_capabilities) do - assert %Types.CodeAction.ClientCapabilities{} = text_doc_capabilities.code_action - end - - def validate_declaration(%TextDocument.ClientCapabilities{} = text_doc_capabilities) do - assert %Types.Declaration.ClientCapabilities{} = text_doc_capabilities.declaration - end - - def validate_definition(%TextDocument.ClientCapabilities{} = text_doc_capabilities) do - assert %Types.Definition.ClientCapabilities{} = text_doc_capabilities.definition - end - - def validate_workspace(%Types.ClientCapabilities{} = capabilities) do - assert %Types.Workspace.ClientCapabilities{} = capabilities.workspace - end - - def neovim_initialize do - ~S( - { - "id": 1, - "jsonrpc": "2.0", - "method": "initialize", - "params": { - "capabilities": { - "textDocument": { - "callHierarchy": { - "dynamicRegistration": false - }, - "codeAction": { - "codeActionLiteralSupport": { - "codeActionKind": { - "valueSet": ["", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports"] - } - }, - "dataSupport": true, - "dynamicRegistration": false, - "isPreferredSupport": true, - "resolveSupport": { - "properties": [ "edit" ] - } - }, - "completion": { - "completionItem": { - "commitCharactersSupport": false, - "deprecatedSupport": false, - "documentationFormat": [ "markdown", "plaintext" ], - "preselectSupport": false, - "snippetSupport": false - }, - "completionItemKind": { - "valueSet": [ 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 ] - }, - "contextSupport": false, - "dynamicRegistration": false - }, - "declaration": { - "linkSupport": true - }, - "definition": { - "linkSupport": true - }, - "documentHighlight": { - "dynamicRegistration": false - }, - "documentSymbol": { - "dynamicRegistration": false, - "hierarchicalDocumentSymbolSupport": true, - "symbolKind": { - "valueSet": [ 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 ] - } - }, - "hover": { - "contentFormat": [ "markdown", "plaintext" ], - "dynamicRegistration": false - }, - "implementation": { - "linkSupport": true - }, - "publishDiagnostics": { - "relatedInformation": true, - "tagSupport": { - "valueSet": [ 1, 2 ] - } - }, - "references": { - "dynamicRegistration": false - }, - "rename": { - "dynamicRegistration": false, - "prepareSupport": true - }, - "semanticTokens": { - "augmentsSyntaxTokens": true, - "dynamicRegistration": false, - "formats": [ "relative" ], - "multilineTokenSupport": false, - "overlappingTokenSupport": true, - "requests": { - "full": { - "delta": true - }, - "range": false - }, - "serverCancelSupport": false, - "tokenModifiers": [ "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" ], - "tokenTypes": [ "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" ] - }, - "signatureHelp": { - "dynamicRegistration": false, - "signatureInformation": { - "activeParameterSupport": true, - "documentationFormat": [ "markdown", "plaintext" ], - "parameterInformation": { - "labelOffsetSupport": true - } - } - }, - "synchronization": { - "didSave": true, - "dynamicRegistration": false, - "willSave": true, - "willSaveWaitUntil": true - }, - "typeDefinition": { - "linkSupport": true - } - }, - "window": { - "showDocument": { - "support": true - }, - "showMessage": { - "messageActionItem": { - "additionalPropertiesSupport": false - } - }, - "workDoneProgress": true - }, - "workspace": { - "applyEdit": true, - "configuration": true, - "didChangeWatchedFiles": { - "dynamicRegistration": false, - "relativePatternSupport": true - }, - "semanticTokens": { - "refreshSupport": true - }, - "symbol": { - "dynamicRegistration": false, - "hierarchicalWorkspaceSymbolSupport": true, - "symbolKind": { - "valueSet": [ 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 ] - } - }, - "workspaceEdit": { - "resourceOperations": ["rename", "create", "delete"] - }, - "workspaceFolders": true - } - }, - "clientInfo": { - "name": "Neovim", - "version": "0.10.0" - }, - "processId": 81648, - "rootPath": "/Users/scottming/Code/Expert", - "rootUri": "file:///Users/scottming/Code/Expert", - "trace": "off", - "workspaceFolders": [ - { - "name": "/Users/scottming/Code/Expert", - "uri": "file:///Users/scottming/Code/Expert" - } - ] - } - } - ) - |> Jason.decode!() - end - - def zed_initialize do - # Zed Preview 0.106.2 - ~S( - { - "jsonrpc":"2.0", - "id":0, - "method":"initialize", - "params":{ - "processId":null, - "rootUri":"file:///Users/scottming/Code/dummy/mix.exs", - "capabilities":{ - "workspace":{ - "didChangeConfiguration":{ - "dynamicRegistration":true - }, - "didChangeWatchedFiles":{ - "dynamicRegistration":true, - "relativePatternSupport":true - }, - "symbol":{ - - }, - "workspaceFolders":true, - "configuration":true, - "inlayHint":{ - "refreshSupport":true - } - }, - "textDocument":{ - "completion":{ - "completionItem":{ - "snippetSupport":true, - "resolveSupport":{ - "properties":[ - "additionalTextEdits" - ] - } - }, - "completionList":{ - "itemDefaults":[ - "commitCharacters", - "editRange", - "insertTextMode", - "data" - ] - } - }, - "hover":{ - "contentFormat":[ - "markdown" - ] - }, - "definition":{ - "linkSupport":true - }, - "codeAction":{ - "codeActionLiteralSupport":{ - "codeActionKind":{ - "valueSet":[ - "refactor", - "quickfix", - "source" - ] - } - }, - "dataSupport":true, - "resolveSupport":{ - "properties":[ - "edit", - "command" - ] - } - }, - "rename":{ - "prepareSupport":true - }, - "inlayHint":{ - "dynamicRegistration":false, - "resolveSupport":{ - "properties":[ - "textEdits", - "tooltip", - "label.tooltip", - "label.location", - "label.command" - ] - } - } - }, - "window":{ - "workDoneProgress":true - }, - "experimental":{ - "serverStatusNotification":true - } - }, - "workspaceFolders":[ - { - "uri":"file:///Users/scottming/Code/dummy/mix.exs", - "name":"" - } - ] - } - } - ) - |> Jason.decode!() - end -end diff --git a/apps/protocol/test/expert/protocol/notifications_test.exs b/apps/protocol/test/expert/protocol/notifications_test.exs deleted file mode 100644 index b7547b81..00000000 --- a/apps/protocol/test/expert/protocol/notifications_test.exs +++ /dev/null @@ -1,43 +0,0 @@ -defmodule Expert.Protocol.NotificationsTest do - alias Expert.Protocol.Notifications - import Notifications - use ExUnit.Case - - defp fixture(:notification, opts \\ []) do - [method: "something/didChange", params: %{"foo" => 3, "bar" => 6}] - |> Keyword.merge(opts) - |> Enum.reduce(%{"jsonrpc" => "2.0"}, fn - {_k, :drop}, acc -> - acc - - {k, v}, acc -> - Map.put(acc, Atom.to_string(k), v) - end) - end - - describe "matching macros" do - test "can identify a notification with params" do - notification(method, params) = fixture(:notification) - - assert method == "something/didChange" - assert params == %{"foo" => 3, "bar" => 6} - end - - test "can identify a notification without params" do - notification(method) = fixture(:notification, params: :drop) - - assert method == "something/didChange" - end - - test "a notification's params can be an array" do - notification(_method, params) = fixture(:notification, params: [1, 2, 3, 4]) - assert params == [1, 2, 3, 4] - end - - test "a notification's params can be map" do - notification(_method, params) = fixture(:notification, params: %{"a" => "b"}) - - assert params == %{"a" => "b"} - end - end -end diff --git a/apps/protocol/test/expert/protocol/requests_test.exs b/apps/protocol/test/expert/protocol/requests_test.exs deleted file mode 100644 index c217b678..00000000 --- a/apps/protocol/test/expert/protocol/requests_test.exs +++ /dev/null @@ -1,45 +0,0 @@ -defmodule Expert.Protocol.RequestsTest do - alias Expert.Protocol.Requests - import Requests - use ExUnit.Case - - defp fixture(opts \\ []) do - [method: "something/didChange", id: 3, params: %{"foo" => 3, "bar" => 6}] - |> Keyword.merge(opts) - |> Enum.reduce(%{"jsonrpc" => "2.0"}, fn - {_k, :drop}, acc -> - acc - - {k, v}, acc -> - Map.put(acc, Atom.to_string(k), v) - end) - end - - describe "matching macros" do - test "can identify a request with params" do - request(id, method, params) = fixture() - - assert id == 3 - assert method == "something/didChange" - assert params == %{"foo" => 3, "bar" => 6} - end - - test "can identify a request without params" do - request(id, method) = fixture(params: :drop) - - assert id == 3 - assert method == "something/didChange" - end - - test "a request's params can be an array" do - request(_id, _method, params) = fixture(params: [1, 2, 3, 4]) - assert params == [1, 2, 3, 4] - end - - test "a request's params can be map" do - request(_id, _method, params) = fixture(params: %{"a" => "b"}) - - assert params == %{"a" => "b"} - end - end -end diff --git a/apps/protocol/test/expert/protocol/response_test.exs b/apps/protocol/test/expert/protocol/response_test.exs deleted file mode 100644 index 01552456..00000000 --- a/apps/protocol/test/expert/protocol/response_test.exs +++ /dev/null @@ -1,77 +0,0 @@ -defmodule Expert.Protocol.ResponseTest do - alias Expert.Proto - alias Expert.Proto.Convert - alias Expert.Protocol.Types - alias Forge.Document - - use ExUnit.Case - - def with_open_document(_) do - document = """ - defmodule MyTest do - def add(a, b), do: a + b - end - """ - - file_uri = "file:///file.ex" - {:ok, _} = start_supervised(Document.Store) - :ok = Document.Store.open(file_uri, document, 1) - {:ok, document} = Document.Store.fetch(file_uri) - {:ok, uri: file_uri, document: document} - end - - describe "converting responses" do - setup [:with_open_document] - - defmodule TextDocumentAndPosition do - alias Expert.Protocol.Types - use Proto - - deftype text_document: Types.TextDocument.Identifier, - placement: Types.Position - end - - defmodule PositionContainer do - use Proto - - defresponse optional(TextDocumentAndPosition) - end - - test "positions are converted", %{uri: file_uri, document: document} do - identifier = Types.TextDocument.Identifier.new(uri: file_uri) - - elixir_position = Document.Position.new(document, 2, 2) - body = TextDocumentAndPosition.new(text_document: identifier, placement: elixir_position) - response = PositionContainer.new(15, body) - - assert {:ok, lsp_response} = Convert.to_lsp(response) - assert lsp_response.id == 15 - assert lsp_response.result.text_document == identifier - assert %Types.Position{} = _position = lsp_response.result.placement - end - - defmodule Locations do - alias Expert.Protocol.Types - use Proto - - defresponse list_of(Types.Location) - end - - test "locations are converted", %{uri: file_uri, document: document} do - location = - Types.Location.new( - uri: file_uri, - range: - Document.Range.new( - Document.Position.new(document, 2, 3), - Document.Position.new(document, 2, 5) - ) - ) - - response = Locations.new(5, [location]) - assert {:ok, lsp_response} = Convert.to_lsp(response) - assert lsp_response.id == 5 - assert [%Types.Location{} = _lsp_location] = lsp_response.result - end - end -end diff --git a/apps/protocol/test/support/test/protocol/fixtures/lsp_protocol.ex b/apps/protocol/test/support/test/protocol/fixtures/lsp_protocol.ex deleted file mode 100644 index 59ce3ce0..00000000 --- a/apps/protocol/test/support/test/protocol/fixtures/lsp_protocol.ex +++ /dev/null @@ -1,276 +0,0 @@ -defmodule Expert.Test.Protocol.Fixtures.LspProtocol do - def build(module_to_build, opts \\ []) do - true = Code.ensure_loaded?(module_to_build) - - if function_exported?(module_to_build, :__meta__, 1) do - protocol_module = ensure_protocol_module(module_to_build) - params = Map.take(protocol_module.__meta__(:types), protocol_module.__meta__(:param_names)) - - result = - Enum.reduce_while(params, [], fn {field_name, field_type}, acc -> - case build_field(field_type, field_name, opts) do - {:ok, value} -> {:cont, [{field_name, value} | acc]} - {:error, _} = err -> {:halt, err} - end - end) - - case result do - args when is_list(args) -> - args = - case module_to_build.__meta__(:type) do - {:notification, _} -> - Keyword.put(args, :method, module_to_build.__meta__(:method_name)) - - {:request, _} -> - id = - opts - |> Keyword.get(:id, next_int()) - |> to_string() - - args - |> Keyword.put(:id, id) - |> Keyword.put(:method, module_to_build.__meta__(:method_name)) - - _ -> - args - end - - {:ok, module_to_build.new(args)} - - {:error, _} = err -> - err - end - else - {:error, {:invalid_module, module_to_build}} - end - end - - def params_for(type, opts \\ []) do - with {:ok, built} <- build(type, opts) do - params = - built - |> maybe_wrap_with_json_rpc(opts) - |> camelize() - - {:ok, params} - end - end - - defp ensure_protocol_module(module_to_build) do - case module_to_build.__meta__(:type) do - {message_type, :lsp} when message_type in [:notification, :request] -> - module_to_build - - {message_type, :elixir} when message_type in [:notification, :request] -> - Module.concat(module_to_build, LSP) - - _ -> - module_to_build - end - end - - defp maybe_wrap_with_json_rpc(%proto_module{} = proto, opts) do - proto_struct = - case proto_module.__meta__(:type) do - {message_type, :lsp} when message_type in [:notification, :request] -> - proto - - {message_type, :elixir} when message_type in [:notification, :request] -> - proto.lsp - - other -> - other - end - - case proto_module.__meta__(:type) do - {:notification, _} -> - %{ - jsonrpc: Keyword.get(opts, :jsonrpc, "2.0"), - method: proto_module.__meta__(:method_name), - params: extract_params(proto_struct) - } - - {:request, _} -> - id = - opts - |> Keyword.get(:id, next_int()) - |> to_string() - - %{ - jsonrpc: Keyword.get(opts, :jsonrpc, "2.0"), - method: proto_module.__meta__(:method_name), - params: extract_params(proto_struct), - id: id - } - - _other -> - proto_struct - end - end - - defp extract_params(%proto_module{} = proto) do - Map.take(proto, proto_module.__meta__(:param_names)) - end - - defp build_field(type, field_name, opts) do - set_value = Keyword.get(opts, field_name) - build_field(type, field_name, set_value, opts) - end - - defp build_field({:literal, literal_value}, _, _, _) do - {:ok, literal_value} - end - - defp build_field({:optional, _type}, _, nil, _) do - {:ok, nil} - end - - defp build_field({:optional, type}, field_name, field_value, opts) do - build_field(type, field_name, field_value, opts) - end - - defp build_field(:integer, _field_name, field_value, _opts) when is_integer(field_value) do - {:ok, field_value} - end - - defp build_field(:integer, _field_name, nil, _) do - {:ok, 0} - end - - defp build_field({:list, elem_type}, field_name, field_value, opts) when is_list(field_value) do - list_elements = - Enum.reduce_while(field_value, [], fn set_value, acc -> - case build_field(elem_type, field_name, set_value, opts) do - {:ok, element} -> {:cont, [element | acc]} - error -> {:halt, error} - end - end) - - case list_elements do - elements when is_list(elements) -> {:ok, Enum.reverse(elements)} - error -> error - end - end - - defp build_field({:params, param_types}, field_name, field_value, opts) - when is_list(field_value) do - build_field({:params, param_types}, field_name, Map.new(field_value), opts) - end - - defp build_field({:params, param_types}, field_name, %{} = field_value, opts) do - list_elements = - Enum.reduce_while(param_types, [], fn {param_name, param_type}, acc -> - case build_field(param_type, field_name, Map.get(field_value, param_name), opts) do - {:ok, element} -> {:cont, [{param_name, element} | acc]} - error -> {:halt, error} - end - end) - - case list_elements do - %{} = elements -> {:ok, Map.new(elements)} - error -> error - end - end - - defp build_field({:list, elem_type}, field_name, field_value, opts) do - with {:ok, field} <- build_field(elem_type, field_name, field_value, opts) do - {:ok, [field]} - end - end - - defp build_field(:string, _, s, _) when is_binary(s) do - {:ok, s} - end - - defp build_field(:string, field_name, nil, _) do - {:ok, "#{field_name}_#{next_int()}"} - end - - defp build_field(:boolean, _, value, _) when is_boolean(value) do - {:ok, value} - end - - defp build_field(:boolean, _, _, _) do - {:ok, true} - end - - defp build_field({:map, key_type, value_type}, field_name, field_value, opts) - when is_map(field_value) do - results = - Enum.reduce_while(field_value, [], fn {set_key, set_value}, acc -> - with {:ok, key} <- build_field(key_type, field_name, set_key, opts), - {:ok, value} <- build_field(value_type, field_name, set_value, opts) do - {:cont, [{key, value} | acc]} - else - error -> - {:halt, error} - end - end) - - case results do - elements when is_list(elements) -> {:ok, Map.new(elements)} - error -> error - end - end - - defp build_field(module, _, %module{} = field_value, _) do - {:ok, field_value} - end - - defp build_field(module, _field_name, field_value, _opts) when is_atom(module) do - field_value = field_value || [] - build(module, field_value) - end - - def next_int do - System.unique_integer([:monotonic, :positive]) - end - - defp camelize(%_struct_module{} = struct) do - struct - |> Map.from_struct() - |> camelize() - end - - defp camelize(%{} = map) do - Map.new(map, fn - {k, v} when is_map(v) -> - {camelize(k), camelize(v)} - - {k, v} when is_list(v) -> - {camelize(k), Enum.map(v, &camelize/1)} - - {k, v} -> - {camelize(k), v} - end) - end - - defp camelize(atom) when is_atom(atom) do - atom - |> Atom.to_string() - |> camelize() - end - - defp camelize(s) when is_binary(s) do - s - |> Macro.camelize() - |> downcase_first() - end - - defp camelize(other) do - other - end - - defp downcase_first(<>) do - first_char = - [c] - |> List.to_string() - |> String.downcase() - - first_char <> rest - end - - defp downcase_first(b) do - b - end -end diff --git a/apps/protocol/test/test_helper.exs b/apps/protocol/test/test_helper.exs deleted file mode 100644 index 869559e7..00000000 --- a/apps/protocol/test/test_helper.exs +++ /dev/null @@ -1 +0,0 @@ -ExUnit.start() diff --git a/mix.exs b/mix.exs index 304e68cd..144e6801 100644 --- a/mix.exs +++ b/mix.exs @@ -31,22 +31,10 @@ defmodule Expert.LanguageServer.MixProject do pages/architecture.md pages/glossary.md ), - filter_modules: fn mod_name, _ -> - case Module.split(mod_name) do - ["Expert", "Protocol", "Requests" | _] -> true - ["Expert", "Protocol", "Notifications" | _] -> true - ["Expert", "Protocol", "Responses" | _] -> true - ["Expert", "Protocol" | _] -> false - _ -> true - end - end, groups_for_modules: [ - Core: ~r/Expert.^(RemoteControl|Protocol|Server)/, - "Remote Control": ~r/Expert.RemoteControl/, - "Protocol Requests": ~r/Expert.Protocol.Requests/, - "Protocol Notifications": ~r/Expert.Protocol.Notifications/, - "Protocol Responses": ~r/Expert.Protocol.Responses/, - Server: ~r/Expert.Server/ + Core: ~r/(Expert|Engine)/, + Engine: ~r/Engine/, + Server: ~r/Expert/ ] ] end diff --git a/mix.lock b/mix.lock index 22bd6d94..5f1588cd 100644 --- a/mix.lock +++ b/mix.lock @@ -10,12 +10,14 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.37.3", "f7816881a443cd77872b7d6118e8a55f547f49903aef8747dbcb345a75b462f9", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "e6aebca7156e7c29b5da4daa17f6361205b2ae5f26e5c7d8ca0d3f7e18972233"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "gen_lsp": {:hex, :gen_lsp, "0.10.0", "f6da076b5ccedf937d17aa9743635a2c3d0f31265c853e58b02ab84d71852270", [:mix], [{:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:schematic, "~> 0.2.1", [hex: :schematic, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "768f8f7b5c5e218fb36dcebd30dcd6275b61ca77052c98c3c4c0375158392c4a"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, "logger_file_backend": {:hex, :logger_file_backend, "0.0.14", "774bb661f1c3fed51b624d2859180c01e386eb1273dc22de4f4a155ef749a602", [:mix], [], "hexpm", "071354a18196468f3904ef09413af20971d55164267427f6257b52cfba03f9e6"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"}, "patch": {:hex, :patch, "0.15.0", "947dd6a8b24a2d2d1137721f20bb96a8feb4f83248e7b4ad88b4871d52807af5", [:mix], [], "hexpm", "e8dadf9b57b30e92f6b2b1ce2f7f57700d14c66d4ed56ee27777eb73fb77e58d"}, "path_glob": {:hex, :path_glob, "0.2.0", "b9e34b5045cac5ecb76ef1aa55281a52bf603bf7009002085de40958064ca312", [:mix], [{:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "be2594cb4553169a1a189f95193d910115f64f15f0d689454bb4e8cfae2e7ebc"}, @@ -27,11 +29,13 @@ "plug": {:hex, :plug, "1.17.0", "a0832e7af4ae0f4819e0c08dd2e7482364937aea6a8a997a679f2cbb7e026b2e", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f6692046652a69a00a5a21d0b7e11fcf401064839d59d6b8787f23af55b1e6bc"}, "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "refactorex": {:hex, :refactorex, "0.1.51", "74fc4603b31b600d78539ffea9fe170038aa8d471eec5aed261354c9734b4b27", [:mix], [{:sourceror, "~> 1.7", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "aefa150ab2c0d62aa8c01c4d04b932806118790f09c4106e20883281932fba03"}, + "schematic": {:hex, :schematic, "0.2.1", "0b091df94146fd15a0a343d1bd179a6c5a58562527746dadd09477311698dbb1", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0b255d65921e38006138201cd4263fd8bb807d9dfc511074615cd264a571b3b1"}, "snowflake": {:hex, :snowflake, "1.0.4", "8433b4e04fbed19272c55e1b7de0f7a1ee1230b3ae31a813b616fd6ef279e87a", [:mix], [], "hexpm", "badb07ebb089a5cff737738297513db3962760b10fe2b158ae3bebf0b4d5be13"}, "sourceror": {:hex, :sourceror, "1.9.0", "3bf5fe2d017aaabe3866d8a6da097dd7c331e0d2d54e59e21c2b066d47f1e08e", [:mix], [], "hexpm", "d20a9dd5efe162f0d75a307146faa2e17b823ea4f134f662358d70f0332fed82"}, "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "stream_data": {:hex, :stream_data, "1.2.0", "58dd3f9e88afe27dc38bef26fce0c84a9e7a96772b2925c7b32cd2435697a52b", [:mix], [], "hexpm", "eb5c546ee3466920314643edf68943a5b14b32d1da9fe01698dc92b73f89a9ed"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, + "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "websock_adapter": {:hex, :websock_adapter, "0.5.8", "3b97dc94e407e2d1fc666b2fb9acf6be81a1798a2602294aac000260a7c4a47d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "315b9a1865552212b5f35140ad194e67ce31af45bcee443d4ecb96b5fd3f3782"}, } diff --git a/nix/hash b/nix/hash index 50e6c3b4..5caeb59f 100644 --- a/nix/hash +++ b/nix/hash @@ -1 +1 @@ -sha256-jSphae+R2Q63dhFdJYyvf3D4bPotnohBQAWMyoBi6Hs= +sha256-liscEmuTiLnkw1Jw39hOte5Jhxp0BGnSJm9r/A7fey4=