Merge pull request #105 from epheien/feat-selectionRange
feat: selectionRange fallback: selectionRange => location.range => range
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user