Skip to content

Commit 52f6bf2

Browse files
committed
Allow null in prepareRename
According to the specification, `textDocument/prepareRename` returns either a range or null. The latter indicates that the rename request is not valid at this location. Wrap ResponseResult TextDocumentPrepareRename into a Maybe to accomodate this.
1 parent cedf0a4 commit 52f6bf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lsp-types/src/Language/LSP/Types/Message.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ type family ResponseResult (m :: Method f Request) :: Type where
193193
ResponseResult TextDocumentOnTypeFormatting = List TextEdit
194194
-- Rename
195195
ResponseResult TextDocumentRename = WorkspaceEdit
196-
ResponseResult TextDocumentPrepareRename = Range |? RangeWithPlaceholder
196+
ResponseResult TextDocumentPrepareRename = Maybe (Range |? RangeWithPlaceholder)
197197
-- FoldingRange
198198
ResponseResult TextDocumentFoldingRange = List FoldingRange
199199
ResponseResult TextDocumentSelectionRange = List SelectionRange

0 commit comments

Comments
 (0)