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 6531d07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ghcide/src/Development/IDE/Main.hs
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 @@ -184,10 +185,6 @@ defaultMain Arguments{..} = do

putStrLn $ "HLS 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
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 6531d07

Please sign in to comment.