Skip to content

Commit

Permalink
Log the initial config we get from the initialize request
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpj committed Oct 8, 2023
1 parent 9b1d6ba commit 5bb7a64
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lsp/src/Language/LSP/Server/Processing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import Data.Text.Prettyprint.Doc
import Language.LSP.Protocol.Lens qualified as L
import Language.LSP.Protocol.Message
import Language.LSP.Protocol.Types
import Language.LSP.Protocol.Utils.Misc
import Language.LSP.Protocol.Utils.SMethodMap (SMethodMap)
import Language.LSP.Protocol.Utils.SMethodMap qualified as SMethodMap
import Language.LSP.Server.Core
Expand Down Expand Up @@ -151,7 +152,9 @@ initializeRequestHandler logger ServerDefinition{..} vfs sendFunc req = do

initialConfig <- case configObject of
Just o -> case parseConfig defaultConfig o of
Right newConfig -> pure newConfig
Right newConfig -> do
liftIO $ logger <& (LspCore $ NewConfig o) `WithSeverity` Debug
pure newConfig
Left err -> do
-- Warn not error here, since initializationOptions is pretty unspecified
liftIO $ logger <& (LspCore $ ConfigurationParseError o err) `WithSeverity` Warning
Expand Down

0 comments on commit 5bb7a64

Please sign in to comment.