<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/lsp/buf.lua, branch userreg</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>fix(lsp): create per client params in lsp.buf.code_action</title>
<updated>2023-11-04T07:17:42+00:00</updated>
<author>
<name>Mathias Fussenegger</name>
<email>f.mathias@zignar.net</email>
</author>
<published>2023-11-02T08:59:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=9281edb334a374e7753d4a6b7a05e31120e39772'/>
<id>9281edb334a374e7753d4a6b7a05e31120e39772</id>
<content type='text'>
`code_action` used the same parameters for all clients, which led to the
following warning and incorrect start/end column locations if using
clients with mixed encodings:

    warning: multiple different client offset_encodings detected for
    buffer, this is not supported yet
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`code_action` used the same parameters for all clients, which led to the
following warning and incorrect start/end column locations if using
clients with mixed encodings:

    warning: multiple different client offset_encodings detected for
    buffer, this is not supported yet
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): call `on_list()` even for single location (#25830)</title>
<updated>2023-10-31T12:18:44+00:00</updated>
<author>
<name>Evgeni Chasnovski</name>
<email>evgeni.chasnovski@gmail.com</email>
</author>
<published>2023-10-31T12:18:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=adbe7f368397da21465f27181e254dd3694820e9'/>
<id>adbe7f368397da21465f27181e254dd3694820e9</id>
<content type='text'>
Problem: Currently there is no way of customizing behavior of
  `declaration`, `definition`, `typeDefinition`, and `implementation`
  methods in `vim.lsp.buf` when LSP server returns `Location`. Instead,
  cursor jumps to that location directly.

Solution: Normalize LSP response to be `Location[]` for those four cases.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: Currently there is no way of customizing behavior of
  `declaration`, `definition`, `typeDefinition`, and `implementation`
  methods in `vim.lsp.buf` when LSP server returns `Location`. Instead,
  cursor jumps to that location directly.

Solution: Normalize LSP response to be `Location[]` for those four cases.</pre>
</div>
</content>
</entry>
<entry>
<title>docs: do not hardcode LSP version in URL #25648</title>
<updated>2023-10-16T15:13:37+00:00</updated>
<author>
<name>Maria José Solano</name>
<email>majosolano99@gmail.com</email>
</author>
<published>2023-10-16T15:13:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=c46a6c065e8d830adb8a2f410d3c92cf5bd4455b'/>
<id>c46a6c065e8d830adb8a2f410d3c92cf5bd4455b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lsp): fallback to code-action command on resolve failure (#25464)</title>
<updated>2023-10-02T20:14:19+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2023-10-02T20:14:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=4a09c178a19097c295521892c889f1f196fff100'/>
<id>4a09c178a19097c295521892c889f1f196fff100</id>
<content type='text'>
The haskell-language-server supports resolve only for a subset of code
actions. For many code actions trying to resolve the `edit` property
results in an error, but the unresolved action already contains a
command that can be executed without issue.

The protocol specification is unfortunately a bit vague about this,
and what the haskell-language-server does seems to be valid.

Example:

    newtype Dummy = Dummy Int
    instance Num Dummy where

Triggering code actions on "Num Dummy" and choosing "Add placeholders
for all missing methods" resulted in:

    -32601: No plugin enabled for SMethod_CodeActionResolve, potentially available: explicit-fields, importLens, hlint, overloaded-record-dot

With this change it will insert the missing methods:

    instance Num Dummy where
      (+) = _
      (-) = _
      (*) = _
      negate = _
      abs = _
      signum = _
      fromInteger = _</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The haskell-language-server supports resolve only for a subset of code
actions. For many code actions trying to resolve the `edit` property
results in an error, but the unresolved action already contains a
command that can be executed without issue.

The protocol specification is unfortunately a bit vague about this,
and what the haskell-language-server does seems to be valid.

Example:

    newtype Dummy = Dummy Int
    instance Num Dummy where

Triggering code actions on "Num Dummy" and choosing "Add placeholders
for all missing methods" resulted in:

    -32601: No plugin enabled for SMethod_CodeActionResolve, potentially available: explicit-fields, importLens, hlint, overloaded-record-dot

With this change it will insert the missing methods:

    instance Num Dummy where
      (+) = _
      (-) = _
      (*) = _
      negate = _
      abs = _
      signum = _
      fromInteger = _</pre>
</div>
</content>
</entry>
<entry>
<title>docs: replace &lt;pre&gt; with ``` (#25136)</title>
<updated>2023-09-14T13:23:01+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2023-09-14T13:23:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=2e92065686f62851318150a315591c30b8306a4b'/>
<id>2e92065686f62851318150a315591c30b8306a4b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>docs(lsp): fix references to protocol.constants #24578</title>
<updated>2023-08-07T13:35:06+00:00</updated>
<author>
<name>Maria José Solano</name>
<email>majosolano99@gmail.com</email>
</author>
<published>2023-08-07T13:35:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=832459219b4cbf3151e48b43187f1ab0c94ea285'/>
<id>832459219b4cbf3151e48b43187f1ab0c94ea285</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(lsp): use protocol.Methods instead of strings #24570</title>
<updated>2023-08-05T09:03:57+00:00</updated>
<author>
<name>Raphael</name>
<email>glephunter@gmail.com</email>
</author>
<published>2023-08-05T09:03:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=42630923fc00633d806af97c1792b2ed4a71e1cc'/>
<id>42630923fc00633d806af97c1792b2ed4a71e1cc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(lsp): use protocol.Methods instead of strings #24537</title>
<updated>2023-08-03T11:03:48+00:00</updated>
<author>
<name>Raphael</name>
<email>glephunter@gmail.com</email>
</author>
<published>2023-08-03T11:03:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f1772272b4fda43c093fc495f54b5e7c11968d62'/>
<id>f1772272b4fda43c093fc495f54b5e7c11968d62</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): fix multi client handling workspace_folder methods (#18839)</title>
<updated>2023-07-25T14:57:19+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2023-07-25T14:57:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=74bd4aba57d2f1b224abe46a6de82911d14ef6c1'/>
<id>74bd4aba57d2f1b224abe46a6de82911d14ef6c1</id>
<content type='text'>
`buf_notify` sends the notification to all clients of a buffer, calling
that inside a loop over clients multiplies the amount of notifications.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`buf_notify` sends the notification to all clients of a buffer, calling
that inside a loop over clients multiplies the amount of notifications.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): send empty "added" list when removing workspace folder #24440</title>
<updated>2023-07-24T16:09:53+00:00</updated>
<author>
<name>Mitchell Hanberg</name>
<email>mitch@mitchellhanberg.com</email>
</author>
<published>2023-07-24T16:09:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=a37d568082ad2a6fd479bc0584f1088b51019b7f'/>
<id>a37d568082ad2a6fd479bc0584f1088b51019b7f</id>
<content type='text'>
When adding `workspace/didChangeWorkspaceFolders` support to my [language server](https://github.com/elixir-tools/next-ls), I noticed that when neovim removes a workspace, it sends an empty table (which is serialized to an empty JSON array) for the value in the `added` field.

This does not follow the spec; the `added` table should just be empty.

The following error led me to this discovery. Note the payload includes `"added" =&gt; [[]]`:

```
22:46:48.476 [error] LSP Exited.

Last message received: handle_notification %{"jsonrpc" =&gt; "2.0", "method" =&gt; "workspace/didChangeWorkspaceFolders", "params" =&gt; %{"event" =&gt; %{"added" =&gt; [[]], "removed" =&gt; [%{"name" =&gt; "/Users/mitchell/src/gen_lsp", "uri" =&gt; "file:///Users/mitchell/src/gen_lsp"}]}}}

** (MatchError) no match of right hand side value: {:error, %{"params" =&gt; %{"event" =&gt; %{"added" =&gt; [error: "expected a map"]}}}}
    (gen_lsp 0.4.0) lib/gen_lsp.ex:265: anonymous fn/4 in GenLSP.loop/3
    (gen_lsp 0.4.0) lib/gen_lsp.ex:292: GenLSP.attempt/3
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When adding `workspace/didChangeWorkspaceFolders` support to my [language server](https://github.com/elixir-tools/next-ls), I noticed that when neovim removes a workspace, it sends an empty table (which is serialized to an empty JSON array) for the value in the `added` field.

This does not follow the spec; the `added` table should just be empty.

The following error led me to this discovery. Note the payload includes `"added" =&gt; [[]]`:

```
22:46:48.476 [error] LSP Exited.

Last message received: handle_notification %{"jsonrpc" =&gt; "2.0", "method" =&gt; "workspace/didChangeWorkspaceFolders", "params" =&gt; %{"event" =&gt; %{"added" =&gt; [[]], "removed" =&gt; [%{"name" =&gt; "/Users/mitchell/src/gen_lsp", "uri" =&gt; "file:///Users/mitchell/src/gen_lsp"}]}}}

** (MatchError) no match of right hand side value: {:error, %{"params" =&gt; %{"event" =&gt; %{"added" =&gt; [error: "expected a map"]}}}}
    (gen_lsp 0.4.0) lib/gen_lsp.ex:265: anonymous fn/4 in GenLSP.loop/3
    (gen_lsp 0.4.0) lib/gen_lsp.ex:292: GenLSP.attempt/3
    (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
```</pre>
</div>
</content>
</entry>
</feed>
