Skip to content

Commit 4b0d636

Browse files
committed
Implement PluginMethod for more methods
1 parent 88b62f3 commit 4b0d636

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

hls-plugin-api/src/Ide/Types.hs

+23-10
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,33 @@ pluginResponsible uri pluginDesc
218218
mfp = uriToFilePath uri
219219

220220
instance PluginMethod TextDocumentDefinition where
221-
pluginEnabled = undefined
222-
combineResponses = undefined
221+
pluginEnabled _ msgParams pluginDesc _ =
222+
pluginResponsible uri pluginDesc
223+
where
224+
uri = msgParams ^. J.textDocument . J.uri
225+
combineResponses _ _ _ _ (x :| _) = x
226+
223227
instance PluginMethod TextDocumentTypeDefinition where
224-
pluginEnabled = undefined
225-
combineResponses = undefined
228+
pluginEnabled _ msgParams pluginDesc _ =
229+
pluginResponsible uri pluginDesc
230+
where
231+
uri = msgParams ^. J.textDocument . J.uri
232+
combineResponses _ _ _ _ (x :| _) = x
233+
226234
instance PluginMethod TextDocumentDocumentHighlight where
227-
pluginEnabled = undefined
228-
combineResponses = undefined
235+
pluginEnabled _ msgParams pluginDesc _ =
236+
pluginResponsible uri pluginDesc
237+
where
238+
uri = msgParams ^. J.textDocument . J.uri
239+
229240
instance PluginMethod TextDocumentReferences where
230-
pluginEnabled = undefined
231-
combineResponses = undefined
241+
pluginEnabled _ msgParams pluginDesc _ =
242+
pluginResponsible uri pluginDesc
243+
where
244+
uri = msgParams ^. J.textDocument . J.uri
245+
232246
instance PluginMethod WorkspaceSymbol where
233-
pluginEnabled = undefined
234-
combineResponses = undefined
247+
pluginEnabled _ _ _ _ = True
235248

236249
instance PluginMethod TextDocumentCodeLens where
237250
pluginEnabled _ msgParams pluginDesc config =

0 commit comments

Comments
 (0)