Merge pull request #105 from epheien/feat-selectionRange

feat: selectionRange fallback: selectionRange => location.range => range
This commit is contained in:
~hedy
2024-12-27 09:03:40 +08:00
committed by GitHub

View File

@@ -47,7 +47,8 @@ function M.get_selection_range(token)
-- support symbolinformation[] -- support symbolinformation[]
-- https://microsoft.github.io/language-server-protocol/specification#textdocument_documentsymbol -- https://microsoft.github.io/language-server-protocol/specification#textdocument_documentsymbol
if token.selectionRange == nil then 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 end
return token.selectionRange return token.selectionRange