Skip to content

Conversation

@wkirschbaum
Copy link
Contributor

@wkirschbaum wkirschbaum commented Jul 11, 2023

When the params is none, the client might send an empty map or map, depending on protocol version. It does not really matter which type we get as it won't be used. This will move towards resolving: elixir-tools/gen_lsp#30

@wkirschbaum wkirschbaum force-pushed the main branch 5 times, most recently from e5f11f9 to 0789eac Compare July 11, 2023 22:30
@wkirschbaum wkirschbaum changed the title fix: set type to any() when params is nil fix: do not generate params for requests if its specified as `none' Jul 11, 2023
field :jsonrpc, String.t(), default: "2.0"
field :id, integer(), enforce: true
field :params, <%= LSPCodegen.Codegen.to_string(@params, @metamodel) %>
<%= unless @params == :none do %> field :params, <%= LSPCodegen.Codegen.to_string(@params, @metamodel) %> <% end %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if there is a way to have the condition on separate lines without forcing a space.

* lib/lsp_codegen/request.ex (new/1): Update condition to identify a missing :params key. * priv/request.ex.eex: Add condition for :none.
@mhanberg mhanberg merged commit 098b5e2 into elixir-tools:main Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants