Skip to content

Commit

Permalink
fix _rootPath in initializeParams (#573)
Browse files Browse the repository at this point in the history
* fix initializeParams
* use record syntax for initializeParams
  • Loading branch information
soulomoon authored May 16, 2024
1 parent 31a9856 commit 85a9565
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lsp-test/src/Language/LSP/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -278,19 +278,20 @@ runSessionWithHandles' serverProc serverIn serverOut config' caps rootDir sessio

let initializeParams =
InitializeParams
Nothing
-- Narrowing to Int32 here, but it's unlikely that a PID will
-- be outside the range
(InL $ fromIntegral pid)
(Just lspTestClientInfo)
(Just $ T.pack absRootDir)
Nothing
(InL $ filePathToUri absRootDir)
caps
-- TODO: make this configurable?
(Just $ Object $ lspConfig config')
(Just TraceValue_Off)
(fmap InL $ initialWorkspaceFolders config)
{ _workDoneToken = Nothing
, -- Narrowing to Int32 here, but it's unlikely that a PID will
-- be outside the range
_processId = InL $ fromIntegral pid
, _clientInfo = Just lspTestClientInfo
, _locale = Nothing
, _rootPath = Just (InL $ T.pack absRootDir)
, _rootUri = InL $ filePathToUri absRootDir
, _capabilities = caps
, -- TODO: make this configurable?
_initializationOptions = Just $ Object $ lspConfig config'
, _trace = Just TraceValue_Off
, _workspaceFolders = InL <$> initialWorkspaceFolders config
}
runSession' serverIn serverOut serverProc listenServer config caps rootDir exitServer $ do
-- Wrap the session around initialize and shutdown calls
initReqId <- sendRequest SMethod_Initialize initializeParams
Expand Down

0 comments on commit 85a9565

Please sign in to comment.