atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Command browse fails #230

Closed remagpie closed 6 years ago

remagpie commented 6 years ago

Atom: 1.21.2 Electron: 1.6.15 OS: Arch linux ghc-mod: ghc-mod version 5.8.0.0 compiled by GHC 8.0.2 Stack Trace

caps:
{
  "version": [
    5,
    8,
    0,
    0
  ],
  "fileMap": true,
  "quoteArgs": true,
  "optparse": true,
  "typeConstraints": true,
  "browseParents": true,
  "interactiveCaseSplit": true,
  "importedFrom": false,
  "browseMain": false
}
Args:
{
  "command": "browse",
  "dashArgs": [
    "-d",
    "-o",
    "-p"
  ],
  "args": []
}
message:
Command failed: ghc-mod browse -d -o -p --
Missing: MODULE
Usage: ghc-mod browse [-o|--operators] [-d|--detailed] [-p|--parents]
                      [-q|--qualified] MODULE
  List symbols in a module
log:
Hide Stack Trace
Error
    at CP.execFile (/home/kais/.atom/packages/haskell-ghc-mod/lib/util.js:79:36)
    at ChildProcess.exithandler (child_process.js:230:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)

Additional note I don't think it's related, but I've built ghc-mod with -fPIC because of build issue occuring on arch linux.

lierdakil commented 6 years ago

It's nothing major. ghc-mod can't handle browse Main, so Main is filtered out of arguments list. In case argument list ends up empty as a result, this happens. Since there was nothing to browse anyway, it doesn't break anything really, but I guess can be annoying.

Anyway, should be fixed in v2.1.3