eagletmt / neco-ghc

A completion plugin for Haskell, using ghc-mod
http://www.vim.org/scripts/script.php?script_id=3423
359 stars 32 forks source link

Completion only works if ghc-mod is installed into the sandbox. #26

Closed seanparsons closed 10 years ago

seanparsons commented 10 years ago

I've found others recommending installing ghc-mod into the sandbox and when I did that previously it worked. However I'm trying to have a clean build set up where all the command line tools are in ~/.cabal/bin and no other dependencies are installed.

This seems to result in the code completion just showing me things that are already present inside the file, which seems wrong full stop.

eagletmt commented 10 years ago
seanparsons commented 10 years ago

For reference these two files make up my .vimrc: https://github.com/seanparsons/dotfiles/blob/master/vimrc-stage1 https://github.com/seanparsons/dotfiles/blob/master/vimrc-stage2

eagletmt commented 10 years ago

I've added a diagnostics command. Please checkout the latest revision https://github.com/eagletmt/neco-ghc/commit/37434dfc33a47a2d21518fbfa24ad43a7f6806e0. Then please execute :NecoGhcDiagnostics in the buffer opening a Haskell file which you have trouble with and show me the output.

seanparsons commented 10 years ago

Current filetype: haskell ghc-mod is executable: 1 omnifunc: neocomplete.vim: 2 neocomplcache.vim: 0 YouCompleteMe: 0 vimproc.vim: 701 ghc-mod: 3.1.6 Imported modules: Prelude Number of symbols in Prelude: 0

eagletmt commented 10 years ago

Thanks. The ghc-mod browse command outputs nothing or weird result.

Could you run ghc-mod list and ghc-mod browse Prelude in the directory where the Haskell file exists?

