Skip to content

Commit c98d6d5

Browse files
committed
clean up more flags
1 parent 0884747 commit c98d6d5

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

ghcide/exe/Arguments.hs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ import Development.IDE.Main (Command (..), commandP)
77
import Options.Applicative
88

99
data Arguments = Arguments
10-
{argsCwd :: Maybe FilePath
11-
,argsVersion :: Bool
10+
{argsVersion :: Bool
1211
,argsVSCodeExtensionSchema :: Bool
1312
,argsDefaultConfig :: Bool
1413
,argsShakeProfiling :: Maybe FilePath
1514
,argsOTMemoryProfiling :: Bool
16-
,argsTesting :: Bool
1715
,argsThreads :: Int
1816
,argsVerbose :: Bool
1917
,argsCommand :: Command
@@ -28,13 +26,11 @@ getArguments = execParser opts
2826

2927
arguments :: Parser Arguments
3028
arguments = Arguments
31-
<$> optional (strOption $ long "cwd" <> metavar "DIR" <> help "Change to this directory")
32-
<*> switch (long "version" <> help "Show ghcide and GHC versions")
29+
<$> switch (long "version" <> help "Show ghcide and GHC versions")
3330
<*> switch (long "vscode-extension-schema" <> help "Print generic config schema for plugins (used in the package.json of haskell vscode extension)")
3431
<*> switch (long "generate-default-config" <> help "Print config supported by the server with default values")
3532
<*> optional (strOption $ long "shake-profiling" <> metavar "DIR" <> help "Dump profiling reports to this directory")
3633
<*> switch (long "ot-memory-profiling" <> help "Record OpenTelemetry info to the eventlog. Needs the -l RTS flag to have an effect")
37-
<*> switch (long "test" <> help "Enable additional lsp messages used by the testsuite")
3834
<*> option auto (short 'j' <> help "Number of threads (0: automatic)" <> metavar "NUM" <> value 0 <> showDefault)
3935
<*> switch (long "verbose" <> help "Include internal events in logging output")
4036
<*> (commandP <|> lspCommand <|> checkCommand)

ghcide/exe/Main.hs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Main(main) where
88
import Arguments (Arguments (..),
99
getArguments)
1010
import Control.Concurrent.Extra (newLock, withLock)
11-
import Control.Monad.Extra (when, whenJust)
11+
import Control.Monad.Extra (when)
1212
import qualified Data.Aeson.Encode.Pretty as A
1313
import Data.Default (Default (def))
1414
import Data.List.Extra (upper)
@@ -20,16 +20,15 @@ import Data.Version (showVersion)
2020
import Development.GitRev (gitHash)
2121
import Development.IDE (Logger (Logger),
2222
Priority (Info))
23+
import Development.IDE.Graph (ShakeOptions (shakeThreads))
2324
import qualified Development.IDE.Main as Main
2425
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
2526
import Development.IDE.Types.Options
26-
import Development.IDE.Graph (ShakeOptions (shakeThreads))
2727
import Ide.Plugin.Config (Config (checkParents, checkProject))
2828
import Ide.Plugin.ConfigUtils (pluginsToDefaultConfig,
2929
pluginsToVSCodeExtensionSchema)
3030
import Ide.PluginUtils (pluginDescToIdePlugins)
3131
import Paths_ghcide (version)
32-
import qualified System.Directory.Extra as IO
3332
import System.Environment (getExecutablePath)
3433
import System.Exit (exitSuccess)
3534
import System.IO (hPutStrLn, stderr)
@@ -65,8 +64,6 @@ main = do
6564
LT.putStrLn $ decodeUtf8 $ A.encodePretty $ pluginsToDefaultConfig hlsPlugins
6665
exitSuccess
6766

68-
whenJust argsCwd IO.setCurrentDirectory
69-
7067
-- lock to avoid overlapping output on stdout
7168
lock <- newLock
7269
let logger = Logger $ \pri msg -> when (pri >= logLevel) $ withLock lock $
@@ -81,7 +78,6 @@ main = do
8178
in defOptions
8279
{ optShakeProfiling = argsShakeProfiling
8380
, optOTMemoryProfiling = IdeOTMemoryProfiling argsOTMemoryProfiling
84-
, optTesting = IdeTesting argsTesting
8581
, optShakeOptions = (optShakeOptions defOptions){shakeThreads = argsThreads}
8682
, optCheckParents = pure $ checkParents config
8783
, optCheckProject = pure $ checkProject config

0 commit comments

Comments
 (0)