File tree Expand file tree Collapse file tree 5 files changed +6
-6
lines changed
lsp/src/Language/LSP/Server Expand file tree Collapse file tree 5 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -430,7 +430,7 @@ createDoc file languageId contents = do
430
430
createHits (WatchKind create _ _) = create
431
431
432
432
regHits :: Registration WorkspaceDidChangeWatchedFiles -> Bool
433
- regHits reg = foldl' (\ acc w -> acc || watchHits w) False (reg ^. registerOptions . watchers)
433
+ regHits reg = foldl' (\ acc w -> acc || watchHits w) False (reg ^. registerOptions . _Just . watchers)
434
434
435
435
clientCapsSupports =
436
436
caps ^? workspace . _Just . didChangeWatchedFiles . _Just . dynamicRegistration . _Just
Original file line number Diff line number Diff line change @@ -370,8 +370,8 @@ main = hspec $ around withDummyServer $ do
370
370
liftIO $ do
371
371
case regMethod `mEqClient` SWorkspaceDidChangeWatchedFiles of
372
372
Just (Right HRefl ) ->
373
- regOpts `shouldBe` (DidChangeWatchedFilesRegistrationOptions $ List
374
- [ FileSystemWatcher " *.watch" (Just (WatchKind True True True )) ])
373
+ regOpts `shouldBe` (Just ( DidChangeWatchedFilesRegistrationOptions $ List
374
+ [ FileSystemWatcher " *.watch" (Just (WatchKind True True True )) ]) )
375
375
_ -> expectationFailure " Registration wasn't on workspace/didChangeWatchedFiles"
376
376
377
377
-- now unregister it by sending a specific createDoc
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ data Registration (m :: Method FromClient t) =
111
111
, _method :: SClientMethod m
112
112
-- | Options necessary for the registration.
113
113
-- Make this strict to aid the pattern matching exhaustiveness checker
114
- , _registerOptions :: ! (RegistrationOptions m )
114
+ , _registerOptions :: ! (Maybe ( RegistrationOptions m ) )
115
115
}
116
116
deriving Generic
117
117
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ spec = describe "server capabilities" $ do
34
34
Just registrationParams = decode input :: Maybe RegistrationParams
35
35
in registrationParams ^. registrations `shouldBe`
36
36
List [SomeRegistration $ Registration " 4a56f5ca-7188-4f4c-a366-652d6f9d63aa"
37
- SWorkspaceDidChangeConfiguration Empty ]
37
+ SWorkspaceDidChangeConfiguration ( Just Empty ) ]
38
38
where
39
39
documentFilters = List [DocumentFilter (Just " haskell" ) Nothing Nothing ]
40
40
documentFiltersJson = " [{\" language\" : \" haskell\" }]"
Original file line number Diff line number Diff line change @@ -503,7 +503,7 @@ registerCapability method regOpts f = do
503
503
-- First, check to see if the client supports dynamic registration on this method
504
504
| dynamicSupported clientCaps = do
505
505
uuid <- liftIO $ UUID. toText <$> getStdRandom random
506
- let registration = J. Registration uuid method regOpts
506
+ let registration = J. Registration uuid method ( Just regOpts)
507
507
params = J. RegistrationParams (J. List [J. SomeRegistration registration])
508
508
regId = RegistrationId uuid
509
509
rio <- askUnliftIO
You can’t perform that action at this time.
0 commit comments