mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
Some more tweaks
This commit is contained in:
parent
2620c050a7
commit
801edb8db0
@ -49,8 +49,8 @@ type File = Analysis.File.File Language
|
|||||||
|
|
||||||
-- | The source, path information, and language of a file read from disk.
|
-- | The source, path information, and language of a file read from disk.
|
||||||
data Blob = Blob
|
data Blob = Blob
|
||||||
{ blobSource :: Source -- ^ The UTF-8 encoded source text of the blob.
|
{ blobSource :: Source -- ^ The UTF-8 encoded source text of the blob.
|
||||||
, blobFile :: File -- ^ Path/language information for this blob.
|
, blobFile :: File -- ^ Path/language information for this blob.
|
||||||
} deriving (Show, Eq)
|
} deriving (Show, Eq)
|
||||||
|
|
||||||
blobLanguage :: Blob -> Language
|
blobLanguage :: Blob -> Language
|
||||||
|
@ -153,8 +153,8 @@ graphCommand = command "graph" (info graphArgumentsParser (progDesc "Compute a g
|
|||||||
<$> ( Just <$> some (strArgument (metavar "FILES..."))
|
<$> ( Just <$> some (strArgument (metavar "FILES..."))
|
||||||
<|> flag' Nothing (long "stdin" <> help "Read a list of newline-separated paths to analyze from stdin."))
|
<|> flag' Nothing (long "stdin" <> help "Read a list of newline-separated paths to analyze from stdin."))
|
||||||
makeReadProjectFromPathsTask maybePaths = do
|
makeReadProjectFromPathsTask maybePaths = do
|
||||||
ePaths <- maybeM (liftIO (many getLine)) maybePaths
|
strPaths <- maybeM (liftIO (many getLine)) maybePaths
|
||||||
let paths = rights (Path.parse <$> ePaths)
|
let paths = rights (Path.parse <$> strPaths)
|
||||||
blobs <- traverse readBlobFromPath paths
|
blobs <- traverse readBlobFromPath paths
|
||||||
case paths of
|
case paths of
|
||||||
(x:_) -> pure $! Project (Path.toString (Path.takeDirectory x)) blobs (Language.forPath x) mempty
|
(x:_) -> pure $! Project (Path.toString (Path.takeDirectory x)) blobs (Language.forPath x) mempty
|
||||||
|
Loading…
Reference in New Issue
Block a user