flycheck / flycheck-hdevtools Goto Github PK
View Code? Open in Web Editor NEWFlycheck syntax checker for hdevtools
License: GNU General Public License v3.0
Flycheck syntax checker for hdevtools
License: GNU General Public License v3.0
Not sure if this is a bug or I've done something wrong, but please help me troubleshoot this problem.
What I did is:
/tmp/mod
)Mod.hs
:
module Mod where
a = 1
Main.hs
:
import Mod
main = print a
When editing Main.hs
, an error is found on line 1 col 8 saying "Could not find module Mod
"
I used C-c ! l
to bring up the error list and found that error message comes from haskell-hdevtools
Related info
Hello,
I need some advice on what would be the recommend way of dealing with the issue.
When editing xmonad.hs using flycheck-hdevtools, flycheck does not search the lib/ subdirectory for modules and throws the below error:
69 18 error Could not find module `XMonad.Util.DTrace'
Perhaps you meant
XMonad.Util.Image (from xmonad-contrib-0.12)
XMonad.Util.Replace (from xmonad-contrib-0.12)
XMonad.Util.Stack (from xmonad-contrib-0.12)
Use -v to see a list of the files searched for. (haskell-hdevtools)
Below is the relevant recompile command in xmonad:
-- | 'recompile force', recompile @~/.xmonad/xmonad.hs@ when any of the
...
...
recompile :: MonadIO m => Bool -> m Bool
recompile force = io $ do
dir <- getXMonadDir
let binn = "xmonad-"++arch++"-"++os
bin = dir </> binn
base = dir </> "xmonad"
err = base ++ ".errors"
src = base ++ ".hs"
lib = dir </> "lib"
libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
srcT <- getModTime src
binT <- getModTime bin
if force || any (binT <) (srcT : libTs)
then do
-- temporarily disable SIGCHLD ignoring:
uninstallSignalHandlers
status <- bracket (openFile err WriteMode) hClose $ \h ->
waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-main-is", "main", "-v0", "-o",binn](Just dir)
Nothing Nothing Nothing (Just h)
----- relevant hdevtools commands
hdevtools check -g -Wall xmonad.hs
xmonad.hs:69:18:
Could not find module `XMonad.Util.DTrace'
Perhaps you meant
XMonad.Util.Image (from xmonad-contrib-0.12)
XMonad.Util.Replace (from xmonad-contrib-0.12)
XMonad.Util.Stack (from xmonad-contrib-0.12)
Use -v to see a list of the files searched for.
hdevtools check -g -Wall -g -ilib xmonad.hs
xmonad.hs:230:1: Warning:
Top-level binding with no type signature:
myLayoutHook :: .....
Any thoughts, please?
I need to add a parameter to hdevtools. Not sure if it is a good idea to have it as a flycheck-hdevtools variable?
Thanks
Joe
I recently started working with Cabal sandboxes (as in cabal sandbox init
). However, flycheck-hdevtools does not find the packages installed in the sandbox, which frequently leads to "package not found" errors.
I then have to install the packages outside the sandbox, which (at the moment) still works, but somewhat negates the advantages of having a sandbox.
It is actively maintained, though not by the original author.
Hello,
I am getting this error:
Checker haskell-hdevtools returned non-zero exit code 1, but no errors from output: Glyph.hs:44:18:
Could not find module `Graphics.Rendering.FreeType.Internal.GlyphMetrics'
Use -v to see a list of the files searched for.
Checker definition probably flawed.
Package is in cabal sandbox. I've used
$ cabal sandbox delete
$ cabal sandbox init
$ cabal install --only-dependencies
$ cabal configure && cabal build
Program compiles and works fine.
flycheck-version: 0.18alpha (package: 20140210.1331)
$ emacs --version
GNU Emacs 24.3.1
...
$ cabal --version
cabal-install version 1.18.0.2
using version 1.18.1.2 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
Output of C-c ! C-c
:
-*- mode: compilation; default-directory: "~/code/haskell/bdf/" -*-
Compilation started at Tue Feb 11 16:50:38
hdevtools check -g -Wall /home/$USER/code/haskell/bdf/RepaImg.hs
Glyph.hs:44:18:
Could not find module `Graphics.Rendering.FreeType.Internal.GlyphMetrics'
Use -v to see a list of the files searched for.
Compilation exited abnormally with code 1 at Tue Feb 11 16:50:38
If I open Glyph.hs file, flycheck highlights error on line 44 (the one with qualified keyword) which is same as the output from C-c ! C-c
:
...
import Graphics.Rendering.FreeType.Internal.GlyphMetrics (FT_Glyph_Metrics)
import qualified Graphics.Rendering.FreeType.Internal.GlyphMetrics as GlyphMetrics
...
In other files of my project I am getting the non-zero exit code 1
listed above.
Full contents of *Messages*
buffer:
Loading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/git-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/golang-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/haskell-mode-init.el (source)...
Loading haskell-site-file...done
Loading /usr/share/emacs/site-lisp/site-start.d/haskell-mode-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpmdev-init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/systemtap-init.el (source)...done
OVERVIEW
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Updating buffer list...
Formats have changed, recompiling...done
Updating buffer list...done
Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help
Initializing...done
Loading names...done
Checker haskell-hdevtools returned non-zero exit code 1, but no errors from output: Glyph.hs:44:18:
Could not find module `Graphics.Rendering.FreeType.Internal.GlyphMetrics'
Use -v to see a list of the files searched for.
Checker definition probably flawed.
Checker haskell-hdevtools returned non-zero exit code 1, but no errors from output: Glyph.hs:44:18:
Could not find module `Graphics.Rendering.FreeType.Internal.GlyphMetrics'
Use -v to see a list of the files searched for.
Checker definition probably flawed.
Compilation exited abnormally with code 1
Mark set
Quit
byte-code: Beginning of buffer [4 times]
Auto-saving...
Checker haskell-hdevtools returned non-zero exit code 1, but no errors from output: Glyph.hs:44:18:
Could not find module `Graphics.Rendering.FreeType.Internal.GlyphMetrics'
Use -v to see a list of the files searched for.
Checker definition probably flawed.
Auto-saving...
Updating buffer list...done
Commands: m, u, t, RET, g, k, S, D, Q; q to quit; h for help
Hdevtools - which is in fact still being developed and worked on, as flaky as it may seem to be lately, has built-in support for finding cabal sandboxes, and using them.
Unfortunately, this support assumes that it will be given the actual path to the file (or enough of the path as is needed to crawl back up the tree to find the cabal sandbox).
This used to happen automatically, with source-inplace
. However, for reasons I don't understand, source-inplace
was replaced with source
in mid-2014. This breaks the ability of hdevtools to find the local cabal sandbox, and makes it significantly less useful on actual haskell projects.
Got errors like:
Suspicious state from syntax checker haskell-hdevtools: Flycheck checker haskell-hdevtools returned non-zero exit code 1, but its output contained no errors: Cabal error: Encountered missing dependencies:
hspec-wai -any, hspec-wai-json -any
Try installing a more recent version of haskell-hdevtools, and please open a bug report if the issue persists in the latest release. Thanks!
Hdevtools installed by stack install hdevtools
Flycheck-hdevtools installed by el-get
:
$ git -C ~/.emacs.d/el-get/flycheck-hdevtools/ status
On branch master
Your branch is up-to-date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
flycheck-hdevtools.elc
nothing added to commit but untracked files present (use "git add" to track)
$ git -C ~/.emacs.d/el-get/flycheck-hdevtools/ log -1
commit eab1fc184854341a56154623a131cab6ff0ce18c (HEAD -> master, origin/master, origin/HEAD)
Author: Steve Purcell <[email protected]>
Date: Sun Nov 13 13:46:21 2016 +1300
Note that this library is currently unmaintained
See #5
Emacs GNU Emacs 25.2.1 (x86_64-apple-darwin16.4.0, NS appkit-1504.81 Version 10.12.3 (Build 16D30)) of 2017-06-22
,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.