This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use db for findDef save source file location to db Find source for boot files Use DynFlags from HieDb instead of unsafeGlobalDynFlags Return multiple definitions don't typecheck files on load Add support for persistent stale values Add persistent hie file rule docs wip better typedef defs for deps update hiedb Fix for files with errors Fix build integrate hiedb commands and set dynflags on boot workspace symbol tweaks, cabal.project Write ifaces on save use real mtime for saved files safe indexing bump hiedb Proper refs for FOIs hlint Update exe/Main.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Review comments update hiedb Update src/Development/IDE/Core/Shake.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Spans/AtPoint.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Update src/Development/IDE/Core/Rules.hs Co-authored-by: Pepe Iborra <pepeiborra@me.com> Apply suggestions from code review Co-authored-by: Pepe Iborra <pepeiborra@me.com> more careful re-indexing update for hiedb-0.1.0.0
- Loading branch information
Showing
24 changed files
with
730 additions
and
261 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,52 @@ | ||
-- Copyright (c) 2019 The DAML Authors. All rights reserved. | ||
-- SPDX-License-Identifier: Apache-2.0 | ||
|
||
module Arguments(Arguments(..), getArguments) where | ||
module Arguments(Arguments, Arguments'(..), getArguments, IdeCmd(..)) where | ||
|
||
import Options.Applicative | ||
import HieDb.Run | ||
|
||
type Arguments = Arguments' IdeCmd | ||
|
||
data Arguments = Arguments | ||
data IdeCmd = Typecheck [FilePath] | DbCmd Command | LSP | ||
|
||
data Arguments' a = Arguments | ||
{argLSP :: Bool | ||
,argsCwd :: Maybe FilePath | ||
,argFiles :: [FilePath] | ||
,argsVersion :: Bool | ||
,argsShakeProfiling :: Maybe FilePath | ||
,argsOTMemoryProfiling :: Bool | ||
,argsTesting :: Bool | ||
,argsDisableKick :: Bool | ||
,argsThreads :: Int | ||
,argsVerbose :: Bool | ||
,argFilesOrCmd :: a | ||
} | ||
|
||
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 "ghcide - 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...")) | ||
<*> switch (long "version" <> help "Show ghcide and GHC versions") | ||
<*> optional (strOption $ long "shake-profiling" <> metavar "DIR" <> help "Dump profiling reports to this directory") | ||
<*> switch (long "ot-memory-profiling" <> help "Record OpenTelemetry info to the eventlog. Needs the -l RTS flag to have an effect") | ||
<*> switch (long "test" <> help "Enable additional lsp messages used by the testsuite") | ||
<*> switch (long "test-no-kick" <> help "Disable kick. Useful for testing cancellation") | ||
<*> option auto (short 'j' <> help "Number of threads (0: automatic)" <> metavar "NUM" <> value 0 <> showDefault) | ||
<*> switch (long "verbose" <> help "Include internal events in logging output") | ||
<*> ( hsubparser (command "typecheck" (info (Typecheck <$> fileCmd) fileInfo) | ||
<> command "hiedb" (info (DbCmd <$> cmdParser <**> helper) hieInfo) | ||
<> command "lsp" (info (pure LSP <**> helper) lspInfo) ) | ||
<|> Typecheck <$> fileCmd ) | ||
where | ||
fileCmd = many (argument str (metavar "FILES/DIRS...")) | ||
lspInfo = fullDesc <> progDesc "Start talking to an LSP server" | ||
fileInfo = fullDesc <> progDesc "Used as a test bed to check your IDE will work" | ||
hieInfo = fullDesc <> progDesc "Query .hie files" |
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
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
Oops, something went wrong.