Skip to content

Commit

Permalink
Merge pull request #105 from epheien/feat-selectionRange
Browse files Browse the repository at this point in the history
feat: selectionRange fallback: selectionRange => location.range => range
  • Loading branch information
hedyhli authored Dec 27, 2024
2 parents ffde729 + 70d95d7 commit fca37f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/outline/utils/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ function M.get_selection_range(token)
-- support symbolinformation[]
-- https://microsoft.github.io/language-server-protocol/specification#textdocument_documentsymbol
if token.selectionRange == nil then
return token.location.range
-- fallback: selectionRange => location.range => range
return token.location and token.location.range or token.range
end

return token.selectionRange
Expand Down

0 comments on commit fca37f0

Please sign in to comment.