-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make hie-core outside an IDE work better (#1895)
* Move the hie-core demo files around (they aren't really a demo anymore) * Split the command line parsing into a separate module * Give messages about how long starting something takes * Make the interactive mode say what it is doing a bit more * Add a --cwd flag to hie-core * Take a list of files and directories for hie-core * Update the readme to say how to test using hie-core * Fix up the bazel file * Add HLint exception
- Loading branch information
Showing
6 changed files
with
117 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
module Arguments(Arguments(..), getArguments) where | ||
|
||
import Options.Applicative | ||
|
||
|
||
data Arguments = Arguments | ||
{argLSP :: Bool | ||
,argsCwd :: Maybe FilePath | ||
,argFiles :: [FilePath] | ||
} | ||
|
||
getArguments :: IO Arguments | ||
getArguments = execParser opts | ||
where | ||
opts = info (arguments <**> helper) | ||
( fullDesc | ||
<> progDesc "Used as a test bed to check your IDE will work" | ||
<> header "hie-core - the core of a Haskell IDE") | ||
|
||
arguments :: Parser Arguments | ||
arguments = Arguments | ||
<$> switch (long "lsp" <> help "Start talking to an LSP server") | ||
<*> optional (strOption $ long "cwd" <> metavar "DIR" <> help "Change to this directory") | ||
<*> many (argument str (metavar "FILES/DIRS...")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters