Skip to content

Commit

Permalink
fixup! Reuse Development.IDE.Main in HLS
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Feb 9, 2021
1 parent 93b5542 commit f2ee6ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ghcide/src/Development/IDE/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ import System.IO (hPutStrLn, hSetEncoding, stderr, stdout, utf8)
import System.Time.Extra (offsetTime, showDuration)
import Text.Printf (printf)
import qualified Development.IDE.Plugin.HLS.GhcIde as Ghcide
import Ide.Version (findProgramVersions, showProgramVersionOfInterest)

data Arguments = Arguments
{ argsOTMemoryProfiling :: Bool
Expand Down Expand Up @@ -143,6 +142,8 @@ defaultMain Arguments{..} = do
case argFiles of
Nothing -> do
t <- offsetTime
hPutStrLn stderr "Starting LSP server..."
hPutStrLn stderr "If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!"
runLanguageServer options (pluginHandler plugins) onInitialConfiguration onConfigurationChange $ \getLspId event vfs caps wProg wIndefProg getConfig rootPath -> do
t <- t
hPutStrLn stderr $ "Started LSP server in " ++ showDuration t
Expand Down Expand Up @@ -182,12 +183,8 @@ defaultMain Arguments{..} = do
hSetEncoding stdout utf8
hSetEncoding stderr utf8

putStrLn $ "HLS setup tester in " ++ dir ++ "."
putStrLn $ "ghcide setup tester in " ++ dir ++ "."
putStrLn "Report bugs at https://github.com/haskell/haskell-language-server/issues"
programsOfInterest <- findProgramVersions
putStrLn ""
putStrLn "Tool versions found on the $PATH"
putStrLn $ showProgramVersionOfInterest programsOfInterest

putStrLn $ "\nStep 1/4: Finding files to test in " ++ dir
files <- expandFiles (argFiles ++ ["." | null argFiles])
Expand Down
1 change: 1 addition & 0 deletions src/Ide/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ runLspMode lspArgs@LspArguments{..} idePlugins = do
{ Main.argFiles = if argLSP then Nothing else Just []
, Main.argsHlsPlugins = idePlugins
, Main.argsLogger = hlsLogger
, Main.argsTesting = argsTesting
}

0 comments on commit f2ee6ea

Please sign in to comment.