Skip to content

Commit 556e56a

Browse files
authored
Merge pull request #147 from alanz/typedefprovider-config
Set the typedefinitionProvider capability if it has a handler
2 parents 47af965 + 6f90b19 commit 556e56a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Language/Haskell/LSP/Core.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ initializeRequestHandler' (_configHandler,dispatcherProc) mHandler tvarCtx req@(
600600
supported (Just _) = Just True
601601
supported Nothing = Nothing
602602

603+
-- If a dynamic setting is provided use it, else set a
604+
-- static True if there is a handler.
605+
static (Just d) _ = Just d
606+
static _ (Just _) = Just (J.GotoOptionsStatic True)
607+
static _ Nothing = Nothing
608+
603609
sync = case textDocumentSync o of
604610
Just x -> Just (J.TDSOptions x)
605611
Nothing -> Nothing
@@ -618,7 +624,7 @@ initializeRequestHandler' (_configHandler,dispatcherProc) mHandler tvarCtx req@(
618624
, J._completionProvider = completionProvider o
619625
, J._signatureHelpProvider = signatureHelpProvider o
620626
, J._definitionProvider = supported (definitionHandler h)
621-
, J._typeDefinitionProvider = typeDefinitionProvider o
627+
, J._typeDefinitionProvider = static (typeDefinitionProvider o) (typeDefinitionHandler h)
622628
, J._implementationProvider = implementationProvider o
623629
, J._referencesProvider = supported (referencesHandler h)
624630
, J._documentHighlightProvider = supported (documentHighlightHandler h)

0 commit comments

Comments
 (0)