nwolverson / purescript-language-server

MIT License
189 stars 42 forks source link

Unknown namespace 'kind' with PureScript 0.14 #124

Closed thomashoneyman closed 3 years ago

thomashoneyman commented 3 years ago

Hi @nwolverson! I noticed while testing earlier today that the language server works just fine with PureScript 0.14, except for the auto-completion. Specifically, when I type an identifier (like liftEffe), the completion menu opens but has no options and I see the following error in the VSCode plugin output:

[Error - 4:25:08 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Parsing the command failed with:
Error in $.filters[1].namespaces[0]: Unknown namespace: "kind"
Here's the entire error ``` [Error - 4:50:17 PM] Request textDocument/completion failed. Message: Request textDocument/completion failed with message: Parsing the command failed with: Error in $.filters[1].namespaces[0]: Unknown namespace: "kind" Command: {"params":{"options":{"groupReexports":true,"maxResults":null},"currentModule":"Main","matcher":null,"filters":[{"params":{"search":"launchAff"},"filter":"prefix"},{"params":{"namespaces":["kind"]},"filter":"namespace"},{"params":{"modules":["Prim","Prim","Prim.Boolean","Prim.Ordering","Prim.Row","Prim.RowList","Prim.Symbol","Prim.TypeError","Control.Alt","Control.Alternative","Control.Applicative","Control.Apply","Control.Biapplicative","Control.Biapply","Control.Bind","Control.Category","Control.Comonad","Control.Comonad.Env","Control.Comonad.Env.Class","Control.Comonad.Env.Trans","Control.Comonad.Store","Control.Comonad.Store.Class","Control.Comonad.Store.Trans","Control.Comonad.Traced","Control.Comonad.Traced.Class","Control.Comonad.Traced.Trans","Control.Comonad.Trans.Class","Control.Extend","Control.Lazy","Control.Monad","Control.Monad.Cont","Control.Monad.Cont.Class","Control.Monad.Cont.Trans","Control.Monad.Error.Class","Control.Monad.Except","Control.Monad.Except.Trans","Control.Monad.Gen","Control.Monad.Gen.Class","Control.Monad.Gen.Common","Control.Monad.Identity.Trans","Control.Monad.List.Trans","Control.Monad.Maybe.Trans","Control.Monad.RWS","Control.Monad.RWS.Trans","Control.Monad.Reader","Control.Monad.Reader.Class","Control.Monad.Reader.Trans","Control.Monad.Rec.Class","Control.Monad.ST","Control.Monad.ST.Class","Control.Monad.ST.Global","Control.Monad.ST.Internal","Control.Monad.ST.Ref","Control.Monad.State","Control.Monad.State.Class","Control.Monad.State.Trans","Control.Monad.Trans.Class","Control.Monad.Writer","Control.Monad.Writer.Class","Control.Monad.Writer.Trans","Control.MonadPlus","Control.MonadZero","Control.Parallel","Control.Parallel.Class","Control.Plus","Control.Semigroupoid","Data.Array","Data.Array.NonEmpty","Data.Array.NonEmpty.Internal","Data.Array.Partial","Data.Array.ST","Data.Array.ST.Iterator","Data.Array.ST.Partial","Data.ArrayBuffer.Types","Data.Bifoldable","Data.Bifunctor","Data.Bifunctor.Join","Data.Bitraversable","Data.Boolean","Data.BooleanAlgebra","Data.Bounded","Data.Bounded.Generic","Data.Char","Data.Char.Gen","Data.CommutativeRing","Data.Comparison","Data.Const","Data.Date","Data.Date.Component","Data.Date.Component.Gen","Data.Date.Gen","Data.DateTime","Data.DateTime.Gen","Data.DateTime.Instant","Data.Decidable","Data.Decide","Data.Distributive","Data.Divide","Data.Divisible","Data.DivisionRing","Data.Either","Data.Either.Inject","Data.Either.Nested","Data.Enum","Data.Enum.Gen","Data.Enum.Generic","Data.Eq","Data.Eq.Generic","Data.Equivalence","Data.EuclideanRing","Data.Exists","Data.Field","Data.Foldable","Data.FoldableWithIndex","Data.Function","Data.Function.Uncurried","Data.Functor","Data.Functor.App","Data.Functor.Clown","Data.Functor.Compose","Data.Functor.Contravariant","Data.Functor.Coproduct","Data.Functor.Coproduct.Inject","Data.Functor.Coproduct.Nested","Data.Functor.Costar","Data.Functor.Flip","Data.Functor.Invariant","Data.Functor.Joker","Data.Functor.Product","Data.Functor.Product.Nested","Data.Functor.Product2","Data.FunctorWithIndex","Data.Generic.Rep","Data.HeytingAlgebra","Data.HeytingAlgebra.Generic","Data.Identity","Data.Int","Data.Int.Bits","Data.Interval","Data.Interval.Duration","Data.Interval.Duration.Iso","Data.JSDate","Data.Lazy","Data.List","Data.List.Internal","Data.List.Lazy","Data.List.Lazy.NonEmpty","Data.List.Lazy.Types","Data.List.NonEmpty","Data.List.Partial","Data.List.Types","Data.List.ZipList","Data.Map","Data.Map.Gen","Data.Map.Internal","Data.Maybe","Data.Maybe.First","Data.Maybe.Last","Data.Monoid","Data.Monoid.Additive","Data.Monoid.Alternate","Data.Monoid.Conj","Data.Monoid.Disj","Data.Monoid.Dual","Data.Monoid.Endo","Data.Monoid.Generic","Data.Monoid.Multiplicative","Data.NaturalTransformation","Data.Newtype","Data.NonEmpty","Data.Nullable","Data.Number","Data.Number.Approximate","Data.Number.Format","Data.Op","Data.Ord","Data.Ord.Down","Data.Ord.Generic","Data.Ord.Max","Data.Ord.Min","Data.Ordering","Data.Posix","Data.Posix.Signal","Data.Predicate","Data.Profunctor","Data.Profunctor.Choice","Data.Profunctor.Closed","Data.Profunctor.Cochoice","Data.Profunctor.Costrong","Data.Profunctor.Join","Data.Profunctor.Split","Data.Profunctor.Star","Data.Profunctor.Strong","Data.Ring","Data.Ring.Generic","Data.Semigroup","Data.Semigroup.First","Data.Semigroup.Foldable","Data.Semigroup.Generic","Data.Semigroup.Last","Data.Semigroup.Traversable","Data.Semiring","Data.Semiring.Generic","Data.Set","Data.Set.NonEmpty","Data.Show","Data.Show.Generic","Data.String","Data.String.CaseInsensitive","Data.String.CodePoints","Data.String.CodeUnits","Data.String.Common","Data.String.Gen","Data.String.NonEmpty","Data.String.NonEmpty.CaseInsensitive","Data.String.NonEmpty.CodePoints","Data.String.NonEmpty.CodeUnits","Data.String.NonEmpty.Internal","Data.String.Pattern","Data.String.Regex","Data.String.Regex.Flags","Data.String.Regex.Unsafe","Data.String.Unsafe","Data.Symbol","Data.Time","Data.Time.Component","Data.Time.Component.Gen","Data.Time.Duration","Data.Time.Duration.Gen","Data.Time.Gen","Data.Traversable","Data.Traversable.Accum","Data.Traversable.Accum.Internal","Data.TraversableWithIndex","Data.Tuple","Data.Tuple.Nested","Data.Unfoldable","Data.Unfoldable1","Data.Unit","Data.Void","Effect","Effect.Aff","Effect.Aff.Class","Effect.Aff.Compat","Effect.Class","Effect.Class.Console","Effect.Console","Effect.Exception","Effect.Exception.Unsafe","Effect.Now","Effect.Ref","Effect.Uncurried","Effect.Unsafe","Foreign","Foreign.Index","Foreign.Keys","Foreign.Object","Foreign.Object.Gen","Foreign.Object.ST","Foreign.Object.ST.Unsafe","Foreign.Object.Unsafe","Main","Math","Node.Buffer","Node.Buffer.Class","Node.Buffer.Immutable","Node.Buffer.Internal","Node.Buffer.ST","Node.Buffer.Types","Node.ChildProcess","Node.Encoding","Node.FS","Node.FS.Aff","Node.FS.Async","Node.FS.Internal","Node.FS.Perms","Node.FS.Stats","Node.FS.Stream","Node.FS.Sync","Node.Globals","Node.Path","Node.Platform","Node.Process","Node.Stream","PSCI.Support","Partial","Partial.Unsafe","Prelude","Record.Unsafe","Safe.Coerce","Test.Main","Text.Parsing.StringParser","Text.Parsing.StringParser.CodePoints","Text.Parsing.StringParser.CodeUnits","Text.Parsing.StringParser.Combinators","Text.Parsing.StringParser.Expr","Type.Data.Boolean","Type.Data.Ordering","Type.Data.Row","Type.Data.RowList","Type.Data.Symbol","Type.Equality","Type.Function","Type.Prelude","Type.Proxy","Type.Row","Type.Row.Homogeneous","Type.RowList","Unsafe.Coerce"]},"filter":"modules"}]},"command":"complete"} Code: -32603 ```

Is the IDE asking the compiler for any kinds that match a query? IIRC there is no 'kind' namespace in the compiler as of 0.14; now there are just types.

thomashoneyman commented 3 years ago

It does look like the completion code tries to use a 'kind' namespace, reusing the Namespace type from psc-ide:

https://github.com/kritzcreek/purescript-psc-ide/blob/c813caa4aec6beef9677b4e68b8bc724f3b4c308/src/PscIde/Command.purs#L102

I'm not exactly sure what should be done so that the language server / IDE supports both pre-0.14 and 0.14 projects. But I wanted to bring this to the attention of you and @kritzcreek.

thomashoneyman commented 3 years ago

It looks like this may be fixed by #118.

nwolverson commented 3 years ago

Couple of minor things to address before preparing a release but #118 which was just merged should indeed resolve this issue

thomashoneyman commented 3 years ago

Resolved in 0.15 according to local tests. Thanks!

nwolverson commented 3 years ago

Thanks, good to hear