seanparsons commented 10 years ago
sean@Tower:~/workspace/gseitz-argonaut/src/Data$ ghc-mod list
Blaze.ByteString.Builder
Blaze.ByteString.Builder.ByteString
Blaze.ByteString.Builder.Char.Utf8
Blaze.ByteString.Builder.Char8
Blaze.ByteString.Builder.HTTP
Blaze.ByteString.Builder.Html.Utf8
Blaze.ByteString.Builder.Int
Blaze.ByteString.Builder.Internal
Blaze.ByteString.Builder.Internal.Buffer
Blaze.ByteString.Builder.Internal.Types
Blaze.ByteString.Builder.Internal.Write
Blaze.ByteString.Builder.Word
Codec.Binary.UTF8.Generic
Codec.Binary.UTF8.String
Codec.Compression.GZip
Codec.Compression.Zlib
Codec.Compression.Zlib.Internal
Codec.Compression.Zlib.Lens
Codec.Compression.Zlib.Raw
Compiler.Hoopl
Compiler.Hoopl.Internals
Compiler.Hoopl.Passes.DList
Compiler.Hoopl.Passes.Dominator
Compiler.Hoopl.Wrappers
Control.Applicative
Control.Applicative.Backwards
Control.Applicative.Lift
Control.Arrow
Control.Category
Control.Comonad
Control.Comonad.Env
Control.Comonad.Env.Class
Control.Comonad.Hoist.Class
Control.Comonad.Identity
Control.Comonad.Store
Control.Comonad.Store.Class
Control.Comonad.Traced
Control.Comonad.Traced.Class
Control.Comonad.Trans.Class
Control.Comonad.Trans.Env
Control.Comonad.Trans.Identity
Control.Comonad.Trans.Store
Control.Comonad.Trans.Traced
Control.Concurrent
Control.Concurrent.Chan
Control.Concurrent.MVar
Control.Concurrent.QSem
Control.Concurrent.QSemN
Control.Concurrent.SampleVar
Control.DeepSeq
Control.Exception
Control.Exception.Base
Control.Exception.Lens
Control.Lens
Control.Lens.Action
Control.Lens.At
Control.Lens.Combinators
Control.Lens.Cons
Control.Lens.Each
Control.Lens.Empty
Control.Lens.Equality
Control.Lens.Extras
Control.Lens.Fold
Control.Lens.Getter
Control.Lens.Indexed
Control.Lens.Internal
Control.Lens.Internal.Action
Control.Lens.Internal.Bazaar
Control.Lens.Internal.ByteString
Control.Lens.Internal.Context
Control.Lens.Internal.Deque
Control.Lens.Internal.Exception
Control.Lens.Internal.Fold
Control.Lens.Internal.Getter
Control.Lens.Internal.Indexed
Control.Lens.Internal.Instances
Control.Lens.Internal.Iso
Control.Lens.Internal.Level
Control.Lens.Internal.Magma
Control.Lens.Internal.Prism
Control.Lens.Internal.Reflection
Control.Lens.Internal.Review
Control.Lens.Internal.Setter
Control.Lens.Internal.TH
Control.Lens.Internal.Zoom
Control.Lens.Iso
Control.Lens.Lens
Control.Lens.Level
Control.Lens.Loupe
Control.Lens.Operators
Control.Lens.Plated
Control.Lens.Prism
Control.Lens.Reified
Control.Lens.Review
Control.Lens.Setter
Control.Lens.TH
Control.Lens.Traversal
Control.Lens.Tuple
Control.Lens.Type
Control.Lens.Wrapped
Control.Lens.Zoom
Control.Monad
Control.Monad.Catch
Control.Monad.Catch.Pure
Control.Monad.Cont
Control.Monad.Cont.Class
Control.Monad.Error
Control.Monad.Error.Class
Control.Monad.Error.Lens
Control.Monad.Fix
Control.Monad.IO.Class
Control.Monad.Identity
Control.Monad.Instances
Control.Monad.List
Control.Monad.Par
Control.Monad.Par.AList
Control.Monad.Par.Class
Control.Monad.Par.Combinator
Control.Monad.Par.IO
Control.Monad.Par.RNG
Control.Monad.Par.Scheds.Direct
Control.Monad.Par.Scheds.Sparks
Control.Monad.Par.Scheds.Trace
Control.Monad.Par.Scheds.TraceInternal
Control.Monad.Par.State
Control.Monad.Par.Unsafe
Control.Monad.Primitive
Control.Monad.Primitive.Lens
Control.Monad.RWS
Control.Monad.RWS.Class
Control.Monad.RWS.Lazy
Control.Monad.RWS.Strict
Control.Monad.Reader
Control.Monad.Reader.Class
Control.Monad.ST
Control.Monad.ST.Lazy
Control.Monad.ST.Lazy.Safe
Control.Monad.ST.Lazy.Unsafe
Control.Monad.ST.Safe
Control.Monad.ST.Strict
Control.Monad.ST.Unsafe
Control.Monad.State
Control.Monad.State.Class
Control.Monad.State.Lazy
Control.Monad.State.Strict
Control.Monad.Trans
Control.Monad.Trans.Class
Control.Monad.Trans.Cont
Control.Monad.Trans.Error
Control.Monad.Trans.Identity
Control.Monad.Trans.List
Control.Monad.Trans.Maybe
Control.Monad.Trans.RWS
Control.Monad.Trans.RWS.Lazy
Control.Monad.Trans.RWS.Strict
Control.Monad.Trans.Reader
Control.Monad.Trans.State
Control.Monad.Trans.State.Lazy
Control.Monad.Trans.State.Strict
Control.Monad.Trans.Writer
Control.Monad.Trans.Writer.Lazy
Control.Monad.Trans.Writer.Strict
Control.Monad.Writer
Control.Monad.Writer.Class
Control.Monad.Writer.Lazy
Control.Monad.Writer.Strict
Control.Monad.Zip
Control.Newtype
Control.Parallel
Control.Parallel.Strategies
Control.Parallel.Strategies.Lens
Control.Seq
Control.Seq.Lens
Criterion
Criterion.Analysis
Criterion.Analysis.Types
Criterion.Config
Criterion.Environment
Criterion.IO
Criterion.IO.Printf
Criterion.Main
Criterion.Measurement
Criterion.Monad
Criterion.Report
Criterion.Types
Data.AEq
Data.Aeson
Data.Aeson.Encode
Data.Aeson.Generic
Data.Aeson.Lens
Data.Aeson.Parser
Data.Aeson.TH
Data.Aeson.Types
Data.Array
Data.Array.Base
Data.Array.IArray
Data.Array.IO
Data.Array.IO.Internals
Data.Array.IO.Safe
Data.Array.Lens
Data.Array.MArray
Data.Array.MArray.Safe
Data.Array.ST
Data.Array.ST.Safe
Data.Array.Storable
Data.Array.Storable.Internals
Data.Array.Storable.Safe
Data.Array.Unboxed
Data.Array.Unsafe
Data.Attoparsec
Data.Attoparsec.ByteString
Data.Attoparsec.ByteString.Char8
Data.Attoparsec.ByteString.Lazy
Data.Attoparsec.Char8
Data.Attoparsec.Combinator
Data.Attoparsec.Lazy
Data.Attoparsec.Number
Data.Attoparsec.Text
Data.Attoparsec.Text.Lazy
Data.Attoparsec.Types
Data.Attoparsec.Zepto
Data.Biapplicative
Data.Bifoldable
Data.Bifunctor
Data.Bifunctor.Apply
Data.Bifunctor.Clown
Data.Bifunctor.Flip
Data.Bifunctor.Join
Data.Bifunctor.Joker
Data.Bifunctor.Product
Data.Bifunctor.Wrapped
Data.Binary
Data.Binary.Builder
Data.Binary.Builder.Internal
Data.Binary.Get
Data.Binary.Get.Internal
Data.Binary.Put
Data.Bitraversable
Data.Bits
Data.Bits.Lens
Data.Bool
Data.ByteString
Data.ByteString.Builder
Data.ByteString.Builder.Extra
Data.ByteString.Builder.Internal
Data.ByteString.Builder.Prim
Data.ByteString.Builder.Prim.Internal
Data.ByteString.Char8
Data.ByteString.Internal
Data.ByteString.Lazy
Data.ByteString.Lazy.Builder
Data.ByteString.Lazy.Builder.ASCII
Data.ByteString.Lazy.Builder.Extras
Data.ByteString.Lazy.Char8
Data.ByteString.Lazy.Internal
Data.ByteString.Lazy.Lens
Data.ByteString.Lazy.UTF8
Data.ByteString.Lens
Data.ByteString.Short
Data.ByteString.Short.Internal
Data.ByteString.Strict.Lens
Data.ByteString.UTF8
Data.ByteString.Unsafe
Data.Char
Data.Complex
Data.Complex.Lens
Data.Concurrent.Deque.Class
Data.Concurrent.Deque.Debugger
Data.Concurrent.Deque.Reference
Data.Concurrent.Deque.Reference.DequeInstance
Data.Constraint
Data.Constraint.Forall
Data.Constraint.Unsafe
Data.DList
Data.Data
Data.Data.Lens
Data.Distributive
Data.Dynamic
Data.Dynamic.Lens
Data.Either
Data.Eq
Data.Fixed
Data.Foldable
Data.Function
Data.Functor
Data.Functor.Alt
Data.Functor.Apply
Data.Functor.Bind
Data.Functor.Bind.Trans
Data.Functor.Compose
Data.Functor.Composition
Data.Functor.Constant
Data.Functor.Contravariant
Data.Functor.Contravariant.Compose
Data.Functor.Contravariant.Day
Data.Functor.Coproduct
Data.Functor.Extend
Data.Functor.Identity
Data.Functor.Plus
Data.Functor.Product
Data.Functor.Reverse
Data.Generics
Data.Generics.Aliases
Data.Generics.Basics
Data.Generics.Builders
Data.Generics.Instances
Data.Generics.Schemes
Data.Generics.Text
Data.Generics.Twins
Data.Graph
Data.Groupoid
Data.HashMap.Lazy
Data.HashMap.Strict
Data.HashSet
Data.HashSet.Lens
Data.HashTable
Data.Hashable
Data.IORef
Data.Int
Data.IntMap
Data.IntMap.Lazy
Data.IntMap.Strict
Data.IntSet
Data.IntSet.Lens
Data.Isomorphism
Data.Ix
Data.List
Data.List.Lens
Data.List.NonEmpty
Data.List.Split
Data.List.Split.Internals
Data.List.Split.Lens
Data.Map
Data.Map.Lazy
Data.Map.Lens
Data.Map.Strict
Data.Maybe
Data.Monoid
Data.Number.Erf
Data.Ord
Data.Primitive
Data.Primitive.Addr
Data.Primitive.Array
Data.Primitive.ByteArray
Data.Primitive.MachDeps
Data.Primitive.MutVar
Data.Primitive.Types
Data.Profunctor
Data.Profunctor.Collage
Data.Profunctor.Composition
Data.Profunctor.Rep
Data.Profunctor.Rift
Data.Profunctor.Trace
Data.Profunctor.Unsafe
Data.Proxy
Data.Ratio
Data.Reflection
Data.STRef
Data.STRef.Lazy
Data.STRef.Strict
Data.Scientific
Data.Semifunctor
Data.Semifunctor.Associative
Data.Semifunctor.Braided
Data.Semigroup
Data.Semigroup.Bifoldable
Data.Semigroup.Bitraversable
Data.Semigroup.Foldable
Data.Semigroup.Traversable
Data.Semigroupoid
Data.Semigroupoid.Coproduct
Data.Semigroupoid.Dual
Data.Semigroupoid.Ob
Data.Semigroupoid.Product
Data.Semigroupoid.Static
Data.Sequence
Data.Sequence.Lens
Data.Serialize
Data.Serialize.Builder
Data.Serialize.Get
Data.Serialize.IEEE754
Data.Serialize.Put
Data.Set
Data.Set.Lens
Data.String
Data.String.UTF8
Data.Tagged
Data.Text
Data.Text.Array
Data.Text.Encoding
Data.Text.Encoding.Error
Data.Text.Foreign
Data.Text.IO
Data.Text.Internal
Data.Text.Internal.Builder
Data.Text.Internal.Builder.Functions
Data.Text.Internal.Builder.Int.Digits
Data.Text.Internal.Builder.RealFloat.Functions
Data.Text.Internal.Encoding.Fusion
Data.Text.Internal.Encoding.Fusion.Common
Data.Text.Internal.Encoding.Utf16
Data.Text.Internal.Encoding.Utf32
Data.Text.Internal.Encoding.Utf8
Data.Text.Internal.Functions
Data.Text.Internal.Fusion
Data.Text.Internal.Fusion.CaseMapping
Data.Text.Internal.Fusion.Common
Data.Text.Internal.Fusion.Size
Data.Text.Internal.Fusion.Types
Data.Text.Internal.IO
Data.Text.Internal.Lazy
Data.Text.Internal.Lazy.Encoding.Fusion
Data.Text.Internal.Lazy.Fusion
Data.Text.Internal.Lazy.Search
Data.Text.Internal.Private
Data.Text.Internal.Search
Data.Text.Internal.Unsafe
Data.Text.Internal.Unsafe.Char
Data.Text.Internal.Unsafe.Shift
Data.Text.Lazy
Data.Text.Lazy.Builder
Data.Text.Lazy.Builder.Int
Data.Text.Lazy.Builder.RealFloat
Data.Text.Lazy.Encoding
Data.Text.Lazy.IO
Data.Text.Lazy.Internal
Data.Text.Lazy.Lens
Data.Text.Lazy.Read
Data.Text.Lens
Data.Text.Read
Data.Text.Strict.Lens
Data.Text.Unsafe
Data.Time
Data.Time.Calendar
Data.Time.Calendar.Easter
Data.Time.Calendar.Julian
Data.Time.Calendar.MonthDay
Data.Time.Calendar.OrdinalDate
Data.Time.Calendar.WeekDate
Data.Time.Clock
Data.Time.Clock.POSIX
Data.Time.Clock.TAI
Data.Time.Format
Data.Time.LocalTime
Data.Traversable
Data.Traversable.Instances
Data.Tree
Data.Tree.Lens
Data.Tuple
Data.Typeable
Data.Typeable.Internal
Data.Typeable.Lens
Data.Unique
Data.Vector
Data.Vector.Algorithms.AmericanFlag
Data.Vector.Algorithms.Heap
Data.Vector.Algorithms.Insertion
Data.Vector.Algorithms.Intro
Data.Vector.Algorithms.Merge
Data.Vector.Algorithms.Optimal
Data.Vector.Algorithms.Radix
Data.Vector.Algorithms.Search
Data.Vector.Binary
Data.Vector.Cereal
Data.Vector.Fusion.Stream
Data.Vector.Fusion.Stream.Monadic
Data.Vector.Fusion.Stream.Size
Data.Vector.Fusion.Util
Data.Vector.Generic
Data.Vector.Generic.Base
Data.Vector.Generic.Lens
Data.Vector.Generic.Mutable
Data.Vector.Generic.New
Data.Vector.Internal.Check
Data.Vector.Lens
Data.Vector.Mutable
Data.Vector.Primitive
Data.Vector.Primitive.Mutable
Data.Vector.Storable
Data.Vector.Storable.Internal
Data.Vector.Storable.Mutable
Data.Vector.Unboxed
Data.Vector.Unboxed.Base
Data.Vector.Unboxed.Mutable
Data.Version
Data.Void
Data.Void.Unsafe
Data.Word
Debug.Trace
Foreign
Foreign.C
Foreign.C.Error
Foreign.C.String
Foreign.C.Types
Foreign.Concurrent
Foreign.ForeignPtr
Foreign.ForeignPtr.Safe
Foreign.ForeignPtr.Unsafe
Foreign.Marshal
Foreign.Marshal.Alloc
Foreign.Marshal.Array
Foreign.Marshal.Error
Foreign.Marshal.Pool
Foreign.Marshal.Safe
Foreign.Marshal.Unsafe
Foreign.Marshal.Utils
Foreign.Ptr
Foreign.Safe
Foreign.StablePtr
Foreign.Storable
GHC.Arr
GHC.Base
GHC.CString
GHC.Char
GHC.Classes
GHC.Conc
GHC.Conc.IO
GHC.Conc.Signal
GHC.Conc.Sync
GHC.ConsoleHandler
GHC.Constants
GHC.Debug
GHC.Desugar
GHC.Enum
GHC.Environment
GHC.Err
GHC.Event
GHC.Exception
GHC.Exts
GHC.Fingerprint
GHC.Fingerprint.Type
GHC.Float
GHC.Float.ConversionUtils
GHC.Float.RealFracMethods
GHC.Foreign
GHC.ForeignPtr
GHC.GHCi
GHC.Generics
GHC.Generics.Lens
GHC.Handle
GHC.IO
GHC.IO.Buffer
GHC.IO.BufferedIO
GHC.IO.Device
GHC.IO.Encoding
GHC.IO.Encoding.CodePage
GHC.IO.Encoding.Failure
GHC.IO.Encoding.Iconv
GHC.IO.Encoding.Latin1
GHC.IO.Encoding.Types
GHC.IO.Encoding.UTF16
GHC.IO.Encoding.UTF32
GHC.IO.Encoding.UTF8
GHC.IO.Exception
GHC.IO.FD
GHC.IO.Handle
GHC.IO.Handle.FD
GHC.IO.Handle.Internals
GHC.IO.Handle.Text
GHC.IO.Handle.Types
GHC.IO.IOMode
GHC.IOArray
GHC.IOBase
GHC.IORef
GHC.IP
GHC.Int
GHC.IntWord64
GHC.Integer
GHC.Integer.GMP.Internals
GHC.Integer.GMP.Prim
GHC.Integer.Logarithms
GHC.Integer.Logarithms.Internals
GHC.List
GHC.MVar
GHC.Magic
GHC.Num
GHC.PArr
GHC.Pack
GHC.Prim
GHC.PrimopWrappers
GHC.Ptr
GHC.Read
GHC.Real
GHC.ST
GHC.STRef
GHC.Show
GHC.Stable
GHC.Stack
GHC.Stats
GHC.Storable
GHC.TopHandler
GHC.Tuple
GHC.TypeLits
GHC.Types
GHC.Unicode
GHC.Weak
GHC.Word
Generics.Deriving.Lens
Generics.SYB
Generics.SYB.Aliases
Generics.SYB.Basics
Generics.SYB.Builders
Generics.SYB.Instances
Generics.SYB.Schemes
Generics.SYB.Text
Generics.SYB.Twins
Language.Haskell.TH
Language.Haskell.TH.Lens
Language.Haskell.TH.Lib
Language.Haskell.TH.Ppr
Language.Haskell.TH.PprLib
Language.Haskell.TH.Quote
Language.Haskell.TH.Syntax
Numeric
Numeric.IEEE
Numeric.Lens
Numeric.MathFunctions.Constants
Numeric.Natural
Numeric.Natural.Internal
Numeric.Polynomial
Numeric.Polynomial.Chebyshev
Numeric.SpecFunctions
Numeric.SpecFunctions.Extra
Prelude
Statistics.Autocorrelation
Statistics.Constants
Statistics.Distribution
Statistics.Distribution.Beta
Statistics.Distribution.Binomial
Statistics.Distribution.CauchyLorentz
Statistics.Distribution.ChiSquared
Statistics.Distribution.Exponential
Statistics.Distribution.FDistribution
Statistics.Distribution.Gamma
Statistics.Distribution.Geometric
Statistics.Distribution.Hypergeometric
Statistics.Distribution.Normal
Statistics.Distribution.Poisson
Statistics.Distribution.StudentT
Statistics.Distribution.Transform
Statistics.Distribution.Uniform
Statistics.Function
Statistics.Math
Statistics.Math.RootFinding
Statistics.Quantile
Statistics.Resampling
Statistics.Resampling.Bootstrap
Statistics.Sample
Statistics.Sample.Histogram
Statistics.Sample.KernelDensity
Statistics.Sample.KernelDensity.Simple
Statistics.Sample.Powers
Statistics.Test.ChiSquared
Statistics.Test.KolmogorovSmirnov
Statistics.Test.MannWhitneyU
Statistics.Test.NonParametric
Statistics.Test.Types
Statistics.Test.WilcoxonT
Statistics.Transform
Statistics.Types
System.CPUTime
System.Console.ANSI
System.Console.GetOpt
System.Directory
System.Environment
System.Environment.UTF8
System.Exit
System.Exit.Lens
System.FilePath
System.FilePath.Glob
System.FilePath.Glob.Primitive
System.FilePath.Lens
System.FilePath.Posix
System.FilePath.Windows
System.IO
System.IO.Error
System.IO.Error.Lens
System.IO.UTF8
System.IO.Unsafe
System.Info
System.Locale
System.Mem
System.Mem.StableName
System.Mem.Weak
System.Posix
System.Posix.ByteString
System.Posix.ByteString.FilePath
System.Posix.Directory
System.Posix.Directory.ByteString
System.Posix.DynamicLinker
System.Posix.DynamicLinker.ByteString
System.Posix.DynamicLinker.Module
System.Posix.DynamicLinker.Module.ByteString
System.Posix.DynamicLinker.Prim
System.Posix.Env
System.Posix.Env.ByteString
System.Posix.Error
System.Posix.Files
System.Posix.Files.ByteString
System.Posix.IO
System.Posix.IO.ByteString
System.Posix.Internals
System.Posix.Process
System.Posix.Process.ByteString
System.Posix.Process.Internals
System.Posix.Resource
System.Posix.Semaphore
System.Posix.SharedMem
System.Posix.Signals
System.Posix.Signals.Exts
System.Posix.Temp
System.Posix.Temp.ByteString
System.Posix.Terminal
System.Posix.Terminal.ByteString
System.Posix.Time
System.Posix.Types
System.Posix.Unistd
System.Posix.User
System.Random
System.Random.MWC
System.Random.MWC.CondensedTable
System.Random.MWC.Distributions
System.SetEnv
System.Time
System.Timeout
Test.HUnit
Test.HUnit.Base
Test.HUnit.Lang
Test.HUnit.Terminal
Test.HUnit.Text
Test.Hspec
Test.Hspec.Core
Test.Hspec.Expectations
Test.Hspec.Expectations.Contrib
Test.Hspec.Formatters
Test.Hspec.HUnit
Test.Hspec.Monadic
Test.Hspec.QuickCheck
Test.Hspec.Runner
Test.QuickCheck
Test.QuickCheck.All
Test.QuickCheck.Arbitrary
Test.QuickCheck.Function
Test.QuickCheck.Gen
Test.QuickCheck.IO
Test.QuickCheck.Modifiers
Test.QuickCheck.Monadic
Test.QuickCheck.Poly
Test.QuickCheck.Property
Test.QuickCheck.State
Test.QuickCheck.Test
Test.QuickCheck.Text
Text.Hastache
Text.Hastache.Context
Text.Parsec
Text.Parsec.ByteString
Text.Parsec.ByteString.Lazy
Text.Parsec.Char
Text.Parsec.Combinator
Text.Parsec.Error
Text.Parsec.Expr
Text.Parsec.Language
Text.Parsec.Perm
Text.Parsec.Pos
Text.Parsec.Prim
Text.Parsec.String
Text.Parsec.Text
Text.Parsec.Text.Lazy
Text.Parsec.Token
Text.ParserCombinators.Parsec
Text.ParserCombinators.Parsec.Char
Text.ParserCombinators.Parsec.Combinator
Text.ParserCombinators.Parsec.Error
Text.ParserCombinators.Parsec.Expr
Text.ParserCombinators.Parsec.Language
Text.ParserCombinators.Parsec.Perm
Text.ParserCombinators.Parsec.Pos
Text.ParserCombinators.Parsec.Prim
Text.ParserCombinators.Parsec.Token
Text.ParserCombinators.ReadP
Text.ParserCombinators.ReadPrec
Text.PrettyPrint
Text.PrettyPrint.HughesPJ
Text.Printf
Text.Read
Text.Read.Lex
Text.Show
Text.Show.Functions
Unsafe.Coerce
sean@Tower:~/workspace/gseitz-argonaut/src/Data$ ghc-mod browse Prelude
Bool
Bounded
Char
Double
EQ
Either
Enum
Eq
False
FilePath
Float
Floating
Fractional
Functor
GT
IO
IOError
Int
Integer
Integral
Just
LT
Left
Maybe
Monad
Nothing
Num
Ord
Ordering
Rational
Read
ReadS
Real
RealFloat
RealFrac
Right
Show
ShowS
String
True
abs
acos
acosh
all
and
any
appendFile
asTypeOf
asin
asinh
atan
atan2
atanh
break
ceiling
compare
concat
concatMap
const
cos
cosh
curry
cycle
decodeFloat
div
divMod
drop
dropWhile
either
elem
encodeFloat
enumFrom
enumFromThen
enumFromThenTo
enumFromTo
error
even
exp
exponent
fail
filter
flip
floatDigits
floatRadix
floatRange
floor
fmap
foldl
foldl1
foldr
foldr1
fromEnum
fromInteger
fromIntegral
fromRational
fst
gcd
getChar
getContents
getLine
head
id
init
interact
ioError
isDenormalized
isIEEE
isInfinite
isNaN
isNegativeZero
iterate
last
lcm
length
lex
lines
log
logBase
lookup
map
mapM
mapM_
max
maxBound
maximum
maybe
min
minBound
minimum
mod
negate
not
notElem
null
odd
or
otherwise
pi
pred
print
product
properFraction
putChar
putStr
putStrLn
quot
quotRem
read
readFile
readIO
readList
readLn
readParen
reads
readsPrec
realToFrac
recip
rem
repeat
replicate
return
reverse
round
scaleFloat
scanl
scanl1
scanr
scanr1
seq
sequence
sequence_
show
showChar
showList
showParen
showString
shows
showsPrec
significand
signum
sin
sinh
snd
span
splitAt
sqrt
subtract
succ
sum
tail
take
takeWhile
tan
tanh
toEnum
toInteger
toRational
truncate
uncurry
undefined
unlines
until
unwords
unzip
unzip3
userError
words
writeFile
zip
zip3
zipWith
zipWith3
seanparsons commented 10 years ago

