Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Created December 6, 2023 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonmichael/471e39866094157b615fa55980f08f98 to your computer and use it in GitHub Desktop.
Save simonmichael/471e39866094157b615fa55980f08f98 to your computer and use it in GitHub Desktop.
HLS startup failure, max verbosity
[Info - 11:37:57 PM] Stopping the server
[Trace - 11:37:57 PM] Sending request 'shutdown - (1)'.
[Trace - 11:37:57 PM] Received response 'shutdown - (1)' in 1ms.
No result returned.
[Trace - 11:37:57 PM] Sending notification 'exit'.
No parameters provided.
[Info - 11:37:57 PM] Starting the server
[Trace - 11:37:57 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 56779,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.84.2"
},
"locale": "en-us",
"rootPath": "/Users/simon/src/hledger",
"rootUri": "file:///Users/simon/src/hledger",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional",
"normalizesLineEndings": true,
"changeAnnotationSupport": {
"groupsOnLabel": true
}
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [
1
]
}
},
"codeLens": {
"refreshSupport": true
},
"executeCommand": {
"dynamicRegistration": true
},
"configuration": true,
"workspaceFolders": true,
"semanticTokens": {
"refreshSupport": true
},
"fileOperations": {
"dynamicRegistration": true,
"didCreate": true,
"didRename": true,
"didDelete": true,
"willCreate": true,
"willRename": true,
"willDelete": true
}
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [
1,
2
]
},
"codeDescriptionSupport": true,
"dataSupport": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"insertReplaceSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"detail",
"additionalTextEdits"
]
},
"insertTextModeSupport": {
"valueSet": [
1,
2
]
}
},
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
},
"activeParameterSupport": true
},
"contextSupport": true
},
"definition": {
"dynamicRegistration": true,
"linkSupport": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"labelSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"disabledSupport": true,
"dataSupport": true,
"resolveSupport": {
"properties": [
"edit"
]
},
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"honorsChangeAnnotations": false
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true,
"prepareSupportDefaultBehavior": 1,
"honorsChangeAnnotations": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true,
"linkSupport": true
},
"implementation": {
"dynamicRegistration": true,
"linkSupport": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true
},
"declaration": {
"dynamicRegistration": true,
"linkSupport": true
},
"selectionRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": true
},
"semanticTokens": {
"dynamicRegistration": true,
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator"
],
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"formats": [
"relative"
],
"requests": {
"range": true,
"full": {
"delta": true
}
},
"multilineTokenSupport": false,
"overlappingTokenSupport": false
},
"linkedEditingRange": {
"dynamicRegistration": true
}
},
"window": {
"showMessage": {
"messageActionItem": {
"additionalPropertiesSupport": true
}
},
"showDocument": {
"support": true
},
"workDoneProgress": true
},
"general": {
"regularExpressions": {
"engine": "ECMAScript",
"version": "ES2020"
},
"markdown": {
"parser": "marked",
"version": "1.1.0"
}
}
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///Users/simon/src/hledger",
"name": "hledger"
}
]
}
2023-12-06T09:37:57.868166Z | Error | Got EOF
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 2.5.0.0 aarch64 ghc-9.2.8
Current directory: /
Operating system: darwin
Arguments: ["--lsp"]
Cradle directory: /
Cradle type: Default
Tool versions found on the $PATH
cabal: 3.10.2.0
stack: 2.13.1
ghc: 9.6.3
Consulting the cradle to get project GHC version...
2023-12-06T09:37:58.091468Z | Debug | executing command: ghc --numeric-version
Failed to find the GHC version of this Default project.
Couldn't execute ghc --numeric-version
2023-12-06T09:37:58.093819Z | Info | Starting server
[Trace - 11:37:58 PM] Received request 'window/showMessageRequest - (0)'.
Params: {
"actions": [
{
"title": "Try to restart"
}
],
"message": "Failed to find the GHC version of this Default project.\nCouldn't execute ghc --numeric-version",
"type": 1
}
[Trace - 11:37:58 PM] Received response 'initialize - (0)' in 220ms.
Result: {
"capabilities": {
"callHierarchyProvider": false,
"codeActionProvider": false,
"colorProvider": false,
"declarationProvider": false,
"definitionProvider": false,
"documentFormattingProvider": false,
"documentHighlightProvider": false,
"documentRangeFormattingProvider": false,
"documentSymbolProvider": false,
"foldingRangeProvider": false,
"hoverProvider": false,
"implementationProvider": false,
"positionEncoding": "utf-16",
"referencesProvider": false,
"renameProvider": false,
"selectionRangeProvider": false,
"semanticTokensProvider": {
"legend": {
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator",
"decorator"
]
}
},
"textDocumentSync": {
"change": 2,
"openClose": true,
"save": {}
},
"typeDefinitionProvider": false,
"workspace": {},
"workspaceSymbolProvider": false
}
}
[Trace - 11:37:58 PM] Sending notification 'initialized'.
Params: {}
[Trace - 11:37:58 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": {
"haskell": {
"formattingProvider": "fourmolu",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"trace": {
"server": "verbose",
"client": "debug"
},
"logFile": "",
"releasesURL": "",
"metadataURL": "",
"releasesDownloadStoragePath": "",
"serverExecutablePath": "",
"serverExtraArgs": "",
"ghcupExecutablePath": "",
"serverEnvironment": {},
"promptBeforeDownloads": "true",
"manageHLS": "GHCup",
"toolchain": {},
"upgradeGHCup": false,
"checkProject": false,
"maxCompletions": 40,
"plugin": {
"alternateNumberFormat": {
"globalOn": true
},
"cabal": {
"globalOn": true,
"completionOn": true
},
"callHierarchy": {
"globalOn": true
},
"changeTypeSignature": {
"globalOn": true
},
"class": {
"codeActionsOn": true,
"codeLensOn": true
},
"eval": {
"config": {
"diff": true,
"exception": false
},
"globalOn": true
},
"explicit-fields": {
"globalOn": true
},
"explicit-fixity": {
"globalOn": true
},
"fourmolu": {
"config": {
"external": false
}
},
"gadt": {
"globalOn": true
},
"ghcide-code-actions-bindings": {
"globalOn": true
},
"ghcide-code-actions-fill-holes": {
"globalOn": true
},
"ghcide-code-actions-imports-exports": {
"globalOn": true
},
"ghcide-code-actions-type-signatures": {
"globalOn": true
},
"ghcide-completions": {
"config": {
"autoExtendOn": true,
"snippetsOn": true
},
"globalOn": true
},
"ghcide-hover-and-symbols": {
"hoverOn": true,
"symbolsOn": true
},
"ghcide-type-lenses": {
"config": {
"mode": "always"
},
"globalOn": true
},
"haddockComments": {
"globalOn": true
},
"hlint": {
"codeActionsOn": true,
"config": {
"flags": []
},
"diagnosticsOn": true
},
"importLens": {
"codeActionsOn": true,
"codeLensOn": true
},
"moduleName": {
"globalOn": true
},
"pragmas": {
"codeActionsOn": true,
"completionOn": true
},
"qualifyImportedNames": {
"globalOn": true
},
"refineImports": {
"codeActionsOn": true,
"codeLensOn": true
},
"rename": {
"config": {
"crossModule": false
},
"globalOn": true
},
"retrie": {
"globalOn": true
},
"splice": {
"globalOn": true
},
"stan": {
"globalOn": false
},
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"indentationRules": {
"enabled": true
}
}
}
}
[Trace - 11:37:58 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///Users/simon/src/hledger/hledger-lib/Hledger/Utils/IO.hs",
"languageId": "haskell",
"version": 1,
"text": "{- | \nHelpers for pretty-printing haskell values, reading command line arguments,\nworking with ANSI colours, files, and time.\nUses unsafePerformIO.\n\nLimitations:\nWhen running in GHCI, this module must be reloaded to see environmental changes.\nThe colour scheme may be somewhat hard-coded.\n\n-}\n\n{-# LANGUAGE CPP, LambdaCase, PackageImports #-}\n\nmodule Hledger.Utils.IO (\n\n -- * Pretty showing/printing\n pshow,\n pshow',\n pprint,\n pprint',\n\n -- * Viewing with pager\n pager,\n setupPager,\n\n -- * Terminal size\n getTerminalHeightWidth,\n getTerminalHeight,\n getTerminalWidth,\n\n -- * Command line arguments\n progArgs,\n outputFileOption,\n hasOutputFile,\n\n -- * ANSI color\n colorOption,\n useColorOnStdout,\n useColorOnStderr,\n -- XXX needed for using color/bgColor/colorB/bgColorB, but clashing with UIUtils:\n -- Color(..),\n -- ColorIntensity(..),\n color,\n bgColor,\n colorB,\n bgColorB,\n --\n bold',\n faint',\n black',\n red',\n green',\n yellow',\n blue',\n magenta',\n cyan',\n white',\n brightBlack',\n brightRed',\n brightGreen',\n brightYellow',\n brightBlue',\n brightMagenta',\n brightCyan',\n brightWhite',\n rgb',\n terminalIsLight,\n terminalLightness,\n terminalFgColor,\n terminalBgColor,\n\n -- * Errors\n error',\n usageError,\n\n -- * Files\n embedFileRelative,\n expandHomePath,\n expandPath,\n expandGlob,\n sortByModTime,\n readFileOrStdinPortably,\n readFilePortably,\n readHandlePortably,\n -- hereFileRelative,\n\n -- * Time\n getCurrentLocalTime,\n getCurrentZonedTime,\n\n )\nwhere\n\nimport Control.Monad (when, forM)\nimport Data.Colour.RGBSpace (RGB(RGB))\nimport Data.Colour.RGBSpace.HSL (lightness)\nimport Data.FileEmbed (makeRelativeToProject, embedStringFile)\nimport Data.List hiding (uncons)\nimport Data.Maybe (isJust)\nimport qualified Data.Text as T\nimport qualified Data.Text.IO as T\nimport qualified Data.Text.Lazy as TL\nimport qualified Data.Text.Lazy.Builder as TB\nimport Data.Time.Clock (getCurrentTime)\nimport Data.Time.LocalTime\n (LocalTime, ZonedTime, getCurrentTimeZone, utcToLocalTime, utcToZonedTime)\nimport Data.Word (Word8, Word16)\nimport Language.Haskell.TH.Syntax (Q, Exp)\nimport String.ANSI\nimport System.Console.ANSI (Color(..),ColorIntensity(..),\n ConsoleLayer(..), SGR(..), hSupportsANSIColor, setSGRCode, getLayerColor)\nimport System.Console.Terminal.Size (Window (Window), size)\nimport System.Directory (getHomeDirectory, getModificationTime)\nimport System.Environment (getArgs, lookupEnv, setEnv)\nimport System.FilePath (isRelative, (</>))\nimport System.IO\n (Handle, IOMode (..), hGetEncoding, hSetEncoding, hSetNewlineMode,\n openFile, stdin, stdout, stderr, universalNewlineMode, utf8_bom, hIsTerminalDevice)\nimport System.IO.Unsafe (unsafePerformIO)\n#ifndef mingw32_HOST_OS\nimport System.Pager (printOrPage)\n#endif\nimport Text.Pretty.Simple\n (CheckColorTty(..), OutputOptions(..),\n defaultOutputOptionsDarkBg, defaultOutputOptionsNoColor, pShowOpt, pPrintOpt)\n\nimport Hledger.Utils.Text (WideBuilder(WideBuilder))\nimport \"Glob\" System.FilePath.Glob (glob)\nimport Data.Functor ((<&>))\n\n-- Pretty showing/printing with pretty-simple\n\n-- https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#t:OutputOptions\n\n-- | pretty-simple options with colour enabled if allowed.\nprettyopts = \n (if useColorOnStderr then defaultOutputOptionsDarkBg else defaultOutputOptionsNoColor)\n { outputOptionsIndentAmount = 2\n -- , outputOptionsCompact = True -- fills lines, but does not respect page width (https://github.com/cdepillabout/pretty-simple/issues/126)\n -- , outputOptionsPageWidth = fromMaybe 80 $ unsafePerformIO getTerminalWidth\n }\n\n-- | pretty-simple options with colour disabled.\nprettyoptsNoColor =\n defaultOutputOptionsNoColor\n { outputOptionsIndentAmount=2\n }\n\n-- | Pretty show. An easier alias for pretty-simple's pShow.\n-- This will probably show in colour if useColorOnStderr is true.\npshow :: Show a => a -> String\npshow = TL.unpack . pShowOpt prettyopts\n\n-- | Monochrome version of pshow. This will never show in colour.\npshow' :: Show a => a -> String\npshow' = TL.unpack . pShowOpt prettyoptsNoColor\n\n-- | Pretty print a showable value. An easier alias for pretty-simple's pPrint.\n-- This will print in colour if useColorOnStderr is true.\npprint :: Show a => a -> IO ()\npprint = pPrintOpt (if useColorOnStderr then CheckColorTty else NoCheckColorTty) prettyopts\n\n-- | Monochrome version of pprint. This will never print in colour.\npprint' :: Show a => a -> IO ()\npprint' = pPrintOpt NoCheckColorTty prettyoptsNoColor\n\n-- \"Avoid using pshow, pprint, dbg* in the code below to prevent infinite loops.\" (?)\n\n-- | Display the given text on the terminal, using the user's $PAGER if the text is taller \n-- than the current terminal and stdout is interactive and TERM is not \"dumb\"\n-- (except on Windows, where a pager will not be used).\n-- If the text contains ANSI codes, because hledger thinks the current terminal\n-- supports those, the pager should be configured to display those, otherwise\n-- users will see junk on screen (#2015).\n-- We call \"setLessR\" at hledger startup to make that less likely.\npager :: String -> IO ()\n#ifdef mingw32_HOST_OS\npager = putStrLn\n#else\nprintOrPage' s = do -- an extra check for Emacs users:\n dumbterm <- (== Just \"dumb\") <$> lookupEnv \"TERM\"\n if dumbterm then putStrLn s else printOrPage (T.pack s)\npager = printOrPage'\n#endif\n\n-- | An alternative to ansi-terminal's getTerminalSize, based on\n-- the more robust-looking terminal-size package.\n-- Tries to get stdout's terminal's current height and width.\ngetTerminalHeightWidth :: IO (Maybe (Int,Int))\ngetTerminalHeightWidth = fmap (fmap unwindow) size\n where unwindow (Window h w) = (h,w)\n\ngetTerminalHeight :: IO (Maybe Int)\ngetTerminalHeight = fmap fst <$> getTerminalHeightWidth\n\ngetTerminalWidth :: IO (Maybe Int)\ngetTerminalWidth = fmap snd <$> getTerminalHeightWidth\n\n-- | Make sure our $LESS and $MORE environment variables contain R,\n-- to help ensure the common pager `less` will show our ANSI output properly.\n-- less uses $LESS by default, and $MORE when it is invoked as `more`.\n-- What the original `more` program does, I'm not sure.\n-- If $PAGER is configured to something else, this probably will have no effect.\nsetupPager :: IO ()\nsetupPager = do\n let\n addR var = do\n mv <- lookupEnv var\n setEnv var $ case mv of\n Nothing -> \"R\"\n Just v -> ('R':v)\n addR \"LESS\"\n addR \"MORE\"\n\n-- Command line arguments\n\n-- | The command line arguments that were used at program startup.\n-- Uses unsafePerformIO.\n{-# NOINLINE progArgs #-}\nprogArgs :: [String]\nprogArgs = unsafePerformIO getArgs\n\n-- | Read the value of the -o/--output-file command line option provided at program startup,\n-- if any, using unsafePerformIO.\noutputFileOption :: Maybe String\noutputFileOption = \n -- keep synced with output-file flag definition in hledger:CliOptions.\n let args = progArgs in\n case dropWhile (not . (\"-o\" `isPrefixOf`)) args of\n -- -oARG\n ('-':'o':v@(_:_)):_ -> Just v\n -- -o ARG\n \"-o\":v:_ -> Just v\n _ ->\n case dropWhile (/=\"--output-file\") args of\n -- --output-file ARG\n \"--output-file\":v:_ -> Just v\n _ ->\n case take 1 $ filter (\"--output-file=\" `isPrefixOf`) args of\n -- --output=file=ARG\n ['-':'-':'o':'u':'t':'p':'u':'t':'-':'f':'i':'l':'e':'=':v] -> Just v\n _ -> Nothing\n\n-- | Check whether the -o/--output-file option has been used at program startup\n-- with an argument other than \"-\", using unsafePerformIO.\nhasOutputFile :: Bool\nhasOutputFile = outputFileOption `notElem` [Nothing, Just \"-\"]\n-- XXX shouldn't we check that stdout is interactive. instead ?\n\n-- ANSI colour\n\nifAnsi f = if useColorOnStdout then f else id\n\n-- | Versions of some of text-ansi's string colors/styles which are more careful\n-- to not print junk onscreen. These use our useColorOnStdout.\nbold' :: String -> String\nbold' = ifAnsi bold\n\nfaint' :: String -> String\nfaint' = ifAnsi faint\n\nblack' :: String -> String\nblack' = ifAnsi black\n\nred' :: String -> String\nred' = ifAnsi red\n\ngreen' :: String -> String\ngreen' = ifAnsi green\n\nyellow' :: String -> String\nyellow' = ifAnsi yellow\n\nblue' :: String -> String\nblue' = ifAnsi blue\n\nmagenta' :: String -> String\nmagenta' = ifAnsi magenta\n\ncyan' :: String -> String\ncyan' = ifAnsi cyan\n\nwhite' :: String -> String\nwhite' = ifAnsi white\n\nbrightBlack' :: String -> String\nbrightBlack' = ifAnsi brightBlack\n\nbrightRed' :: String -> String\nbrightRed' = ifAnsi brightRed\n\nbrightGreen' :: String -> String\nbrightGreen' = ifAnsi brightGreen\n\nbrightYellow' :: String -> String\nbrightYellow' = ifAnsi brightYellow\n\nbrightBlue' :: String -> String\nbrightBlue' = ifAnsi brightBlue\n\nbrightMagenta' :: String -> String\nbrightMagenta' = ifAnsi brightMagenta\n\nbrightCyan' :: String -> String\nbrightCyan' = ifAnsi brightCyan\n\nbrightWhite' :: String -> String\nbrightWhite' = ifAnsi brightWhite\n\nrgb' :: Word8 -> Word8 -> Word8 -> String -> String\nrgb' r g b = ifAnsi (rgb r g b)\n\n-- | Read the value of the --color or --colour command line option provided at program startup\n-- using unsafePerformIO. If this option was not provided, returns the empty string.\ncolorOption :: String\ncolorOption = \n -- similar to debugLevel\n -- keep synced with color/colour flag definition in hledger:CliOptions\n let args = progArgs in\n case dropWhile (/=\"--color\") args of\n -- --color ARG\n \"--color\":v:_ -> v\n _ ->\n case take 1 $ filter (\"--color=\" `isPrefixOf`) args of\n -- --color=ARG\n ['-':'-':'c':'o':'l':'o':'r':'=':v] -> v\n _ ->\n case dropWhile (/=\"--colour\") args of\n -- --colour ARG\n \"--colour\":v:_ -> v\n _ ->\n case take 1 $ filter (\"--colour=\" `isPrefixOf`) args of\n -- --colour=ARG\n ['-':'-':'c':'o':'l':'o':'u':'r':'=':v] -> v\n _ -> \"\"\n\n-- | Check the IO environment to see if ANSI colour codes should be used on stdout.\n-- This is done using unsafePerformIO so it can be used anywhere, eg in\n-- low-level debug utilities, which should be ok since we are just reading.\n-- The logic is: use color if\n-- the program was started with --color=yes|always\n-- or (\n-- the program was not started with --color=no|never\n-- and a NO_COLOR environment variable is not defined\n-- and stdout supports ANSI color\n-- and -o/--output-file was not used, or its value is \"-\"\n-- ).\nuseColorOnStdout :: Bool\nuseColorOnStdout = not hasOutputFile && useColorOnHandle stdout\n\n-- | Like useColorOnStdout, but checks for ANSI color support on stderr,\n-- and is not affected by -o/--output-file.\nuseColorOnStderr :: Bool\nuseColorOnStderr = useColorOnHandle stderr\n\nuseColorOnHandle :: Handle -> Bool\nuseColorOnHandle h = unsafePerformIO $ do\n no_color <- isJust <$> lookupEnv \"NO_COLOR\"\n supports_color <- hSupportsANSIColor h\n let coloroption = colorOption\n return $ coloroption `elem` [\"always\",\"yes\"]\n || (coloroption `notElem` [\"never\",\"no\"] && not no_color && supports_color)\n\n-- | Wrap a string in ANSI codes to set and reset foreground colour.\n-- ColorIntensity is @Dull@ or @Vivid@ (ie normal and bold).\n-- Color is one of @Black@, @Red@, @Green@, @Yellow@, @Blue@, @Magenta@, @Cyan@, @White@.\n-- Eg: @color Dull Red \"text\"@.\ncolor :: ColorIntensity -> Color -> String -> String\ncolor int col s = setSGRCode [SetColor Foreground int col] ++ s ++ setSGRCode []\n\n-- | Wrap a string in ANSI codes to set and reset background colour.\nbgColor :: ColorIntensity -> Color -> String -> String\nbgColor int col s = setSGRCode [SetColor Background int col] ++ s ++ setSGRCode []\n\n-- | Wrap a WideBuilder in ANSI codes to set and reset foreground colour.\ncolorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder\ncolorB int col (WideBuilder s w) =\n WideBuilder (TB.fromString (setSGRCode [SetColor Foreground int col]) <> s <> TB.fromString (setSGRCode [])) w\n\n-- | Wrap a WideBuilder in ANSI codes to set and reset background colour.\nbgColorB :: ColorIntensity -> Color -> WideBuilder -> WideBuilder\nbgColorB int col (WideBuilder s w) =\n WideBuilder (TB.fromString (setSGRCode [SetColor Background int col]) <> s <> TB.fromString (setSGRCode [])) w\n\n-- | Detect whether the terminal currently has a light background colour,\n-- if possible, using unsafePerformIO.\n-- If the terminal is transparent, its apparent light/darkness may be different.\nterminalIsLight :: Maybe Bool\nterminalIsLight = (> 0.5) <$> terminalLightness\n\n-- | Detect the terminal's current background lightness (0..1), if possible, using unsafePerformIO.\n-- If the terminal is transparent, its apparent lightness may be different.\nterminalLightness :: Maybe Float\nterminalLightness = lightness <$> terminalColor Background\n\n-- | Detect the terminal's current background colour, if possible, using unsafePerformIO.\nterminalBgColor :: Maybe (RGB Float)\nterminalBgColor = terminalColor Background\n\n-- | Detect the terminal's current foreground colour, if possible, using unsafePerformIO.\nterminalFgColor :: Maybe (RGB Float)\nterminalFgColor = terminalColor Foreground\n\n-- | Detect the terminal's current foreground or background colour, if possible, using unsafePerformIO.\n{-# NOINLINE terminalColor #-}\nterminalColor :: ConsoleLayer -> Maybe (RGB Float)\nterminalColor = unsafePerformIO . getLayerColor'\n\n-- A version of getLayerColor that is less likely to leak escape sequences to output,\n-- and that returns a RGB of Floats (0..1) that is more compatible with the colour package.\n-- This does nothing in a non-interactive context (eg when piping stdout to another command),\n-- inside emacs (emacs shell buffers show the escape sequence for some reason),\n-- or in a non-colour-supporting terminal.\ngetLayerColor' :: ConsoleLayer -> IO (Maybe (RGB Float))\ngetLayerColor' l = do\n inemacs <- not.null <$> lookupEnv \"INSIDE_EMACS\"\n interactive <- hIsTerminalDevice stdout\n supportscolor <- hSupportsANSIColor stdout\n if inemacs || not interactive || not supportscolor then return Nothing\n else fmap fractionalRGB <$> getLayerColor l\n where\n fractionalRGB :: (Fractional a) => RGB Word16 -> RGB a\n fractionalRGB (RGB r g b) = RGB (fromIntegral r / 65535) (fromIntegral g / 65535) (fromIntegral b / 65535) -- chatgpt\n\n-- Errors\n\n-- | Simpler alias for errorWithoutStackTrace\nerror' :: String -> a\nerror' = errorWithoutStackTrace . (\"Error: \" <>)\n\n-- | A version of errorWithoutStackTrace that adds a usage hint.\nusageError :: String -> a\nusageError = error' . (++ \" (use -h to see usage)\")\n\n-- Files\n\n-- | Expand a tilde (representing home directory) at the start of a file path.\n-- ~username is not supported. Can raise an error.\nexpandHomePath :: FilePath -> IO FilePath\nexpandHomePath = \\case\n ('~':'/':p) -> (</> p) <$> getHomeDirectory\n ('~':'\\\\':p) -> (</> p) <$> getHomeDirectory\n ('~':_) -> ioError $ userError \"~USERNAME in paths is not supported\"\n p -> return p\n\n-- | Given a current directory, convert a possibly relative, possibly tilde-containing\n-- file path to an absolute one.\n-- ~username is not supported. Leaves \"-\" unchanged. Can raise an error.\nexpandPath :: FilePath -> FilePath -> IO FilePath -- general type sig for use in reader parsers\nexpandPath _ \"-\" = return \"-\"\nexpandPath curdir p = (if isRelative p then (curdir </>) else id) <$> expandHomePath p\n\n-- | Like expandPath, but treats the expanded path as a glob, and returns\n-- zero or more matched absolute file paths, alphabetically sorted.\nexpandGlob :: FilePath -> FilePath -> IO [FilePath]\nexpandGlob curdir p = expandPath curdir p >>= glob <&> sort\n\n-- | Given a list of existing file paths, sort them by modification time, most recent first.\nsortByModTime :: [FilePath] -> IO [FilePath]\nsortByModTime fs = do\n ftimes <- forM fs $ \\f -> do {t <- getModificationTime f; return (t,f)}\n return $ map snd $ reverse $ sort ftimes\n\n-- | Read text from a file,\n-- converting any \\r\\n line endings to \\n,,\n-- using the system locale's text encoding,\n-- ignoring any utf8 BOM prefix (as seen in paypal's 2018 CSV, eg) if that encoding is utf8.\nreadFilePortably :: FilePath -> IO T.Text\nreadFilePortably f = openFile f ReadMode >>= readHandlePortably\n\n-- | Like readFilePortably, but read from standard input if the path is \"-\".\nreadFileOrStdinPortably :: String -> IO T.Text\nreadFileOrStdinPortably f = openFileOrStdin f ReadMode >>= readHandlePortably\n where\n openFileOrStdin :: String -> IOMode -> IO Handle\n openFileOrStdin \"-\" _ = return stdin\n openFileOrStdin f' m = openFile f' m\n\nreadHandlePortably :: Handle -> IO T.Text\nreadHandlePortably h = do\n hSetNewlineMode h universalNewlineMode\n menc <- hGetEncoding h\n when (fmap show menc == Just \"UTF-8\") $ -- XXX no Eq instance, rely on Show\n hSetEncoding h utf8_bom\n T.hGetContents h\n\n-- | Like embedFile, but takes a path relative to the package directory.\nembedFileRelative :: FilePath -> Q Exp\nembedFileRelative f = makeRelativeToProject f >>= embedStringFile\n\n-- -- | Like hereFile, but takes a path relative to the package directory.\n-- -- Similar to embedFileRelative ?\n-- hereFileRelative :: FilePath -> Q Exp\n-- hereFileRelative f = makeRelativeToProject f >>= hereFileExp\n-- where\n-- QuasiQuoter{quoteExp=hereFileExp} = hereFile\n\n-- Time\n\ngetCurrentLocalTime :: IO LocalTime\ngetCurrentLocalTime = do\n t <- getCurrentTime\n tz <- getCurrentTimeZone\n return $ utcToLocalTime tz t\n\ngetCurrentZonedTime :: IO ZonedTime\ngetCurrentZonedTime = do\n t <- getCurrentTime\n tz <- getCurrentTimeZone\n return $ utcToZonedTime tz t\n\n"
}
}
[Trace - 11:37:58 PM] Sending response 'window/showMessageRequest - (0)'. Processing request took 37447ms
No result returned.
2023-12-06T09:37:58.0974[Trace - 11:37:58 PM] Received request 'workspace/configuration - (1)'.
Params: {
"items": [
{
"section": "haskell"
}
]
}
[Trace - 11:37:58 PM] Sending response 'workspace/configuration - (1)'. Processing request took 1ms
Result: [
{
"formattingProvider": "fourmolu",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"trace": {
"server": "verbose",
"client": "debug"
},
"logFile": "",
"releasesURL": "",
"metadataURL": "",
"releasesDownloadStoragePath": "",
"serverExecutablePath": "",
"serverExtraArgs": "",
"ghcupExecutablePath": "",
"serverEnvironment": {},
"promptBeforeDownloads": "true",
"manageHLS": "GHCup",
"toolchain": {},
"upgradeGHCup": false,
"checkProject": false,
"maxCompletions": 40,
"plugin": {
"alternateNumberFormat": {
"globalOn": true
},
"cabal": {
"globalOn": true,
"completionOn": true
},
"callHierarchy": {
"globalOn": true
},
"changeTypeSignature": {
"globalOn": true
},
"class": {
"codeActionsOn": true,
"codeLensOn": true
},
"eval": {
"config": {
"diff": true,
"exception": false
},
"globalOn": true
},
"explicit-fields": {
"globalOn": true
},
"explicit-fixity": {
"globalOn": true
},
"fourmolu": {
"config": {
"external": false
}
},
"gadt": {
"globalOn": true
},
"ghcide-code-actions-bindings": {
"globalOn": true
},
"ghcide-code-actions-fill-holes": {
"globalOn": true
},
"ghcide-code-actions-imports-exports": {
"globalOn": true
},
"ghcide-code-actions-type-signatures": {
"globalOn": true
},
"ghcide-completions": {
"config": {
"autoExtendOn": true,
"snippetsOn": true
},
"globalOn": true
},
"ghcide-hover-and-symbols": {
"hoverOn": true,
"symbolsOn": true
},
"ghcide-type-lenses": {
"config": {
"mode": "always"
},
"globalOn": true
},
"haddockComments": {
"globalOn": true
},
"hlint": {
"codeActionsOn": true,
"config": {
"flags": []
},
"diagnosticsOn": true
},
"importLens": {
"codeActionsOn": true,
"codeLensOn": true
},
"moduleName": {
"globalOn": true
},
"pragmas": {
"codeActionsOn": true,
"completionOn": true
},
"qualifyImportedNames": {
"globalOn": true
},
"refineImports": {
"codeActionsOn": true,
"codeLensOn": true
},
"rename": {
"config": {
"crossModule": false
},
"globalOn": true
},
"retrie": {
"globalOn": true
},
"splice": {
"globalOn": true
},
"stan": {
"globalOn": false
},
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"indentationRules": {
"enabled": true
}
}
]
75Z | Error | LSP: no handler for: "initialized"
2023-12-06T09:37:58.097967Z | Debug | LSP: set new config: {
"checkProject": false,
"formattingProvider": "fourmolu",
"ghcupExecutablePath": "",
"indentationRules": { "enabled": true },
"logFile": "",
"manageHLS": "GHCup",
"maxCompletions": 40,
"metadataURL": "",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"plugin": {
"alternateNumberFormat": { "globalOn": true },
"cabal": { "completionOn": true, "globalOn": true },
"callHierarchy": { "globalOn": true },
"changeTypeSignature": { "globalOn": true },
"class": { "codeActionsOn": true, "codeLensOn": true },
"eval": {
"config": { "diff": true, "exception": false },
"globalOn": true
},
"explicit-fields": { "globalOn": true },
"explicit-fixity": { "globalOn": true },
"fourmolu": { "config": { "external": false } },
"gadt": { "globalOn": true },
"ghcide-code-actions-bindings": { "globalOn": true },
"ghcide-code-actions-fill-holes": { "globalOn": true },
"ghcide-code-actions-imports-exports": { "globalOn": true },
"ghcide-code-actions-type-signatures": { "globalOn": true },
"ghcide-completions": {
"config": { "autoExtendOn": true, "snippetsOn": true },
"globalOn": true
},
"ghcide-hover-and-symbols": { "hoverOn": true, "symbolsOn": true },
"ghcide-type-lenses": { "config": { "mode": "always" }, "globalOn": true },
"haddockComments": { "globalOn": true },
"hlint": {
"codeActionsOn": true,
"config": { "flags": [ ] },
"diagnosticsOn": true
},
"importLens": { "codeActionsOn": true, "codeLensOn": true },
"moduleName": { "globalOn": true },
"pragmas": { "codeActionsOn": true, "completionOn": true },
"qualifyImportedNames": { "globalOn": true },
"refineImports": { "codeActionsOn": true, "codeLensOn": true },
"rename": { "config": { "crossModule": false }, "globalOn": true },
"retrie": { "globalOn": true },
"splice": { "globalOn": true },
"stan": { "globalOn": false },
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"promptBeforeDownloads": "true",
"releasesDownloadStoragePath": "",
"releasesURL": "",
"serverEnvironment": { },
"serverExecutablePath": "",
"serverExtraArgs": "",
"toolchain": { },
"trace": { "client": "debug", "server": "verbose" },
"upgradeGHCup": false
}
2023-12-06T09:37:58.102400Z | Error | LSP: no handler for: "workspace/didChangeConfiguration"[Trace - 11:37:58 PM] Received request 'workspace/configuration - (2)'.
Params: {
"items": [
{
"section": "haskell"
}
]
}
[Trace - 11:37:58 PM] Sending response 'workspace/configuration - (2)'. Processing request took 1ms
Result: [
{
"formattingProvider": "fourmolu",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"trace": {
"server": "verbose",
"client": "debug"
},
"logFile": "",
"releasesURL": "",
"metadataURL": "",
"releasesDownloadStoragePath": "",
"serverExecutablePath": "",
"serverExtraArgs": "",
"ghcupExecutablePath": "",
"serverEnvironment": {},
"promptBeforeDownloads": "true",
"manageHLS": "GHCup",
"toolchain": {},
"upgradeGHCup": false,
"checkProject": false,
"maxCompletions": 40,
"plugin": {
"alternateNumberFormat": {
"globalOn": true
},
"cabal": {
"globalOn": true,
"completionOn": true
},
"callHierarchy": {
"globalOn": true
},
"changeTypeSignature": {
"globalOn": true
},
"class": {
"codeActionsOn": true,
"codeLensOn": true
},
"eval": {
"config": {
"diff": true,
"exception": false
},
"globalOn": true
},
"explicit-fields": {
"globalOn": true
},
"explicit-fixity": {
"globalOn": true
},
"fourmolu": {
"config": {
"external": false
}
},
"gadt": {
"globalOn": true
},
"ghcide-code-actions-bindings": {
"globalOn": true
},
"ghcide-code-actions-fill-holes": {
"globalOn": true
},
"ghcide-code-actions-imports-exports": {
"globalOn": true
},
"ghcide-code-actions-type-signatures": {
"globalOn": true
},
"ghcide-completions": {
"config": {
"autoExtendOn": true,
"snippetsOn": true
},
"globalOn": true
},
"ghcide-hover-and-symbols": {
"hoverOn": true,
"symbolsOn": true
},
"ghcide-type-lenses": {
"config": {
"mode": "always"
},
"globalOn": true
},
"haddockComments": {
"globalOn": true
},
"hlint": {
"codeActionsOn": true,
"config": {
"flags": []
},
"diagnosticsOn": true
},
"importLens": {
"codeActionsOn": true,
"codeLensOn": true
},
"moduleName": {
"globalOn": true
},
"pragmas": {
"codeActionsOn": true,
"completionOn": true
},
"qualifyImportedNames": {
"globalOn": true
},
"refineImports": {
"codeActionsOn": true,
"codeLensOn": true
},
"rename": {
"config": {
"crossModule": false
},
"globalOn": true
},
"retrie": {
"globalOn": true
},
"splice": {
"globalOn": true
},
"stan": {
"globalOn": false
},
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"indentationRules": {
"enabled": true
}
}
]
2023-12-06T09:37:58.103454Z | Debug | VFS: opening file:///Users/simon/src/hledger/hledger-lib/Hledger/Utils/IO.hs
2023-12-06T09:37:58.103800Z | Error | LSP: no handler for: "textDocument/didOpen"
2023-12-06T09:37:58.104024Z | Debug | LSP: set new config: {
"checkProject": false,
"formattingProvider": "fourmolu",
"ghcupExecutablePath": "",
"indentationRules": { "enabled": true },
"logFile": "",
"manageHLS": "GHCup",
"maxCompletions": 40,
"metadataURL": "",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"plugin": {
"alternateNumberFormat": { "globalOn": true },
"cabal": { "completionOn": true, "globalOn": true },
"callHierarchy": { "globalOn": true },
"changeTypeSignature": { "globalOn": true },
"class": { "codeActionsOn": true, "codeLensOn": true },
"eval": {
"config": { "diff": true, "exception": false },
"globalOn": true
},
"explicit-fields": { "globalOn": true },
"explicit-fixity": { "globalOn": true },
"fourmolu": { "config": { "external": false } },
"gadt": { "globalOn": true },
"ghcide-code-actions-bindings": { "globalOn": true },
"ghcide-code-actions-fill-holes": { "globalOn": true },
"ghcide-code-actions-imports-exports": { "globalOn": true },
"ghcide-code-actions-type-signatures": { "globalOn": true },
"ghcide-completions": {
"config": { "autoExtendOn": true, "snippetsOn": true },
"globalOn": true
},
"ghcide-hover-and-symbols": { "hoverOn": true, "symbolsOn": true },
"ghcide-type-lenses": { "config": { "mode": "always" }, "globalOn": true },
"haddockComments": { "globalOn": true },
"hlint": {
"codeActionsOn": true,
"config": { "flags": [ ] },
"diagnosticsOn": true
},
"importLens": { "codeActionsOn": true, "codeLensOn": true },
"moduleName": { "globalOn": true },
"pragmas": { "codeActionsOn": true, "completionOn": true },
"qualifyImportedNames": { "globalOn": true },
"refineImports": { "codeActionsOn": true, "codeLensOn": true },
"rename": { "config": { "crossModule": false }, "globalOn": true },
"retrie": { "globalOn": true },
"splice": { "globalOn": true },
"stan": { "globalOn": false },
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"promptBeforeDownloads": "true",
"releasesDownloadStoragePath": "",
"releasesURL": "",
"serverEnvironment": { },
"serverExecutablePath": "",
"serverExtraArgs": "",
"toolchain": { },
"trace": { "client": "debug", "server": "verbose" },
"upgradeGHCup": false
}
2023-12-06T09:37:58.108303Z | Debug | LSP: set new config: {
"checkProject": false,
"formattingProvider": "fourmolu",
"ghcupExecutablePath": "",
"indentationRules": { "enabled": true },
"logFile": "",
"manageHLS": "GHCup",
"maxCompletions": 40,
"metadataURL": "",
"openDocumentationInHackage": true,
"openSourceInHackage": true,
"plugin": {
"alternateNumberFormat": { "globalOn": true },
"cabal": { "completionOn": true, "globalOn": true },
"callHierarchy": { "globalOn": true },
"changeTypeSignature": { "globalOn": true },
"class": { "codeActionsOn": true, "codeLensOn": true },
"eval": {
"config": { "diff": true, "exception": false },
"globalOn": true
},
"explicit-fields": { "globalOn": true },
"explicit-fixity": { "globalOn": true },
"fourmolu": { "config": { "external": false } },
"gadt": { "globalOn": true },
"ghcide-code-actions-bindings": { "globalOn": true },
"ghcide-code-actions-fill-holes": { "globalOn": true },
"ghcide-code-actions-imports-exports": { "globalOn": true },
"ghcide-code-actions-type-signatures": { "globalOn": true },
"ghcide-completions": {
"config": { "autoExtendOn": true, "snippetsOn": true },
"globalOn": true
},
"ghcide-hover-and-symbols": { "hoverOn": true, "symbolsOn": true },
"ghcide-type-lenses": { "config": { "mode": "always" }, "globalOn": true },
"haddockComments": { "globalOn": true },
"hlint": {
"codeActionsOn": true,
"config": { "flags": [ ] },
"diagnosticsOn": true
},
"importLens": { "codeActionsOn": true, "codeLensOn": true },
"moduleName": { "globalOn": true },
"pragmas": { "codeActionsOn": true, "completionOn": true },
"qualifyImportedNames": { "globalOn": true },
"refineImports": { "codeActionsOn": true, "codeLensOn": true },
"rename": { "config": { "crossModule": false }, "globalOn": true },
"retrie": { "globalOn": true },
"splice": { "globalOn": true },
"stan": { "globalOn": false },
"tactics": {
"codeActionsOn": true,
"codeLensOn": true,
"config": {
"auto_gas": 4,
"hole_severity": null,
"max_use_ctor_actions": 5,
"proofstate_styling": true,
"timeout_duration": 2
},
"hoverOn": true
}
},
"promptBeforeDownloads": "true",
"releasesDownloadStoragePath": "",
"releasesURL": "",
"serverEnvironment": { },
"serverExecutablePath": "",
"serverExtraArgs": "",
"toolchain": { },
"trace": { "client": "debug", "server": "verbose" },
"upgradeGHCup": false
}
[Trace - 11:38:03 PM] Sending response 'window/showMessageRequest - (0)'. Processing request took 5250ms
No result returned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment