<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/lsp.lua, branch tmp</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>docs(lsp): remove lsp.buf_request from docs (#19738)</title>
<updated>2022-08-18T08:57:17+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-18T08:57:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=341ef46d008d765640e65404f8dc7760175d4c7d'/>
<id>341ef46d008d765640e65404f8dc7760175d4c7d</id>
<content type='text'>
This starts a soft phase-out of `buf_request`.

`buf_request` is quite error prone:

- Positional `params` depend on the client because of the
  `offset_encoding`. Currently if there is one client using UTF-8 offset
  encoding and another using UTF-16, the positions in the request are
  wrong for one of the clients. To solve this the params would need to
  be created per client instead of once for all of them.

- `handler` is called *per* client but many users of it assume it is
  only called once.

  This can lead to a "select n + 1"
  kind of problem, where the handler makes another call to `buf_request`,
  multiplying the amount of requests.
  (There are in fact still some places where this happens in core)

  Or it leads to erratic behavior if called multiple times (E.g. the
  quicklist list flickering &amp; being overwritten)
  (See hover or references implementation)

  `buf_request_all` returns an aggregate of the responses which is more
  sensible as it avoids this problem.

  For off-spec extensions it also has the problem that it sends requests to
  clients which cannot handle a given request.

Given that `buf_request` is in use by a lot of plugins this starts a
soft-phase out. Planned Steps:

- Remove from docs
- Provide an alternative, either `buf_request_all`, maybe with
  extensions (params being a function), or an entirely new method.
- Mark as deprecated in 0.9
- Remove in 0.10

To note:

- `buf_request_all` currently isn't ideal either because it suffers from
the `params` problem as well.

- This implies that the `vim.lsp.with` pattern will die, because the
  global handlers as they are don't fit a multi-client model, as most of
  the time an aggregate is needed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This starts a soft phase-out of `buf_request`.

`buf_request` is quite error prone:

- Positional `params` depend on the client because of the
  `offset_encoding`. Currently if there is one client using UTF-8 offset
  encoding and another using UTF-16, the positions in the request are
  wrong for one of the clients. To solve this the params would need to
  be created per client instead of once for all of them.

- `handler` is called *per* client but many users of it assume it is
  only called once.

  This can lead to a "select n + 1"
  kind of problem, where the handler makes another call to `buf_request`,
  multiplying the amount of requests.
  (There are in fact still some places where this happens in core)

  Or it leads to erratic behavior if called multiple times (E.g. the
  quicklist list flickering &amp; being overwritten)
  (See hover or references implementation)

  `buf_request_all` returns an aggregate of the responses which is more
  sensible as it avoids this problem.

  For off-spec extensions it also has the problem that it sends requests to
  clients which cannot handle a given request.

Given that `buf_request` is in use by a lot of plugins this starts a
soft-phase out. Planned Steps:

- Remove from docs
- Provide an alternative, either `buf_request_all`, maybe with
  extensions (params being a function), or an entirely new method.
- Mark as deprecated in 0.9
- Remove in 0.10

To note:

- `buf_request_all` currently isn't ideal either because it suffers from
the `params` problem as well.

- This implies that the `vim.lsp.with` pattern will die, because the
  global handlers as they are don't fit a multi-client model, as most of
  the time an aggregate is needed.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): fix nil value error in get_group (#19735)</title>
<updated>2022-08-12T08:10:03+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-12T08:10:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=02289ab898575368eeaa234bbd78725f8463044c'/>
<id>02289ab898575368eeaa234bbd78725f8463044c</id>
<content type='text'>
`server_capabilities` can be nil until the server is initialized.
Reproduced with:

    vim.lsp.stop_client(vim.lsp.start_client {
      cmd = { vim.v.progpath, '-es', '-u', 'NONE', '--headless' };
    })</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`server_capabilities` can be nil until the server is initialized.
Reproduced with:

    vim.lsp.stop_client(vim.lsp.start_client {
      cmd = { vim.v.progpath, '-es', '-u', 'NONE', '--headless' };
    })</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): handle nil client in onexit callback (#19722)</title>
<updated>2022-08-11T17:21:57+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-11T17:21:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=33b77eb728a1f07926ba19c4f09fd20e806de363'/>
<id>33b77eb728a1f07926ba19c4f09fd20e806de363</id>
<content type='text'>
Follow up to https://github.com/neovim/neovim/pull/19658</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up to https://github.com/neovim/neovim/pull/19658</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): handle multiple clients with incremental sync (#19658)</title>
<updated>2022-08-09T20:20:40+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-09T20:20:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=bebfbfab3bca1808678bb196904b7570d6806458'/>
<id>bebfbfab3bca1808678bb196904b7570d6806458</id>
<content type='text'>
The change tracking used a single lines/lines_tmp table to track
changes to a buffer.

If multiple clients using incremental sync are connected to a buffer,
they both made changes to the same lines table. That resulted in an
inconsistent state.

This commit changes the didChange handling to group clients by
synchronization scheme and offset encoding.
This avoids computing the diff multiple times for clients using the
same scheme and resolves the lines/lines_tmp conflicts.

Fixes https://github.com/neovim/neovim/issues/19325</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change tracking used a single lines/lines_tmp table to track
changes to a buffer.

If multiple clients using incremental sync are connected to a buffer,
they both made changes to the same lines table. That resulted in an
inconsistent state.

This commit changes the didChange handling to group clients by
synchronization scheme and offset encoding.
This avoids computing the diff multiple times for clients using the
same scheme and resolves the lines/lines_tmp conflicts.

Fixes https://github.com/neovim/neovim/issues/19325</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lsp): set formatexpr by default (#19677)</title>
<updated>2022-08-08T16:30:17+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-08T16:30:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=68c674af0fbc4158690319aa6125a098a592412d'/>
<id>68c674af0fbc4158690319aa6125a098a592412d</id>
<content type='text'>
Follow up to https://github.com/neovim/neovim/pull/19003</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow up to https://github.com/neovim/neovim/pull/19003</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): set end_col in formatexpr (#19676)</title>
<updated>2022-08-08T11:02:15+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-08T11:02:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=a46e6afb8b95229478c5c1fb75e3f1c55991def0'/>
<id>a46e6afb8b95229478c5c1fb75e3f1c55991def0</id>
<content type='text'>
The last line was excluded from formatting via formatexpr because the
character in the params was set to 0 instead of the end of line.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The last line was excluded from formatting via formatexpr because the
character in the params was set to 0 instead of the end of line.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lsp): disable exit_timeout by default (#19672)</title>
<updated>2022-08-08T10:34:37+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-08T10:34:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=2d5fce2cdb1254391481a1603be7bfb0872044a5'/>
<id>2d5fce2cdb1254391481a1603be7bfb0872044a5</id>
<content type='text'>
The lsp client used to wait up to 500ms for a language server to
shutdown before sending a TERM signal.

The intention behind the 500ms grace period was to ensure the language
server exits to prevent stale processes, but it has the side-effect that
it can interrupt language-servers which are too slow to shutdown within
500ms. Language servers tend to write out index files or project files
on shutdown, and being interrupted during this process can cause
corruption of those files.

This changes the default to not wait at all, at the risk of leaving
stale processes around if the language server isn't well behaved.

An alternative would be to wait indefinitely, but that can cause neovim
to take several seconds to exit.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The lsp client used to wait up to 500ms for a language server to
shutdown before sending a TERM signal.

The intention behind the 500ms grace period was to ensure the language
server exits to prevent stale processes, but it has the side-effect that
it can interrupt language-servers which are too slow to shutdown within
500ms. Language servers tend to write out index files or project files
on shutdown, and being interrupted during this process can cause
corruption of those files.

This changes the default to not wait at all, at the risk of leaving
stale processes around if the language server isn't well behaved.

An alternative would be to wait indefinitely, but that can cause neovim
to take several seconds to exit.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): send didOpen if name changes on write (#19583)</title>
<updated>2022-08-01T20:32:53+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-08-01T20:32:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=e99de3f12f00662e8131fed9912792f6d43c4975'/>
<id>e99de3f12f00662e8131fed9912792f6d43c4975</id>
<content type='text'>
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.

Closes https://github.com/neovim/neovim/issues/18688</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`:saveas newName` changes the name of an existing buffer.
Due to the buffer re-use it skips the lsp attach phase and immediately
sends a `didSave` notification to the server.
Servers get confused about this, because they expect a `didOpen`
notification first.

Closes https://github.com/neovim/neovim/issues/18688</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(lsp): use autocmd api (#19407)</title>
<updated>2022-07-17T17:13:33+00:00</updated>
<author>
<name>ii14</name>
<email>59243201+ii14@users.noreply.github.com</email>
</author>
<published>2022-07-17T17:13:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=13abe20b5f855779456c84b9583ed614223a69c8'/>
<id>13abe20b5f855779456c84b9583ed614223a69c8</id>
<content type='text'>
* refactor(lsp): use autocmd api

* refactor(lsp): inline BufWritePost and VimLeavePre callbacks

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* refactor(lsp): use autocmd api

* refactor(lsp): inline BufWritePost and VimLeavePre callbacks

</pre>
</div>
</content>
</entry>
<entry>
<title>refactor: use `local api = vim.api`</title>
<updated>2022-07-15T16:26:47+00:00</updated>
<author>
<name>ii14</name>
<email>ii14@users.noreply.github.com</email>
</author>
<published>2022-07-15T16:26:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f59c96903a61702c69a5bf23a7adb09fff435331'/>
<id>f59c96903a61702c69a5bf23a7adb09fff435331</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
