Skip to content

Commit 4945a6a

Browse files
committed
Add a comment
1 parent 9146668 commit 4945a6a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lsp-test/src/Language/LSP/Test/Session.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,15 @@ updateStateC = awaitForever $ \msg -> do
318318
c <- curLspConfig <$> get @SessionState
319319
case c of
320320
Object o -> do
321+
-- check for each requested section whether we have it
321322
let configsOrErrs = (flip fmap) requestedSections $ \section ->
322323
case o ^. at (fromString $ T.unpack section) of
323324
Just config -> Right config
324325
Nothing -> Left section
325326

326327
let (errs, configs) = partitionEithers configsOrErrs
327328

329+
-- we have to return exactly the number of sections requested, so if we can't find all of them then that's an error
328330
if null errs
329331
then sendMessage $ TResponseMessage "2.0" (Just $ r ^. L.id) (Right configs)
330332
else sendMessage @_ @(TResponseError Method_WorkspaceConfiguration) $

0 commit comments

Comments
 (0)