summaryrefslogtreecommitdiff
path: root/script/core/view/psi-select.lua
blob: 4064203933cd1a5cb1cf64959d1c422364285e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
local files = require("files")
local guide = require("parser.guide")
local converter = require("proto.converter")

return function(uri, position)
    local state = files.getState(uri)
    if not state then
        return
    end

    local pos = converter.unpackPosition(state, position)
    return { data = guide.positionToOffset(state, pos) }
end