Is there a sensible way of getting the plugin to log the commands it's sending along with their outputs?

seanparsons commented 10 years ago

Is it these diagnostics values that indicate something is wrong: Imported modules: Prelude Number of symbols in Prelude: 0

I've only just mentally clicked looking at this again that those are an indicator of it being wrong.

seanparsons commented 10 years ago

I fiddled around and found that some calls to ghc-mod were apparently blowing up and the reason for that appears to be this line: https://github.com/eagletmt/neco-ghc/blob/master/autoload/necoghc.vim#L240 Passing "package ghc" to ghc through ghc-mod was completely exploding and I believe because those are system packages and not installed in the sandbox:

sean@Tower:~/workspace/argonaut-hs$ ghc-mod -g -package -g ghc list
Dummy:0:0:Error:<command line>: cannot satisfy -package ghc: 
    ghc-7.6.3-494fae4c96de6ac955b246ac79054c22 is unusable due to missing or recursive dependencies:
      Cabal-1.16.0-c6e09e008cd04cf255c1ce0c59aba905 bin-package-db-0.0.0.0-608dcfc9e5716ba7553bf93044c75fe2 directory-1.2.0.1-91a788fd88acd7f149f0f10f5f1e23f2 hpc-0.6.0.0-07911796ef7d8fbc0029c9b6917791ff process-1.1.0.2-76e05340eb66705981411022731ca84a
    (use -v for more information)

