File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ inferServerCapabilities clientCaps o h =
153
153
, _documentFormattingProvider = supportedBool STextDocumentFormatting
154
154
, _documentRangeFormattingProvider = supportedBool STextDocumentRangeFormatting
155
155
, _documentOnTypeFormattingProvider = documentOnTypeFormattingProvider
156
- , _renameProvider = supportedBool STextDocumentRename
156
+ , _renameProvider = renameProvider
157
157
, _documentLinkProvider = supported' STextDocumentDocumentLink $ DocumentLinkOptions
158
158
(Just False )
159
159
(supported SDocumentLinkResolve )
@@ -233,6 +233,17 @@ inferServerCapabilities clientCaps o h =
233
233
error " executeCommandCommands needs to be set if a executeCommandHandler is set"
234
234
| otherwise = Nothing
235
235
236
+ clientSupportsPrepareRename = fromMaybe False $
237
+ clientCaps ^? LSP. textDocument . _Just . LSP. rename . _Just . LSP. prepareSupport . _Just
238
+
239
+ renameProvider
240
+ | clientSupportsPrepareRename
241
+ , supported_b STextDocumentRename
242
+ , supported_b STextDocumentPrepareRename = Just $
243
+ InR . RenameOptions Nothing . Just $ True
244
+ | supported_b STextDocumentRename = Just (InL True )
245
+ | otherwise = Just (InL False )
246
+
236
247
sync = case textDocumentSync o of
237
248
Just x -> Just (InL x)
238
249
Nothing -> Nothing
You can’t perform that action at this time.
0 commit comments