summaryrefslogtreecommitdiff
path: root/script/provider/inlay-hint.lua
blob: 12b43330eb9f19160e20d670ec77f374d5a5d5b7 (plain)
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
27
28
29
local proto          = require 'proto'
local client         = require 'client'
local json           = require "json"
local config         = require 'config'

local function refresh()
    if not client.isReady() then
        return
    end
    if not client.getAbility 'workspace.inlayHint.refreshSupport' then
        return
    end
    log.debug('Refresh inlay hints.')
    proto.request('workspace/inlayHint/refresh', json.null)
end

config.watch(function (uri, key, value, oldValue)
    if key == '' then
        refresh()
    end
    if key:find '^Lua.runtime'
    or key:find '^Lua.workspace'
    or key:find '^Lua.hint'
    or key:find '^files' then
        refresh()
    end
end)

return {}