Skip to content

Commit 85a9565

Browse files
authored
fix _rootPath in initializeParams (#573)
* fix initializeParams * use record syntax for initializeParams
1 parent 31a9856 commit 85a9565

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -278,19 +278,20 @@ runSessionWithHandles' serverProc serverIn serverOut config' caps rootDir sessio
278278

279279
let initializeParams =
280280
InitializeParams
281-
Nothing
282-
-- Narrowing to Int32 here, but it's unlikely that a PID will
283-
-- be outside the range
284-
(InL $ fromIntegral pid)
285-
(Just lspTestClientInfo)
286-
(Just $ T.pack absRootDir)
287-
Nothing
288-
(InL $ filePathToUri absRootDir)
289-
caps
290-
-- TODO: make this configurable?
291-
(Just $ Object $ lspConfig config')
292-
(Just TraceValue_Off)
293-
(fmap InL $ initialWorkspaceFolders config)
281+
{ _workDoneToken = Nothing
282+
, -- Narrowing to Int32 here, but it's unlikely that a PID will
283+
-- be outside the range
284+
_processId = InL $ fromIntegral pid
285+
, _clientInfo = Just lspTestClientInfo
286+
, _locale = Nothing
287+
, _rootPath = Just (InL $ T.pack absRootDir)
288+
, _rootUri = InL $ filePathToUri absRootDir
289+
, _capabilities = caps
290+
, -- TODO: make this configurable?
291+
_initializationOptions = Just $ Object $ lspConfig config'
292+
, _trace = Just TraceValue_Off
293+
, _workspaceFolders = InL <$> initialWorkspaceFolders config
294+
}
294295
runSession' serverIn serverOut serverProc listenServer config caps rootDir exitServer $ do
295296
-- Wrap the session around initialize and shutdown calls
296297
initReqId <- sendRequest SMethod_Initialize initializeParams

0 commit comments

Comments
 (0)