Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions lua/r/lsp/references.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,18 @@ function M.find_locations(line, col, bufnr)
return { locations = locs, word = word, resolved = false }
end

local pipe = require("r.lsp.pipe")
local pipe_locs = pipe.find_locations(bufnr, row, col, word)
if pipe_locs and #pipe_locs > 0 then
return {
locations = utils.deduplicate_locations(pipe_locs),
word = word,
resolved = true,
}
end

local target_definition = scope.resolve_symbol(word, current_scope)
if not target_definition then
-- Try pipe chain column resolution (tidyverse data-masking)
local pipe = require("r.lsp.pipe")
local pipe_locs = pipe.find_locations(bufnr, row, col, word)
if pipe_locs and #pipe_locs > 0 then
return {
locations = utils.deduplicate_locations(pipe_locs),
word = word,
resolved = true,
}
end

local locs = collect_workspace_references(word, bufnr)
return { locations = locs, word = word, resolved = false }
end
Expand Down
Loading