I've tried this locally and it appears to be working so far.

eagletmt commented 10 years ago

Thank you for finding the cause! :bow:

But the root cause is still unclear. Why does it happen? I think your package db is broken. Does ghc-pkg check say any errors? If you're working in a sandbox, does cabal sandbox hc-pkg check say any errors?

The reason why I added -g ghc is the ghc package is hidden by default. When I'm writing codes using GHC API without cabal file, passing -g ghc is needed. Adding -g ghc is supposed to have nothing to do with non- GHC API users.

seanparsons commented 10 years ago

Neither of those commands give me any errors and I would be surprised if my package db is broken just because when experimenting with this my install script nukes everything in my user folder. The only thing that I do which is slightly odd is that I install a few command line tools and then clear out all the libraries using this little snippet: https://github.com/seanparsons/dotfiles/blob/master/install.scala#L135-L141 Which just unregisters them and deletes their folders which is all that cabal-uninstall does IIRC.

eagletmt commented 10 years ago

I couldn't reproduce it... :confused: But I will accept your pull request removing -g ghc. Automatically adding -g ghc would help fewer people.

Btw, It's also unclear why my added diagnostics doesn't report errors. It has a check to see if the output countains 'Dummy:0:0:Error:'.

eagletmt commented 10 years ago

@seanparsons FYI: I remembered that ghc-mod 3.1.6 includes changes about package-id. https://github.com/kazu-yamamoto/ghc-mod/pull/179 If you cannot reproduce the same error with ghc-mod 3.1.5, the error might be related to it.