summaryrefslogtreecommitdiff
path: root/script/core/view/psi-select.lua
blob: b6733aa5dfd2d8bb52060a7e8bbd4e9c3243bea1 (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(uri, position)
    return { data = guide.positionToOffset(state, pos) }
end