summaryrefslogtreecommitdiff
path: root/script/method/workspace/didChangeConfiguration.lua
blob: ecaa9182535f0b91b7e48619fa1817d89ed2d1c0 (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
local rpc = require 'rpc'

return function (lsp)
    local uri = lsp.workspace and lsp.workspace.uri
    -- 请求配置
    rpc:request('workspace/configuration', {
        items = {
            {
                scopeUri = uri,
                section = 'Lua',
            },
            {
                scopeUri = uri,
                section = 'files.associations',
            },
            {
                scopeUri = uri,
                section = 'files.exclude',
            }
        },
    }, function (configs)
        lsp:onUpdateConfig(configs[1], {
            associations = configs[2],
            exclude      = configs[3],
        })
    end)
end