<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/lua/vim/lsp, branch 20220114-mix</title>
<subtitle>Neovim fork with Rahm's personal hacks.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/'/>
<entry>
<title>fix(semantic_tokens.lua): Fix nil tokens/data in semantic_tokens.lua</title>
<updated>2023-01-19T20:08:12+00:00</updated>
<author>
<name>Josh Rahm</name>
<email>rahm@google.com</email>
</author>
<published>2023-01-19T19:37:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=b3e662b4b5b41e19368318dfaf09c731fbaf9597'/>
<id>b3e662b4b5b41e19368318dfaf09c731fbaf9597</id>
<content type='text'>
Some (poorly-implemented) LSPs can return an empty JSON object in
LSP responses, which could cause tokens to be nil, which would eventually
cause an error and a bad UI experience. This fix makes sure that the
tokens variable is always set to a non-nil value.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some (poorly-implemented) LSPs can return an empty JSON object in
LSP responses, which could cause tokens to be nil, which would eventually
cause an error and a bad UI experience. This fix makes sure that the
tokens variable is always set to a non-nil value.
</pre>
</div>
</content>
</entry>
<entry>
<title>docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)</title>
<updated>2023-01-12T14:51:19+00:00</updated>
<author>
<name>Chris Kipp</name>
<email>ckipp@pm.me</email>
</author>
<published>2023-01-12T14:51:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=443bbfd59e2818aeee72d2ed77af1cb24617e46f'/>
<id>443bbfd59e2818aeee72d2ed77af1cb24617e46f</id>
<content type='text'>
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): revert semantic token gravity change from #21574 (#21763)</title>
<updated>2023-01-12T06:13:52+00:00</updated>
<author>
<name>jdrouhard</name>
<email>john@drouhard.dev</email>
</author>
<published>2023-01-12T06:13:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=143d3f1f3224bca02bfef7df0932b9d7524a3ff2'/>
<id>143d3f1f3224bca02bfef7df0932b9d7524a3ff2</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): update buf_notify and rpc.notify params types (#21753)</title>
<updated>2023-01-11T19:17:10+00:00</updated>
<author>
<name>Chris Kipp</name>
<email>ckipp@pm.me</email>
</author>
<published>2023-01-11T19:17:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=a37c686d21c1ad4e50f455e989642d38435d41ba'/>
<id>a37c686d21c1ad4e50f455e989642d38435d41ba</id>
<content type='text'>
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Small, but I was getting warnings about my usage of
`vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs
say that `params` must be a string, however this can really be anything
when it's passed to `rpc.notify` since we just end up calling
`vim.json.encode(payload)` on it. This fixes the docs in those two
places and regenerates them.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(float): open float relative to mouse #21531</title>
<updated>2023-01-10T10:22:41+00:00</updated>
<author>
<name>Sebastian Lyng Johansen</name>
<email>seblyng98@gmail.com</email>
</author>
<published>2023-01-10T10:22:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=870ca1de52b240926b88f01afa697cd9b119bdac'/>
<id>870ca1de52b240926b88f01afa697cd9b119bdac</id>
<content type='text'>
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line &lt; col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '&lt;MouseMove&gt;', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '&lt;MouseMove&gt;'
    end, { expr = true })
    ```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:
No easy way to position a LSP hover window relative to mouse.

Solution:
Introduce another option to the `relative` key in `nvim_open_win()`.

With this PR it should be possible to override the handler and do something
similar to this https://github.com/neovim/neovim/pull/19481#issuecomment-1193248674
to have hover information displayed from the mouse.

Test case:

    ```lua
    local util = require('vim.lsp.util')

    local function make_position_param(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        local row, col

        local mouse = vim.fn.getmousepos()
        row = mouse.line
        col = mouse.column

        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        row = row - 1
        local line = vim.api.nvim_buf_get_lines(buf, row, row + 1, true)[1]
        if not line then
            return { line = 0, character = 0 }
        end
        if #line &lt; col then
            return { line = 0, character = 0 }
        end

        col = util._str_utfindex_enc(line, col, offset_encoding)

        return { line = row, character = col }
    end

    local make_params = function(window, offset_encoding)
        window = window or 0
        local buf = vim.api.nvim_win_get_buf(window)
        offset_encoding = offset_encoding or util._get_offset_encoding(buf)
        return {
            textDocument = util.make_text_document_params(buf),
            position = make_position_param(window, offset_encoding),
        }
    end

    local hover_timer = nil
    vim.o.mousemoveevent = true

    vim.keymap.set({ '', 'i' }, '&lt;MouseMove&gt;', function()
        if hover_timer then
            hover_timer:close()
        end
        hover_timer = vim.defer_fn(function()
            hover_timer = nil
            local params = make_params()
            vim.lsp.buf_request(
                0,
                'textDocument/hover',
                params,
                vim.lsp.with(vim.lsp.handlers.hover, {
                    silent = true,
                    focusable = false,
                    relative = 'mouse',
                })
            )
        end, 500)
        return '&lt;MouseMove&gt;'
    end, { expr = true })
    ```</pre>
</div>
</content>
</entry>
<entry>
<title>feat(lsp): show active clients in :checkhealth vim.lsp (#21670)</title>
<updated>2023-01-08T08:23:08+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2023-01-08T08:23:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=d1b3611f03625467500195b38d3c4646a7bc81db'/>
<id>d1b3611f03625467500195b38d3c4646a7bc81db</id>
<content type='text'>
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For users using vim.lsp.start it can be useful to get an
overview of active client that is less verbose than a full `:lua
=vim.lsp.get_active_clients()`</pre>
</div>
</content>
</entry>
<entry>
<title>fix(lsp): partially revert semantic token gravity change from #21574 (#21680)</title>
<updated>2023-01-08T06:43:15+00:00</updated>
<author>
<name>jdrouhard</name>
<email>john@drouhard.dev</email>
</author>
<published>2023-01-08T06:43:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=0b136a14dc215d94ceac6d72d9f9fcb1c3ea5bc9'/>
<id>0b136a14dc215d94ceac6d72d9f9fcb1c3ea5bc9</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): correct callHierarchy capability to fix lsp.buf.incoming_calls() (#21665)</title>
<updated>2023-01-06T14:26:31+00:00</updated>
<author>
<name>周</name>
<email>1207190489@qq.com</email>
</author>
<published>2023-01-06T14:26:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=f7ad46e69ed407579517694ccf3dc1beffe7acdc'/>
<id>f7ad46e69ed407579517694ccf3dc1beffe7acdc</id>
<content type='text'>
Co-authored-by: maozhongzhou &lt;maozhongzhou@wps.cn&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Co-authored-by: maozhongzhou &lt;maozhongzhou@wps.cn&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>docs(lua): adjust some type annotations</title>
<updated>2023-01-04T11:48:41+00:00</updated>
<author>
<name>notomo</name>
<email>notomo.motono@gmail.com</email>
</author>
<published>2023-01-04T11:48:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=e35b9020b16985eee26e942f9a3f6b045bc3809b'/>
<id>e35b9020b16985eee26e942f9a3f6b045bc3809b</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): add function to clear codelens (#21504)</title>
<updated>2022-12-31T15:16:21+00:00</updated>
<author>
<name>Mathias Fußenegger</name>
<email>mfussenegger@users.noreply.github.com</email>
</author>
<published>2022-12-31T15:16:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.josher.dev/cgit/rneovim.git/commit/?id=6ba34e21fee2a81677e8261dfeaf24c8cd320500'/>
<id>6ba34e21fee2a81677e8261dfeaf24c8cd320500</id>
<content type='text'>
Currently once you retrieve the lenses you're pretty much stuck with
them as saving new lenses is additive.

Adding a dedicated method to reset lenses allows users to toggle lenses
on/off which can be useful for language servers where they are noisy or
expensive and you only want to see them temporary.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently once you retrieve the lenses you're pretty much stuck with
them as saving new lenses is additive.

Adding a dedicated method to reset lenses allows users to toggle lenses
on/off which can be useful for language servers where they are noisy or
expensive and you only want to see them temporary.</pre>
</div>
</content>
</entry>
</feed>
