Coder Social home page Coder Social logo

hsdev's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hsdev's Issues

Unable to load interface for `pkg`

I wasn't sure whether I should file this against hsdev or SublimeHaskell, so please let me know if I should refile against the latter.

I've recently been having an issue with hsdev (via SublimeHaskell) reporting that it could not load interfaces for multiple packages. Said packages are available, and managed by stack, so no issues appear when running stack build. However, in the cases where the issue has been appearing, the libraries in question have not been available in cabal. Running cabal install pkgname will prevent the error from occurring.

The hsdev version was built with the system compiler (ghc-8.0.1) as hsdev cannot currently be built with stack (version bounds failures for all recent lts releases, according to stack solver. This seems to imply hsdev is unable to load interfaces from packages in the stack project, but please correct me if I'm wrong.

Are there any expected reasons that hsdev is unable to pick up the stack curated libraries?

Ideally, it would work with stack-managed packages, removing the requirement to maintain multiple unnecessary package versions on the system. It would also be great to be able to install hsdev via stack, removing the need for cabal-install entirely, but that is a separate issue.

hsdev returns file not found/module not inspected error

I am trying to get hsdev working with SublimeHaskell. However, hsdev returns only error codes, even when working from the command line.

I tried a couple of things so far. See commands and error messages below:

hsdev check -f /mnt/E69AFDCE9AFD9B6F/Downloads/double.hs

{"notify[{"status":"working","progress":null,"name":"/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs","task":"scanning","type":"module"}]} {"notify":[{"status":"ok","progress":null,"name":"/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs","task":"scanning","type":"module"}]} {"error":"module not inspected","module":{"project":null,"file":"/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs"}}

hsdev whois -f /mnt/E69AFDCE9AFD9B6F/Downloads/double.hs x

{"error":"other error","msg":"File '/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs' not found"}

This corresponds to the errors I am getting in Sublime:

Sublime Haskell: hsdev whois returns error: other error, id: 16, msg: File '/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs' not found
Sublime Haskell: hsdev lookup returns error: other error, id: 17, msg: File '/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs' not found
Sublime Haskell: hsdev types returns error: module not inspected, id: 15, module: {'file': '/mnt/E69AFDCE9AFD9B6F/Downloads/double.hs', 'project': None}

Currently I am using ghc-8.0.1, hsdev-0.2.1.0 and cabal 1.22.6.0. I am pretty new to Haskell, so I apologize if I am somehow missing important information. I actually had SublimeHaskell fully working last week, but since then I upgraded ghc, and it appears that I broke something.

I realise that this is probably a problem on my end, which you wont be able to reproduce, but any help in regards how to debug this issue would be greatly appreciated.

ghc> Scope leaves with exception: <stderr>: hPutChar: resource vanished (Broken pipe)

Testing based on current hsdev in github: I am trying to test the cabal-based GHC pragma fix that I reported earlier. My repo is a clone of yours, mvoidex/hsdev.

SublimeHaskell is completely unusable because the current hsdev reports this error for every request related to ghc (and others):

ghc> Scope leaves with exception: <stderr>: hPutChar: resource vanished (Broken pipe)

This happens both on Windows and Mac OSX, so it's definitely independent of platform.

Cannot pin this down to a package change that cabal downloaded, although that seems the very likely culprit. It doesn't look like hsdev prematurely closes a file handle/descriptor and there are no recent changes in the commit log that would indicate this kind of problem.

Initially, I thought it might have to do with runServerCommand when it starts the hsdev server, which would narrow down the problem to changes in the unix package when running on Mac OSX. But the same issue happens on Win64, so I'm really at a loss for debugging.

Unsure how to track this down -- profiling?

SublimeHaskell log file (Win64): hsdev.txt

recursive directory problem, hsdev is stuck

My team uses specific project structure, for example, we have a dir (not a project dir, just a regular one) like this :

ProjectDirectory
+ Module01
 |- .local
+ Module02
 |- .local
+ Module03
 |- .local
...

This .local folder is symbolic link to ProjectDirectory so that we can import e.g. Module01 into Module02.

I don't know why exactly it was done in such a way, but hsdev seems to get stuck in a loop with this case, and I can't use SublimeHaskell because hsdev gets stuck inspecting my project for ever.

If I remove .local symlink, than I get back intellisense, but when I save project I constantly get errors like this Sublime Haskell: hsdev types returns error: ghc error, msg: Failed to load interface for 'Module01'.

And I obviously can't build my module.

cabal install on mac os failed.

src/HsDev/Util.hs:272:58: error:
• Variable not in scope:
(<>) :: Parser (a0 -> a0) -> Mod f0 a1 -> t1
• Perhaps you meant one of these:
‘<|>’ (imported from Options.Applicative),
‘</>’ (imported from System.FilePath),
‘<$>’ (imported from Options.Applicative)

src/HsDev/Util.hs:272:71: error:
• Variable not in scope: (<>) :: t1 -> Mod f1 a2 -> t0
• Perhaps you meant one of these:
‘<|>’ (imported from Options.Applicative),
‘</>’ (imported from System.FilePath),
‘<$>’ (imported from Options.Applicative)

src/HsDev/Util.hs:272:91: error:
• Variable not in scope: (<>) :: t0 -> Mod f2 a3 -> t
• Perhaps you meant one of these:
‘<|>’ (imported from Options.Applicative),
‘</>’ (imported from System.FilePath),
‘<$>’ (imported from Options.Applicative)

cabal install on ubuntu failed

Trying to install hsdev on Ubuntu (16.04) with

cabal update
cabal install hsdev

but error occurs:

Downloading the latest package list from hackage.haskell.org
Skipping download: local and remote files match.
bronti@bronti-UBU:~/all/study/au/func/class$ cabal install hsdev
Resolving dependencies...
Configuring hsdev-0.2.0.0...
Building hsdev-0.2.0.0...
Failed to install hsdev-0.2.0.0
Build log ( /home/bronti/.cabal/logs/hsdev-0.2.0.0.log ):
cabal: Entering directory '/tmp/cabal-tmp-10128/hsdev-0.2.0.0'
Configuring hsdev-0.2.0.0...
Building hsdev-0.2.0.0...
Preprocessing library hsdev-0.2.0.0...
[ 1 of 60] Compiling HsDev.Tools.Ghc.Prelude ( src/HsDev/Tools/Ghc/Prelude.hs, dist/build/HsDev/Tools/Ghc/Prelude.o )
[ 2 of 60] Compiling HsDev.Version    ( src/HsDev/Version.hs, dist/build/HsDev/Version.o )
[ 3 of 60] Compiling HsDev.Tools.Ghc.Compat ( src/HsDev/Tools/Ghc/Compat.hs, dist/build/HsDev/Tools/Ghc/Compat.o )
[ 4 of 60] Compiling System.Directory.Paths ( src/System/Directory/Paths.hs, dist/build/System/Directory/Paths.o )
[ 5 of 60] Compiling System.Directory.Watcher ( src/System/Directory/Watcher.hs, dist/build/System/Directory/Watcher.o )
[ 6 of 60] Compiling HsDev.Util       ( src/HsDev/Util.hs, dist/build/HsDev/Util.o )
[ 7 of 60] Compiling HsDev.PackageDb  ( src/HsDev/PackageDb.hs, dist/build/HsDev/PackageDb.o )
[ 8 of 60] Compiling HsDev.Project.Types ( src/HsDev/Project/Types.hs, dist/build/HsDev/Project/Types.o )
[ 9 of 60] Compiling HsDev.Symbols.Location ( src/HsDev/Symbols/Location.hs, dist/build/HsDev/Symbols/Location.o )
[10 of 60] Compiling HsDev.Symbols.Class ( src/HsDev/Symbols/Class.hs, dist/build/HsDev/Symbols/Class.o )
[11 of 60] Compiling HsDev.Symbols.Documented ( src/HsDev/Symbols/Documented.hs, dist/build/HsDev/Symbols/Documented.o )
[12 of 60] Compiling HsDev.Tools.ClearImports ( src/HsDev/Tools/ClearImports.hs, dist/build/HsDev/Tools/ClearImports.o )
[13 of 60] Compiling HsDev.Types      ( src/HsDev/Types.hs, dist/build/HsDev/Types.o )
[14 of 60] Compiling HsDev.Error      ( src/HsDev/Error.hs, dist/build/HsDev/Error.o )
[15 of 60] Compiling HsDev.Project    ( src/HsDev/Project.hs, dist/build/HsDev/Project.o )
[16 of 60] Compiling HsDev.Watcher.Types ( src/HsDev/Watcher/Types.hs, dist/build/HsDev/Watcher/Types.o )
[17 of 60] Compiling HsDev.Server.Message ( src/HsDev/Server/Message.hs, dist/build/HsDev/Server/Message.o )
[18 of 60] Compiling HsDev.Symbols.Types ( src/HsDev/Symbols/Types.hs, dist/build/HsDev/Symbols/Types.o )
[19 of 60] Compiling HsDev.Symbols    ( src/HsDev/Symbols.hs, dist/build/HsDev/Symbols.o )
[20 of 60] Compiling HsDev.Symbols.Util ( src/HsDev/Symbols/Util.hs, dist/build/HsDev/Symbols/Util.o )
[21 of 60] Compiling HsDev.Tools.Types ( src/HsDev/Tools/Types.hs, dist/build/HsDev/Tools/Types.o )
[22 of 60] Compiling HsDev.Watcher    ( src/HsDev/Watcher.hs, dist/build/HsDev/Watcher.o )
[23 of 60] Compiling HsDev.Tools.Base ( src/HsDev/Tools/Base.hs, dist/build/HsDev/Tools/Base.o )
[24 of 60] Compiling HsDev.Tools.AutoFix ( src/HsDev/Tools/AutoFix.hs, dist/build/HsDev/Tools/AutoFix.o )
[25 of 60] Compiling HsDev.Tools.Cabal ( src/HsDev/Tools/Cabal.hs, dist/build/HsDev/Tools/Cabal.o )
[26 of 60] Compiling HsDev.Tools.Hayoo ( src/HsDev/Tools/Hayoo.hs, dist/build/HsDev/Tools/Hayoo.o )
[27 of 60] Compiling HsDev.Tools.HLint ( src/HsDev/Tools/HLint.hs, dist/build/HsDev/Tools/HLint.o )
[28 of 60] Compiling HsDev.Tools.HDocs ( src/HsDev/Tools/HDocs.hs, dist/build/HsDev/Tools/HDocs.o )
[29 of 60] Compiling Data.Maybe.JustIf ( src/Data/Maybe/JustIf.hs, dist/build/Data/Maybe/JustIf.o )
[30 of 60] Compiling Data.Lisp        ( src/Data/Lisp.hs, dist/build/Data/Lisp.o )
[31 of 60] Compiling Data.Help        ( src/Data/Help.hs, dist/build/Data/Help.o )
[32 of 60] Compiling Data.Deps        ( src/Data/Deps.hs, dist/build/Data/Deps.o )
[33 of 60] Compiling Control.Concurrent.Util ( src/Control/Concurrent/Util.hs, dist/build/Control/Concurrent/Util.o )
[34 of 60] Compiling Control.Concurrent.FiniteChan ( src/Control/Concurrent/FiniteChan.hs, dist/build/Control/Concurrent/FiniteChan.o )
[35 of 60] Compiling Control.Concurrent.Worker ( src/Control/Concurrent/Worker.hs, dist/build/Control/Concurrent/Worker.o )
[36 of 60] Compiling HsDev.Tools.Ghc.Worker ( src/HsDev/Tools/Ghc/Worker.hs, dist/build/HsDev/Tools/Ghc/Worker.o )

src/HsDev/Tools/Ghc/Worker.hs:78:121: error:
    • No instance for (MonadLog Ghc)
        arising from the 'deriving' clause of a data type declaration
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    • When deriving the instance for (MonadLog GhcM)
cabal: Leaving directory '/tmp/cabal-tmp-10128/hsdev-0.2.0.0'
cabal: Error: some packages failed to install:
hsdev-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1

hsdev and stack

I'm currently doing some digging around SublimeHaskell/SublimeHaskell/issues/318, and the fact that hsdev cannot be built for any of the current (or older) stackage snapshots is a bit of a blocker on the work.

Would you object to a pull request that updates hdsev and its dependency bounds to be in line with stackage? I do realise that getting hsdev on stackage requires additional work on your behalf, but it would bring significant benefits for the SublimeHaskell ecosystem. You likely already know, but more information can be found for stackage and the stackage maintainers agreement.

I would offer to maintain the package boundaries for stackage myself, but I realise that I'm somewhat of an unknown quantity at this point, and you would likely be wary of giving me contributor access to the hsdev repo.

Unable to install system wide.

I'm trying to install hsdev on Arch, to play with SublimeHaskell. So far I've been unable to install it due to dependency problems. Here is the Stack output:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hsdev-0.2.5.0:
    hformat-0.1.0.1 must match ==0.3.* (latest applicable is 0.3.0.0)
    simple-log-0.5.1 must match ==0.9.* (latest applicable is 0.9.2)
    text-region-0.1.0.1 must match ==0.3.* (latest applicable is 0.3.0.0)

It also failed with Nix, and I got a very similar output.

installing hsdev-0.2.0.0

Hi!

I'm trying to use SublimeHaskell in sublime editor, and it requires hsdev-0.2.0.0.
I've tried to install it with stack but I get weird dependency problems.
Note: I have a completely clean stack installation, without any packages installed. Also I'm on Windows 10. Despite the error messages of stack, msys is installed, and it is on the path.

Below you can see the steps I tries

1. Tried to install hsdev-0.2.0.0 with stack

C:\Users...>stack install hsdev-0.2.0.0
Continuing despite missing tool: msys2

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hsdev-0.2.0.0:
haddock-api must match >=2.17.0 && <2.18.0, but the stack configuration has no specified version
(latest applicable is 2.17.3.1)
haskell-src-exts-1.18.2 must match >=1.17.0 && <1.18.0 (latest applicable is 1.17.1)
hdocs must match >=0.5.0, but the stack configuration has no specified version (latest applicable is 0.5.2.0)
optparse-applicative-0.13.2.0 must match >=0.11 && <0.13 (latest applicable is 0.12.1.0)
simple-log-0.5.1 must match ==0.4.* (latest applicable is 0.4.0)

Recommended action: try adding the following to your extra-deps in C:\sr\global-project\stack.yaml:

  • haddock-api-2.17.3.1
  • hdocs-0.5.2.0

After adding the recommended dependencies to the global-project/stack.yaml file:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for hsdev-0.2.0.0:
haskell-src-exts-1.18.2 must match >=1.17.0 && <1.18.0 (latest applicable is 1.17.1)
optparse-applicative-0.13.2.0 must match >=0.11 && <0.13 (latest applicable is 0.12.1.0)
simple-log-0.5.1 must match ==0.4.* (latest applicable is 0.4.0)

Plan construction failed.

2. Tried to install the dependencies manually

haskell-src-exts-1.17.1 installed successfully, but simple-log did not:

C:\Users...>stack install simple-log-0.4.0
Continuing despite missing tool: msys2

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for simple-log-0.4.0:
directory-1.3.0.0 must match >=1.2 && <1.3 (latest applicable is 1.2.7.1)

Plan construction failed.

C:\Users...>stack install directory-1.2.7.1
Continuing despite missing tool: msys2
directory-1.2.7.1: download
directory-1.2.7.1: configure
Package directory uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
directory-1.2.7.1: build
Package directory uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
directory-1.2.7.1: copy/register
Package directory uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file
Package directory uses a custom Cabal build, but does not use a custom-setup stanza
Not using the explicit setup deps approach based on configuration
Strongly recommend fixing the package's cabal file

C:\Users...>stack install simple-log-0.4.0
Continuing despite missing tool: msys2

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for simple-log-0.4.0:
directory-1.3.0.0 must match >=1.2 && <1.3 (latest applicable is 1.2.7.1)

Plan construction failed.

And now I'm stuck, do you have any suggestions?

Installation fails on ghc 7.10.2

Command ghc install hsdev fails with following error:

Resolving dependencies...
Configuring hsdev-0.2.2.0...
Building hsdev-0.2.2.0...
Failed to install hsdev-0.2.2.0
Build log ( /Users/kruk/.cabal/logs/hsdev-0.2.2.0.log ):
Configuring hsdev-0.2.2.0...
Building hsdev-0.2.2.0...
Preprocessing library hsdev-0.2.2.0...
[ 1 of 62] Compiling HsDev.Tools.Ghc.Prelude ( src/HsDev/Tools/Ghc/Prelude.hs, dist/build/HsDev/Tools/Ghc/Prelude.o )
[ 2 of 62] Compiling HsDev.Tools.Ghc.MGhc ( src/HsDev/Tools/Ghc/MGhc.hs, dist/build/HsDev/Tools/Ghc/MGhc.o )

src/HsDev/Tools/Ghc/MGhc.hs:31:1: Warning:
    The import of ‘Packages’ is redundant
      except perhaps to import instances from ‘Packages’
    To import instances alone, use: import Packages()
[ 3 of 62] Compiling HsDev.Version    ( src/HsDev/Version.hs, dist/build/HsDev/Version.o )
[ 4 of 62] Compiling HsDev.Tools.Ghc.Compat ( src/HsDev/Tools/Ghc/Compat.hs, dist/build/HsDev/Tools/Ghc/Compat.o )
[ 5 of 62] Compiling System.Directory.Paths ( src/System/Directory/Paths.hs, dist/build/System/Directory/Paths.o )
[ 6 of 62] Compiling System.Directory.Watcher ( src/System/Directory/Watcher.hs, dist/build/System/Directory/Watcher.o )
[ 7 of 62] Compiling HsDev.Util       ( src/HsDev/Util.hs, dist/build/HsDev/Util.o )

src/HsDev/Util.hs:77:19: Not in scope: ‘Dir.isSymbolicLink’
cabal: Error: some packages failed to install:
hsdev-0.2.2.0 failed during the building phase. The exception was:
ExitFailure 1
ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.2

hsdev-0.1.3.0 build fails

Attempting to configure hsdev and get the following warning:

>cabal configure
Resolving dependencies...
Configuring hsdev-0.1.3.0...
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package haddock-api-2.15.0 requires Cabal-1.18.1.3
package ghc-mod-5.1.1.0 requires Cabal-1.18.1.3
package ghc-7.8.3 requires Cabal-1.18.1.3
package bin-package-db-0.0.0.0 requires Cabal-1.18.1.3
package hsdev-0.1.3.0 requires Cabal-1.20.0.2
package HTTP-4000.2.10 requires network-2.4.2.3
package hsdev-0.1.3.0 requires network-2.6.0.2
package hdocs-0.4.1.0 requires network-2.6.0.2
package parsec-3.1.5 requires text-1.1.0.0
package semigroups-0.15.3 requires text-1.2.0.0
package scientific-0.3.3.2 requires text-1.2.0.0
package polyparse-1.10 requires text-1.2.0.0
package hsdev-0.1.3.0 requires text-1.2.0.0
package hdocs-0.4.1.0 requires text-1.2.0.0
package hashable-1.2.2.0 requires text-1.2.0.0
package ghc-mod-5.1.1.0 requires text-1.2.0.0
package attoparsec-0.12.1.2 requires text-1.2.0.0
package aeson-pretty-0.7.1 requires text-1.2.0.0
package aeson-0.8.0.2 requires text-1.2.0.0

cabal build then fails:

>cabal build
Building hsdev-0.1.3.0...
Preprocessing library hsdev-0.1.3.0...
[ 1 of 49] Compiling HsDev.Version    ( src\HsDev\Version.hs, dist\build\HsDev\Version.o )
[ 2 of 49] Compiling HsDev.Tools.Ghc.Prelude ( src\HsDev\Tools\Ghc\Prelude.hs, dist\build\HsDev\Tools\Ghc\Prelude.o )
[ 3 of 49] Compiling HsDev.Tools.ClearImports ( src\HsDev\Tools\ClearImports.hs, dist\build\HsDev\Tools\ClearImports.o )
[ 4 of 49] Compiling System.Win32.FileMapping.Memory ( src\System\Win32\FileMapping\Memory.hs, dist\build\System\Win32\FileMapping\Memory.o )
[ 5 of 49] Compiling System.Win32.FileMapping.NamePool ( src\System\Win32\FileMapping\NamePool.hs, dist\build\System\Win32\FileMapping\NamePool.o )
[ 6 of 49] Compiling Text.Format      ( src\Text\Format.hs, dist\build\Text\Format.o )
[ 7 of 49] Compiling HsDev.Cabal      ( src\HsDev\Cabal.hs, dist\build\HsDev\Cabal.o )
[ 8 of 49] Compiling Data.Lisp        ( src\Data\Lisp.hs, dist\build\Data\Lisp.o )
[ 9 of 49] Compiling Data.Help        ( src\Data\Help.hs, dist\build\Data\Help.o )
[10 of 49] Compiling System.Console.Args ( src\System\Console\Args.hs, dist\build\System\Console\Args.o )
[11 of 49] Compiling System.Console.Cmd ( src\System\Console\Cmd.hs, dist\build\System\Console\Cmd.o )
[12 of 49] Compiling Data.Group       ( src\Data\Group.hs, dist\build\Data\Group.o )
[13 of 49] Compiling Data.Async       ( src\Data\Async.hs, dist\build\Data\Async.o )
[14 of 49] Compiling Control.Concurrent.Util ( src\Control\Concurrent\Util.hs, dist\build\Control\Concurrent\Util.o )
[15 of 49] Compiling Control.Concurrent.Task ( src\Control\Concurrent\Task.hs, dist\build\Control\Concurrent\Task.o )
[16 of 49] Compiling HsDev.Util       ( src\HsDev\Util.hs, dist\build\HsDev\Util.o )
[17 of 49] Compiling HsDev.Project    ( src\HsDev\Project.hs, dist\build\HsDev\Project.o )
[18 of 49] Compiling HsDev.Server.Message ( src\HsDev\Server\Message.hs, dist\build\HsDev\Server\Message.o )
[19 of 49] Compiling HsDev.Symbols.Location ( src\HsDev\Symbols\Location.hs, dist\build\HsDev\Symbols\Location.o )
[20 of 49] Compiling HsDev.Display    ( src\HsDev\Display.hs, dist\build\HsDev\Display.o )
[21 of 49] Compiling HsDev.Symbols.Class ( src\HsDev\Symbols\Class.hs, dist\build\HsDev\Symbols\Class.o )
[22 of 49] Compiling HsDev.Symbols.Documented ( src\HsDev\Symbols\Documented.hs, dist\build\HsDev\Symbols\Documented.o )
[23 of 49] Compiling HsDev.Symbols    ( src\HsDev\Symbols.hs, dist\build\HsDev\Symbols.o )
[24 of 49] Compiling HsDev.Symbols.Util ( src\HsDev\Symbols\Util.hs, dist\build\HsDev\Symbols\Util.o )
[25 of 49] Compiling HsDev.Database   ( src\HsDev\Database.hs, dist\build\HsDev\Database.o )
[26 of 49] Compiling HsDev.Cache      ( src\HsDev\Cache.hs, dist\build\HsDev\Cache.o )
[27 of 49] Compiling HsDev.Cache.Structured ( src\HsDev\Cache\Structured.hs, dist\build\HsDev\Cache\Structured.o )
[28 of 49] Compiling HsDev.Database.Async ( src\HsDev\Database\Async.hs, dist\build\HsDev\Database\Async.o )
[29 of 49] Compiling HsDev.Commands   ( src\HsDev\Commands.hs, dist\build\HsDev\Commands.o )
[30 of 49] Compiling HsDev.Tools.HDocs ( src\HsDev\Tools\HDocs.hs, dist\build\HsDev\Tools\HDocs.o )
[31 of 49] Compiling HsDev.Symbols.Resolve ( src\HsDev\Symbols\Resolve.hs, dist\build\HsDev\Symbols\Resolve.o )
[32 of 49] Compiling HsDev.Tools.Hayoo ( src\HsDev\Tools\Hayoo.hs, dist\build\HsDev\Tools\Hayoo.o )
[33 of 49] Compiling HsDev.Tools.Base ( src\HsDev\Tools\Base.hs, dist\build\HsDev\Tools\Base.o )
[34 of 49] Compiling HsDev.Tools.Cabal ( src\HsDev\Tools\Cabal.hs, dist\build\HsDev\Tools\Cabal.o )
[35 of 49] Compiling HsDev.Scan.Browse ( src\HsDev\Scan\Browse.hs, dist\build\HsDev\Scan\Browse.o )
[36 of 49] Compiling HsDev.Inspect    ( src\HsDev\Inspect.hs, dist\build\HsDev\Inspect.o )
[37 of 49] Compiling System.Win32.PowerShell ( src\System\Win32\PowerShell.hs, dist\build\System\Win32\PowerShell.o )
[38 of 49] Compiling Control.Concurrent.FiniteChan ( src\Control\Concurrent\FiniteChan.hs, dist\build\Control\Concurrent\FiniteChan.o )
[39 of 49] Compiling Control.Concurrent.Worker ( src\Control\Concurrent\Worker.hs, dist\build\Control\Concurrent\Worker.o )
[40 of 49] Compiling HsDev.Tools.GhcMod ( src\HsDev\Tools\GhcMod.hs, dist\build\HsDev\Tools\GhcMod.o )
[41 of 49] Compiling HsDev.Tools.GhcMod.InferType ( src\HsDev\Tools\GhcMod\InferType.hs, dist\build\HsDev\Tools\GhcMod\InferType.o )
[42 of 49] Compiling HsDev.Scan       ( src\HsDev\Scan.hs, dist\build\HsDev\Scan.o )
[43 of 49] Compiling HsDev            ( src\HsDev.hs, dist\build\HsDev.o )
[44 of 49] Compiling HsDev.Database.Update ( src\HsDev\Database\Update.hs, dist\build\HsDev\Database\Update.o )
[45 of 49] Compiling HsDev.Tools.Ghc.Worker ( src\HsDev\Tools\Ghc\Worker.hs, dist\build\HsDev\Tools\Ghc\Worker.o )
[46 of 49] Compiling HsDev.Server.Types ( src\HsDev\Server\Types.hs, dist\build\HsDev\Server\Types.o )
[47 of 49] Compiling HsDev.Client.Commands ( src\HsDev\Client\Commands.hs, dist\build\HsDev\Client\Commands.o )
[48 of 49] Compiling Control.Apply.Util ( src\Control\Apply\Util.hs, dist\build\Control\Apply\Util.o )
[49 of 49] Compiling HsDev.Server.Commands ( src\HsDev\Server\Commands.hs, dist\build\HsDev\Server\Commands.o )
In-place registering hsdev-0.1.3.0...
Preprocessing executable 'hsdev' for hsdev-0.1.3.0...
[1 of 1] Compiling Main             ( tools\hsdev.hs, dist\build\hsdev\hsdev-tmp\Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package Win32-2.3.0.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package Cabal-1.20.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package text-1.1.0.0 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.4.2.3 ... ghc.exe: warning: inet_ntoa from linking ... ws2_32 is linked instead of __imp_inet_ntoa
ghc.exe: warning: getnameinfo from ws2_32 is linked instead of __imp_getnameinfo

ghc.exe: warning: getaddrinfo from ws2_32 is linked instead of __imp_getaddrinfo

ghc.exe: warning: freeaddrinfo from ws2_32 is linked instead of __imp_freeaddrinfo
ghc.exe: warning: accept from ws2_32 is linked instead of __imp_accept
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
ghc.exe: warning: WSAStartup from ws2_32 is linked instead of __imp_WSAStartup
ghc.exe: warning: WSACleanup from ws2_32 is linked instead of __imp_WSACleanup
done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package HTTP-4000.2.10 ... linking ... done.
Loading package text-1.2.0.0 ...

GHCi runtime linker: fatal error: I found a duplicate definition for symbol
   _hs_text_memcpy
whilst processing object file
   C:\Program Files\Haskell\x86_64-windows-ghc-7.8.3\text-1.2.0.0\HStext-1.2.0.0.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.
GHCi cannot safely continue in this situation.  Exiting now.  Sorry.

whois / file not found

I've been trying to get SublimeHaskell working, but have been having issues. After noticing some hsdev related errors in the console output, I decided to try the corresponding hsdev commands from the CLI.

Here is one example, for which I get the same result in the CLI as I do in the Sublime console:

$ ~/.cabal/bin/hsdev start
Server started at port 4567
$ ~/.cabal/bin/hsdev whois main -f ./areaUnderCurve.hs
{"error":"other error","msg":"File '/Users/Ken/Documents/HaskellExperiments/area/areaUnderCurve.hs' not found"}
$ ls ./areaUnderCurve.hs 
./areaUnderCurve.hs

Any ideas on how this can happen? Apologies if I'm doing something wrong, I'm extremely new to Haskell and its toolset.

If it matters, this is on macOS 10.12.5.

cabal.exe: Could not resolve dependencies

I'm using Windows 8.1 / Git Bash / Haskell Platform 8.0.2

$ cabal install hsdev
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
trying: hsdev-0.2.1.0 (user goal)
trying: ghc-8.0.2/installed-8.0... (dependency of hsdev-0.2.1.0)
next goal: haddock-api (dependency of hsdev-0.2.1.0)
rejecting: haddock-api-2.17.3, haddock-api-2.17.2 (conflict:
ghc==8.0.2/installed-8.0..., haddock-api => ghc>=8.0 && <8.0.2)
rejecting: haddock-api-2.16.1, haddock-api-2.16.0, haddock-api-2.15.0.2,
haddock-api-2.15.0.1, haddock-api-2.15.0 (conflict: hsdev =>
haddock-api>=2.17.0 && <2.18.0)
Dependency tree exhaustively searched.

'use supress' really suppresses everything

Setting the "log politics" to use supress suppresses the hsdev startup message with the version number and port number. That completely disables SublimeHaskell's ability to operate. Suggest printing to stdout instead of using simple-log.

"log politics" always gets a smile from people who see it, because they expect "policies", not "politics".

Also, suggest "suppress" (two "p"-s), since that's the correct spelling. You'll have to keep the current "supress" for backward compatibility.

Upload to hackage

This looks really cool! Could you upload to Hackage please?

(PS. I want to add :def hayoo \s -> return $ ":! hsdev hayoo \"" ++ s ++ "\"" to my repl)

hlint-2.0.[56] aborts with error: /.../HLint.hs not found

stderr from hsdev, from within SublimeHaskell:

<hsdev stderr> hsdev: io exception: /Users/bsm21317/.cabal/share/x86_64-osx-ghc-8.0.1/hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
<hsdev stderr> 2017-05-13 15:52:51 -0700	ERROR	:127.0.0.1:60922/127.0.0.1:60922/req/15> Scope leaves with exception: io exception: /.../hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
<hsdev stderr> CallStack (from HasCallStack):
<hsdev stderr>   onError, called at src/System/Log/Simple/Monad.hs:104:36 in simple-log-0.8.5-KDZok9tQRQg5J6hdRj1vuI:System.Log.Simple.Monad

I did start up an independent hsdev (hsdev run), and ran hsdev scan and hsdev lint outside of SublimeHaskell. Here's hsdev run's output:

Server started at port 4567
2017-05-13 16:02:10 -0700       INFO    :> server started at port 4567
2017-05-13 16:02:14 -0700       INFO    :127.0.0.1:61030> connected
hsdev: shutdown: invalid argument (Socket is not connected)
2017-05-13 16:02:28 -0700       INFO    :127.0.0.1:61030> disconnected
2017-05-13 16:02:55 -0700       INFO    :127.0.0.1:61044> connected
hsdev: io exception: /.../hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
2017-05-13 16:02:55 -0700       ERROR   :127.0.0.1:61044/127.0.0.1:61044/req/_> Scope leaves with exception: io exception: /.../hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
CallStack (from HasCallStack):
  onError, called at src/System/Log/Simple/Monad.hs:104:36 in simple-log-0.8.5-KDZok9tQRQg5J6hdRj1vuI:System.Log.Simple.Monad

2017-05-13 16:02:55 -0700       ERROR   :127.0.0.1:61044/127.0.0.1:61044/req> Scope leaves with exception: io exception: /.../hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
CallStack (from HasCallStack):
  onError, called at src/System/Log/Simple/Monad.hs:104:36 in simple-log-0.8.5-KDZok9tQRQg5J6hdRj1vuI:System.Log.Simple.Monad

2017-05-13 16:02:55 -0700       ERROR   :127.0.0.1:61044/127.0.0.1:61044> Scope leaves with exception: io exception: /.../hlint-2.0.5/HLint.hs: openFile: does not exist (No such file or directory)
CallStack (from HasCallStack):
  onError, called at src/System/Log/Simple/Monad.hs:104:36 in simple-log-0.8.5-KDZok9tQRQg5J6hdRj1vuI:System.Log.Simple.Monad

From my understanding, the HLint3 interface shouldn't crap out if HLint.hs isn't found -- it checks for HLint.hs for backward (bugward?) compatibility.

Build fails with ghc-mod-5.4.0.0

[49 of 61] Compiling HsDev.Tools.GhcMod ( src\HsDev\Tools\GhcMod.hs, dist\build\HsDev\Tools\GhcMod.o )

src\HsDev\Tools\GhcMod.hs:64:54:
    `GhcMod.ghcUserOptions' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:73:34:
    `GhcMod.detailed' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:73:58:
    `GhcMod.qualified' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:73:83:
    `GhcMod.ghcUserOptions' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:118:38:
    `GhcMod.ghcUserOptions' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:176:58:
    `GhcMod.ghcUserOptions' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:221:32:
    `GhcMod.ghcUserOptions' is not a (visible) constructor field name

src\HsDev\Tools\GhcMod.hs:228:32:
    `GhcMod.hlintOpts' is not a (visible) constructor field name

"error":"connect: does not exist (Connection refused)","details":{}

Hi, I've been recieving an error message upon tring to setup the hsdev package. It seems to not be able to connect. Info:

$ hsdev version
0.1.5.2
$ hsdev start
Server started at port 4567
$ hsdev ping
{"error":"connect: does not exist (Connection refused)","details":{}}

I have also tried $ hsdev start --cache cache but to no avail. Any other commands return the same error message.

Cabal install hsdev failed on windows

Resolving dependencies...                                                  
Configuring hsdev-0.2.0.0...                                               
Building hsdev-0.2.0.0...                                                  
Failed to install hsdev-0.2.0.0                                            
Build log ( C:\Users\Administrator\AppData\Roaming\cabal\logs\hsdev-0.2.0.0
.log ):                                                                    
Building hsdev-0.2.0.0...                                                  
Preprocessing library hsdev-0.2.0.0...                                     
[ 1 of 63] Compiling HsDev.Tools.Ghc.Prelude ( src\HsDev\Tools\Ghc\Prelude.
hs, dist\build\HsDev\Tools\Ghc\Prelude.o )                                 
[ 2 of 63] Compiling System.Win32.FileMapping.Memory ( src\System\Win32\Fil
eMapping\Memory.hs, dist\build\System\Win32\FileMapping\Memory.o )         
[ 3 of 63] Compiling HsDev.Version    ( src\HsDev\Version.hs, dist\build\Hs
Dev\Version.o )                                                            
[ 4 of 63] Compiling System.Win32.FileMapping.NamePool ( src\System\Win32\F
ileMapping\NamePool.hs, dist\build\System\Win32\FileMapping\NamePool.o )   
[ 5 of 63] Compiling HsDev.Tools.Ghc.Compat ( src\HsDev\Tools\Ghc\Compat.hs
, dist\build\HsDev\Tools\Ghc\Compat.o )                                    
[ 6 of 63] Compiling System.Directory.Paths ( src\System\Directory\Paths.hs
, dist\build\System\Directory\Paths.o )                                    
[ 7 of 63] Compiling System.Directory.Watcher ( src\System\Directory\Watche
r.hs, dist\build\System\Directory\Watcher.o )                              
[ 8 of 63] Compiling HsDev.Util       ( src\HsDev\Util.hs, dist\build\HsDev
\Util.o )                                                                  

src\HsDev\Util.hs:272:58: error:                                           
    * Variable not in scope:                                               
        (<>) :: Parser (a0 -> a0) -> Mod f0 a1 -> t1                       
    * Perhaps you meant one of these:                                      
        `<|>' (imported from Options.Applicative),                         
        `</>' (imported from System.FilePath),                             
        `<$>' (imported from Options.Applicative)                          

src\HsDev\Util.hs:272:71: error:                                           
    * Variable not in scope: (<>) :: t1 -> Mod f1 a2 -> t0                 
    * Perhaps you meant one of these:                                      
        `<|>' (imported from Options.Applicative),                         
        `</>' (imported from System.FilePath),                             
        `<$>' (imported from Options.Applicative)                          

src\HsDev\Util.hs:272:91: error:                                           
    * Variable not in scope: (<>) :: t0 -> Mod f2 a3 -> t                  
    * Perhaps you meant one of these:                                      
        `<|>' (imported from Options.Applicative),                         
        `</>' (imported from System.FilePath),                             
        `<$>' (imported from Options.Applicative)                          
cabal: Leaving directory 'C:\Users\ADMINI~1\AppData\Local\Temp\cabal-tmp-12
048\hsdev-0.2.0.0'                                                         
cabal: Error: some packages failed to install:                             
hsdev-0.2.0.0 failed during the building phase. The exception was:         
ExitFailure

cabal "default-extensions" not passed to ghc during scan

I prefer to add "default-extensions" to my .cabal file so as not to pollute the top of my source files. However, it doesn't seem as if hsdev passes these options to ghc while scanning the source. As an example, Utils.hs requires OverloadedStrings:

$ hsdev check -f src-emubase/Machine/MemorySystem.hs
{"notify":[{"status":"working","progress":null,"name":".../emuwork/src-emubase/emubase.cabal","task":"scanning","type":"path"}]}
{"notify":[{"status":"ok","progress":null,"name":".../emuwork/src-emubase/emubase.cabal","task":"scanning","type":"path"}]}
{"notify":[{"status":"working","progress":null,"name":".../emuwork/src-emubase/Machine/MemorySystem.hs","task":"scanning","type":"module"}]}
{"notify":[{"status":"ok","progress":null,"name":"...y/emuwork/src-emubase/Machine/MemorySystem.hs","task":"scanning","type":"module"}]}
[{"note":{"suggestion":null,"message":"• Couldn't match expected type ‘Text’ with actual type ‘[Char]’\n• In the first argument of ‘append’, namely ‘\"0x\"’\n  In the first argument of ‘(.)’, namely ‘append \"0x\"’\n  In the expression: append \"0x\" . asHex"},"source":{"project":null,"file":".../emuwork/src-emubase/Machine/Utils.hs"},"region":{"to":{"line":27,"column":26},"from":{"line":27,"column":22}},"level":"error"}, ...]

'OverloadedStrings' is specified in the emubase.cabal file in the Library to which this code snippet belongs.

The hsdev check will work if I put {-# LANGUAGE OverloadedStrings #-} at the top of the source. Not quite sure where to look in the source to start figuring out how to debug and propose a patch. Happy to look at the problem and propose a patch if you can give me a bit of clue.

cabal install hsdev fails with ExitFailure 1

Haskell noob here. When I try to install hsdev on macOS using cabal version 2.0.0.2 on ghci version 8.2.1 I get the following error-

Building regex-pcre-builtin-0.94.4.8.8.35...
Failed to install regex-pcre-builtin-0.94.4.8.8.35
Build log ( /Users/harpreet/.cabal/logs/ghc-8.2.1/regex-pcre-builtin-0.94.4.8.8.35-ErSIfFBjU2O890llA9JKT4.log ):
cabal: Entering directory '/var/folders/q3/0p0mxly93xv0khxhp59n7qrc0000gn/T/cabal-tmp-17197/regex-pcre-builtin-0.94.4.8.8.35'
Configuring regex-pcre-builtin-0.94.4.8.8.35...
Preprocessing library for regex-pcre-builtin-0.94.4.8.8.35..
Building library for regex-pcre-builtin-0.94.4.8.8.35..
<command line>: cannot satisfy -package-id regex-base-0.93.2-6R4SyH615Fd96n1BuXT5nY:
    regex-base-0.93.2-6R4SyH615Fd96n1BuXT5nY is unusable due to shadowed dependencies:
      mtl-2.2.1-19EL8AGBsN3DnnOhrC9xY3
    (use -v for more information)

and finally the build fails with the message -

cabal: Error: some packages failed to install:
hsdev-0.2.5.1-KLZyINgHjNjLoIhf1REoIt depends on hsdev-0.2.5.1 which failed to
install.
regex-pcre-builtin-0.94.4.8.8.35-ErSIfFBjU2O890llA9JKT4 failed during the
building phase. The exception was:
ExitFailure 1

How should I fix this?

Why is hsdev using so much memory?

While ghc-mod uses less than 250MB of memory, hsdev uses more than 1GB. Why?

capture

Both in ghc-mod and hsdev, I used this example which I found on Google, and I used Stack to build it.


Also, when saving a file, it looks like hsdev in SublimeHaskell is much slower than ghc-mod in Atom/ide-haskell, at least when both are used with their default settings.

Cabal install on Linux failed

The installation of (all version of) hsdev failed on Linux (xUbuntu 16.04)

Downloading hsdev-0.2.0.0...
Configuring hsdev-0.2.0.0...
Building hsdev-0.2.0.0...
Failed to install hsdev-0.2.0.0
Build log ( /home/nameo12/.cabal/logs/hsdev-0.2.0.0.log ):
Configuring hsdev-0.2.0.0...
Building hsdev-0.2.0.0...
Preprocessing library hsdev-0.2.0.0...
[ 1 of 60] Compiling HsDev.Tools.Ghc.Prelude ( src/HsDev/Tools/Ghc/Prelude.hs, dist/build/HsDev/Tools/Ghc/Prelude.o )
[ 2 of 60] Compiling HsDev.Version    ( src/HsDev/Version.hs, dist/build/HsDev/Version.o )
[ 3 of 60] Compiling HsDev.Tools.Ghc.Compat ( src/HsDev/Tools/Ghc/Compat.hs, dist/build/HsDev/Tools/Ghc/Compat.o )
[ 4 of 60] Compiling System.Directory.Paths ( src/System/Directory/Paths.hs, dist/build/System/Directory/Paths.o )
[ 5 of 60] Compiling System.Directory.Watcher ( src/System/Directory/Watcher.hs, dist/build/System/Directory/Watcher.o )
[ 6 of 60] Compiling HsDev.Util       ( src/HsDev/Util.hs, dist/build/HsDev/Util.o )
[ 7 of 60] Compiling HsDev.PackageDb  ( src/HsDev/PackageDb.hs, dist/build/HsDev/PackageDb.o )
[ 8 of 60] Compiling HsDev.Project.Types ( src/HsDev/Project/Types.hs, dist/build/HsDev/Project/Types.o )
[ 9 of 60] Compiling HsDev.Symbols.Location ( src/HsDev/Symbols/Location.hs, dist/build/HsDev/Symbols/Location.o )
[10 of 60] Compiling HsDev.Symbols.Class ( src/HsDev/Symbols/Class.hs, dist/build/HsDev/Symbols/Class.o )
[11 of 60] Compiling HsDev.Symbols.Documented ( src/HsDev/Symbols/Documented.hs, dist/build/HsDev/Symbols/Documented.o )
[12 of 60] Compiling HsDev.Tools.ClearImports ( src/HsDev/Tools/ClearImports.hs, dist/build/HsDev/Tools/ClearImports.o )
[13 of 60] Compiling HsDev.Types      ( src/HsDev/Types.hs, dist/build/HsDev/Types.o )
[14 of 60] Compiling HsDev.Error      ( src/HsDev/Error.hs, dist/build/HsDev/Error.o )
[15 of 60] Compiling HsDev.Project    ( src/HsDev/Project.hs, dist/build/HsDev/Project.o )
[16 of 60] Compiling HsDev.Watcher.Types ( src/HsDev/Watcher/Types.hs, dist/build/HsDev/Watcher/Types.o )
[17 of 60] Compiling HsDev.Server.Message ( src/HsDev/Server/Message.hs, dist/build/HsDev/Server/Message.o )
[18 of 60] Compiling HsDev.Symbols.Types ( src/HsDev/Symbols/Types.hs, dist/build/HsDev/Symbols/Types.o )
[19 of 60] Compiling HsDev.Symbols    ( src/HsDev/Symbols.hs, dist/build/HsDev/Symbols.o )
[20 of 60] Compiling HsDev.Symbols.Util ( src/HsDev/Symbols/Util.hs, dist/build/HsDev/Symbols/Util.o )
[21 of 60] Compiling HsDev.Tools.Types ( src/HsDev/Tools/Types.hs, dist/build/HsDev/Tools/Types.o )
[22 of 60] Compiling HsDev.Watcher    ( src/HsDev/Watcher.hs, dist/build/HsDev/Watcher.o )
[23 of 60] Compiling HsDev.Tools.Base ( src/HsDev/Tools/Base.hs, dist/build/HsDev/Tools/Base.o )
[24 of 60] Compiling HsDev.Tools.AutoFix ( src/HsDev/Tools/AutoFix.hs, dist/build/HsDev/Tools/AutoFix.o )
[25 of 60] Compiling HsDev.Tools.Cabal ( src/HsDev/Tools/Cabal.hs, dist/build/HsDev/Tools/Cabal.o )
[26 of 60] Compiling HsDev.Tools.Hayoo ( src/HsDev/Tools/Hayoo.hs, dist/build/HsDev/Tools/Hayoo.o )
[27 of 60] Compiling HsDev.Tools.HLint ( src/HsDev/Tools/HLint.hs, dist/build/HsDev/Tools/HLint.o )
[28 of 60] Compiling HsDev.Tools.HDocs ( src/HsDev/Tools/HDocs.hs, dist/build/HsDev/Tools/HDocs.o )
[29 of 60] Compiling Data.Maybe.JustIf ( src/Data/Maybe/JustIf.hs, dist/build/Data/Maybe/JustIf.o )
[30 of 60] Compiling Data.Lisp        ( src/Data/Lisp.hs, dist/build/Data/Lisp.o )
[31 of 60] Compiling Data.Help        ( src/Data/Help.hs, dist/build/Data/Help.o )
[32 of 60] Compiling Data.Deps        ( src/Data/Deps.hs, dist/build/Data/Deps.o )
[33 of 60] Compiling Data.Group       ( src/Data/Group.hs, dist/build/Data/Group.o )
[34 of 60] Compiling HsDev.Database   ( src/HsDev/Database.hs, dist/build/HsDev/Database.o )
[35 of 60] Compiling HsDev.Cache      ( src/HsDev/Cache.hs, dist/build/HsDev/Cache.o )
[36 of 60] Compiling HsDev.Symbols.Resolve ( src/HsDev/Symbols/Resolve.hs, dist/build/HsDev/Symbols/Resolve.o )
[37 of 60] Compiling HsDev.Commands   ( src/HsDev/Commands.hs, dist/build/HsDev/Commands.o )
[38 of 60] Compiling HsDev.Cache.Structured ( src/HsDev/Cache/Structured.hs, dist/build/HsDev/Cache/Structured.o )
[39 of 60] Compiling Data.Async       ( src/Data/Async.hs, dist/build/Data/Async.o )
[40 of 60] Compiling HsDev.Database.Async ( src/HsDev/Database/Async.hs, dist/build/HsDev/Database/Async.o )
[41 of 60] Compiling Control.Concurrent.Util ( src/Control/Concurrent/Util.hs, dist/build/Control/Concurrent/Util.o )
[42 of 60] Compiling Control.Concurrent.FiniteChan ( src/Control/Concurrent/FiniteChan.hs, dist/build/Control/Concurrent/FiniteChan.o )
[43 of 60] Compiling Control.Concurrent.Worker ( src/Control/Concurrent/Worker.hs, dist/build/Control/Concurrent/Worker.o )
[44 of 60] Compiling HsDev.Tools.Ghc.Worker ( src/HsDev/Tools/Ghc/Worker.hs, dist/build/HsDev/Tools/Ghc/Worker.o )

src/HsDev/Tools/Ghc/Worker.hs:78:121:
    No instance for (MonadLog Ghc)
      arising from the 'deriving' clause of a data type declaration
    Possible fix:
      use a standalone 'deriving instance' declaration,
        so you can specify the instance context yourself
    When deriving the instance for (MonadLog GhcM)
cabal: Error: some packages failed to install:
hsdev-0.2.0.0 failed during the building phase. The exception was:
ExitFailure 1

Invalid preceding regular expression

With hsdev-0.1.2.2 I get this regex error (with no arguments)

$ hsdev
hsdev: user error (Text.Regex.Posix.String died: (ReturnCode 13,"Invalid preceding regular expression"))

I'm not sure, perhaps I accidentally installed against some bad dependency? Perhaps someone else has run into the same thing...

Module not found

I'm rather confused. I have a project with the following cabal/hs files:
https://gist.github.com/BobobUnicorn/c854f0d553b90fc2e815

Running the commands:

hsdev start
hsdev scan --project .
hsdev modules --project . --pretty

gives the following modules:

[
    {
        "location": {
            "project": "/home/kchoi/Documents/testproj/testproj.cabal",
            "file": "/home/kchoi/Documents/testproj/app/Main.hs"
        },
        "name": "Main"
    },
    {
        "location": {
            "project": "/home/kchoi/Documents/testproj/testproj.cabal",
            "file": "/home/kchoi/Documents/testproj/src/Lib.hs"
        },
        "name": "Lib"
    },
    {
        "location": {
            "project": "/home/kchoi/Documents/testproj/testproj.cabal",
            "file": "/home/kchoi/Documents/testproj/test/Spec.hs"
        },
        "name": "Main"
    }
]

but running:

hsdev check --file app/Main.hs --pretty

gives:

{
    "error": "Could not find module ‘Lib’\nUse -v to see a list of the files searched for.\n",
    "details": {}
}

Any ideas?

Does not compile with ghc-mod-5.4.0.0

As the title says, I cannot build hsdev with ghc-mod-5.4.0.0, and the current release of hsdev on hackage does not constrain to use ghc-mod-5.3.0.0.

Update for ghc-mod >= 5

I tried it out with ghc-mod-5.0.1.2 just to see if it would work out, but no such luck I'm afraid

[16 of 40] Compiling HsDev.Tools.GhcMod ( src/HsDev/Tools/GhcMod.hs, dist/dist-sandbox-7c76f6a0/build/HsDev/Tools/GhcMod.o )

src/HsDev/Tools/GhcMod.hs:42:46:
    Not in scope: ‘GhcMod.listModules’
    Perhaps you meant ‘GhcMod.modules’ (imported from Language.Haskell.GhcMod)

src/HsDev/Tools/GhcMod.hs:43:42:
    ‘GhcMod.ghcOpts’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:53:25:
    Not in scope: ‘GhcMod.browseModule’

src/HsDev/Tools/GhcMod.hs:56:25:
    ‘GhcMod.ghcOpts’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:87:17:
    Not in scope: ‘GhcMod.infoExpr’
    Perhaps you meant ‘GhcMod.info’ (imported from Language.Haskell.GhcMod)

src/HsDev/Tools/GhcMod.hs:87:58:
    ‘GhcMod.ghcOpts’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:129:25:
    Not in scope: ‘GhcMod.typeExpr’
    Perhaps you meant ‘GhcMod.types’ (imported from Language.Haskell.GhcMod)

src/HsDev/Tools/GhcMod.hs:130:42:
    ‘GhcMod.ghcOpts’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:181:42:
    ‘GhcMod.ghcOpts’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:188:27: Not in scope: ‘GhcMod.lintSyntax’

ghc-mod type "File not found"

Hi,
i send follow request:
{"id": "5", "opts": {"file": "C:/Dev/hs/Main.hs"}, "command": "ghc-mod type", "args": ["5", "2"]}

and got response:
3:{"error":"File 'C:\Dev\hs\Main.hs' not found","details":{}}

the problem is "ghc-mod type C:/Dev/hs/Main.hs 5 2" work so what i do wrong?

Is there a pre-built Windows hsdev.exe binary?

Doesn't build at my end "the simple way" (stack install hsdev), tried this hack and failed, no amount of tinkering and tweaking amounted to much here, almost ready to give up (not exactly mission-critical though supremely nice-to-have no less) but would love to have a hsdev.exe in my local\bin so SublimeHaskell gets a little boost --- so since I'm not seeing a website or user forum for hsdev I'm asking right, in case any Windows user has this sitting around compiled and working-just-fine..

Pattern match failure: src/HsDev/Tools/GhcTypes.hs:69:9-11

Now that I can see stderr's output, new problem:

21/01/17 20:44:54 -0800 TRACE   1/update/task/directory> session: ghc -no-user-package-db
21/01/17 20:44:54 -0800 TRACE   1/update/task/directory> session: ghc -no-user-package-db, -package-db <homedir>/.stack/snapshots/x86_64-osx/nightly-2016-12-31/8.0.1/pkgdb, -package-db <homedir>/play/emuwork/.stack-work/install/x86_64-osx/nightly-2016-12-31/8.0.1/pkgdb
21/01/17 20:44:54 -0800 ERROR   ghc/types> Scope leaves with exception: Pattern match failure in do expression at src/HsDev/Tools/Ghc/Types.hs:69:9-11
21/01/17 20:44:54 -0800 ERROR   ghc> Scope leaves with exception: Pattern match failure in do expression at src/HsDev/Tools/Ghc/Types.hs:69:9-11
21/01/17 20:44:54 -0800 TRACE   3>  << {"error":"ghc error","msg":"Pattern match failure in do expression at src/HsDev/Tools/Ghc/Types.hs:6...

Add to Stackage

It seems that hsdev is not part of stackage. Is there a good reason why it's not?

analyzeCabal doesn't default src dirs to '.' as per cabal spec/doc

Raw patch because my git client is acting up on me and I've already blown enough time figuring out the problem.

--- a/src/HsDev/Project.hs
+++ b/src/HsDev/Project.hs
@@ -236,7 +236,10 @@ analyzeCabal source = case liftM flattenDescr $ parsePackageDescription source o
            _infoDepends = map pkgName (PD.targetBuildDepends info),
            _infoLanguage = PD.defaultLanguage info,
            _infoExtensions = PD.defaultExtensions info,
-           _infoSourceDirs = PD.hsSourceDirs info }
+           _infoSourceDirs = case PD.hsSourceDirs info of
+                               [] -> ["."]
+                               x  -> x
+           }

        pkgName :: P.Dependency -> String
        pkgName (P.Dependency (P.PackageName s) _) = s

Without this default pkgs which don't specify source-dirs won't have their files added to the DB on scan.

Build failure

Hi,
When I want to install hsdev I get following build error:
Building hsdev-0.1.0.0...
Failed to install hsdev-0.1.0.0
Last 10 lines of the build log ( /home/rik/.cabal/logs/hsdev-0.1.0.0.log ):
‘GhcMod.listFlags’ (imported from Language.Haskell.GhcMod)

src/HsDev/Tools/GhcMod.hs:45:24: Not in scope: ‘GhcMod.browse’

src/HsDev/Tools/GhcMod.hs:45:133:
‘GhcMod.packageId’ is not a (visible) constructor field name

src/HsDev/Tools/GhcMod.hs:73:24: Not in scope: ‘GhcMod.info’

src/HsDev/Tools/GhcMod.hs:115:37: Not in scope: ‘GhcMod.typeOf’
cabal: Error: some packages failed to install:
hsdev-0.1.0.0 failed during the building phase. The exception was:
ExitFailure 1

When I check out latest version of hsdev and build in sandbox, I get same errors.

Failure seems to be related with latest version of ghc-mod.

Regards,
Rik

hsdev ignores cabal-file extensions

Within project.cabal I list out my language extensions that are common across files:
library
hs-source-dirs: src
extensions: RankNTypes

Over in my source code I use a forall:
foo :: forall a . (...) => ...

And hsdev warns:
Sublime Haskell: hsdev types returns error: ghc error, msg: Illegal symbol '.' in type
Perhaps you intended to use RankNTypes or a similar language
extension to enable explicit-forall syntax: forall .
, id: 4

It seems like hsdev is not using the cabal-file language extensions.

stack not being called correctly

i think this line is wrong
https://github.com/mvoidex/hsdev/blob/master/src/HsDev/Stack.hs#L67
liftIO $ readProcess stackExe (cmd' ++ ["--compiler", comp, "--arch", stackArch]) ""

stack wants it's parameters before the main command
for example this works
/bin/stack --stack-yaml ./stack.yaml --compiler "ghc-7.10.3" --arch x86_64 path

this doesn't
/bin/stack path --stack-yaml ./stack.yaml --compiler "ghc-7.10.3" --arch x86_64 and fails with

and fails with

Invalid argument `ghc-7.10.3'
Auxiliary command not found in path `stack-path'
File does not exist or is not a regular file `path'

this manifests itself here

hsdev scan --path=./
{"notify":[{"status":"working","progress":null,"name":"/Users/username/projectdir","task":"scanning","type":"path"}]}
{"notify":[{"status":{"error":"io error","msg":"readCreateProcess: /bin/stack \"path\" \"--stack-yaml\" \"/Users/username/projectdir/stack.yaml\" \"--compiler\" \"ghc-7.10.3\" \"--arch\" \"x86_64\" (exit 1): failed"},"progress":null,"name":"/Users/username/projectdir","task":"scanning","type":"path"}]}
[]

Am i missing something and this actually works for someone?
I am trying to get this working with sublime.
Do you want a PR for this (though it's trivial) and once it's merged, any pointers on how to have this new version working/installed (i am spoiled and only used stack when working with haskell)?
Thank you.

PS: also, before this, hsdev did not find stack in /usr/local/bin/stack but after i added a symlink to /usr/bin/stack it worked

hsdev check failed

$ hsdev check --file test.hs --pretty
{
"error": "Could not find module ‘Prelude’\nIt is a member of the hidden package ‘base-4.8.2.0’.\nUse -v to see a list of the files searched for.\n",
"details": {}
}

I've installed haskell platform for osx and hsdev-0.1.7.3, (ghc 7.10.3)

Not sure how to fix that, please help.

Build failure

Building hsdev-0.1.4.0...
Preprocessing library hsdev-0.1.4.0...
[34 of 50] Compiling HsDev.Tools.HDocs ( src/HsDev/Tools/HDocs.hs, dist/build/HsDev/Tools/HDocs.o )

src/HsDev/Tools/HDocs.hs:22:54:
    Module ‘HDocs.Haddock’ does not export ‘readSources_’

Version of hdocs is 0.4.2.1

Compilation errors (hsdev-0.1.5.1)

[27 of 55] Compiling HsDev.Inspect ( src/HsDev/Inspect.hs, dist/build/HsDev/Inspect.o )

src/HsDev/Inspect.hs:112:13:
Constructor ‘H.EVar’ should have 2 arguments, but has been given 1
In the pattern: H.EVar n
In an equation for ‘getExports’:
getExports (H.EVar n)
= [uncurry ExportName (identOfQName n) ExportNothing]

src/HsDev/Inspect.hs:213:55:
Couldn't match type ‘H.Binds’ with ‘Maybe H.Binds’
Expected type: H.Match -> Maybe H.Binds
Actual type: H.Match -> H.Binds
In the second argument of ‘(.)’, namely ‘matchBinds’
In the first argument of ‘concatMap’, namely
‘(getBinds . matchBinds)’

src/HsDev/Inspect.hs:215:121:
Couldn't match expected type ‘Maybe H.Binds’
with actual type ‘H.Binds’
In the first argument of ‘getBinds’, namely ‘binds’
In the second argument of ‘Function’, namely ‘(getBinds binds)’

hsdev check: Could not find module

I am trying to use hsdev 0.2.1.0 with a stack project. Everything works fine with stack/cabal. But it seems like hsdev is not picking up the packages mentioned in build-depends in my .cabal file - it always only searches base, and in this case I am using a monad transformer from mtl, and other packages. Perhaps I am missing something? hsdev scan -p . does seem to pick up the projects and some package indices.

Clarify stack support

In order to support stack projects correctly, hsdev and stack executables must be build with same compiler

Please clarify the phrasing. It seems non-trivial to find out what compiler version stack was built with. But that is not what is meant, or is it?

(also, "build"->"built")

silly question: I've troubles solving package dependecies

Hi..sorry but I've a silly question, I can't resolve these dependencies, I'm a bit newbie with haskell and I suppose than this is the "cabal hell"

the dependencies are these
MonadCatchIO-transformers >=0.3.0,
aeson >=0.7.0,
aeson-pretty >=0.7.0,
attoparsec >=0.11.0,
base >=4.7 && <5,
ghc >=7.8.1,
ghc-paths >=0.1.0,
haddock >=2.14.0,
hdocs >=0.4.0,
monad-loops >=0.4.0,
process >=1.2.0,
regexpr >=0.5.0,
text >=1.1.0,
unix >=2.7.0

what is the best way of resolve these packages , any trick or suggestion ??..thanks!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.