我尝试用SourceGraph可视化现有的Haskell代码库。
SourceGraph mycabal.cabal但我得到的只是这样的错误信息:
Could not parse source file ./src/mysource.hs
SourceGraph: Could not find data file templates/default.html有什么提示应该做什么,或者在哪里查找文档?
到目前为止,我发现的唯一文档是:SourceGraph/SourceGraph/SourceGraph.html,不幸的是,它只包含一些吸引人的图像,但没有提示如何生成它们。
发布于 2014-04-08 19:00:55
关于您当前的问题,这里最好的文档是源代码:http://code.haskell.org/SourceGraph/
我在自己的存储库上试了一下,也遇到了解析问题。这是无法解析模块。下面的修补程序显示了实际错误:
--- Parsing.hs 2013-02-14 12:59:34.000000000 +0100
+++ ../SourceGraph-0.7.0.5-fixed/Parsing.hs 2014-04-08 20:49:54.000000000 +0200
@@ -64,7 +64,7 @@
parseFile :: FileContents -> Either FilePath Module
parseFile (p,f) = case (parseFileContentsWithMode mode f) of
(ParseOk hs) -> Right hs
- _ -> Left p
+ x -> Left $ p ++ ": " ++ show x
where
mode = defaultParseMode { parseFilename = p
, fixities = Nothing结果发现,我的大部分失败模块都失败了,因为"MultiParamTypeClasses未启用“。这显然是haskell-src-exts是正确严格的,而ghc很高兴没有MultiParamTypeClasses扩展:https://github.com/haskell-suite/haskell-src-exts/issues/29。
因此,作为快速修复,尝试添加
{-# LANGUAGE MultiParamTypeClasses #-}在你失败模块的顶部。
发布于 2015-03-31 11:57:34
只是遇到了一个类似的问题,所以我想我应该在这里记录我所做的事情。我把我的更改放在一个补丁文件中。https://gist.github.com/ivanperez-keera/b398ce71a22e8a4849f3
cabal sandbox init
cabal unpack SourceGraph
wget https://gist.githubusercontent.com/ivanperez-keera/b398ce71a22e8a4849f3/raw/bf26ffc45564934c0f175e7619ded8a299a9b7d5/verbose-sourcegraph.patch
cd SourceGraph-0.7.0.6/
patch -i ../verbose-sourcegraph.patch
cd ..
cabal install SourceGraph-0.7.0.6/大多数的“错误”在我的文件中,由于爆炸模式和多个param类型的类。必须有更好的解决方案,使SourceGraph的解析模式默认为GHC。
https://stackoverflow.com/questions/22938276
复制相似问题