packages feed

dhall-lsp-server 1.0.9 → 1.0.10

raw patch · 4 files changed

+38/−29 lines, 4 filesdep ~dhalldep ~megaparsecPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: dhall, megaparsec

API changes (from Hackage documentation)

Files

dhall-lsp-server.cabal view
@@ -1,5 +1,5 @@ name:           dhall-lsp-server-Version:        1.0.9+Version:        1.0.10 cabal-version:  1.12 synopsis:       Language Server Protocol (LSP) server for Dhall homepage:       https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-lsp-server#readme@@ -50,7 +50,7 @@     , containers           >= 0.5.11.0 && < 0.7     , data-default         >= 0.7.1.1  && < 0.8     , directory            >= 1.2.2.0  && < 1.4-    , dhall                >= 1.29.0   && < 1.35+    , dhall                >= 1.35.0   && < 1.36     , dhall-json           >= 1.4      && < 1.8     , filepath             >= 1.4.2    && < 1.5     , haskell-lsp          >= 0.19.0.0 && < 0.23@@ -58,7 +58,7 @@     , hslogger             >= 1.2.10   && < 1.4     , lens                 >= 4.16.1   && < 4.20     , lens-family-core     >= 1.2.2    && < 2.2-    , megaparsec           >= 7.0.2    && < 8.1+    , megaparsec           >= 7.0.2    && < 9.1     , mtl                  >= 2.2.2    && < 2.3     , network-uri          >= 2.6.1.0  && < 2.7     , prettyprinter        >= 1.5.1    && < 1.8
src/Dhall/LSP/Backend/Completion.hs view
@@ -16,6 +16,7 @@ import Dhall.Core     ( Binding (..)     , Expr (..)+    , FunctionBinding (..)     , RecordField (..)     , Var (..)     , normalize@@ -123,7 +124,7 @@      in buildCompletionContext' context' values' e -buildCompletionContext' context values (Lam x _A b) =+buildCompletionContext' context values (Lam (FunctionBinding { functionBindingVariable = x, functionBindingAnnotation = _A}) b) =   let _A' | Right _ <- typeWithA absurd context _A = normalize _A           | otherwise = holeExpr 
src/Dhall/LSP/Backend/Parsing.hs view
@@ -13,11 +13,16 @@  import Control.Applicative     (optional, (<|>)) import Data.Text               (Text)-import Dhall.Core              (Binding (..), Expr (..), Import, Var (..))+import Dhall.Core+    ( Binding (..)+    , Expr (..)+    , Import+    , Var (..)+    , makeFunctionBinding+    ) import Dhall.Parser import Dhall.Parser.Expression-    ( getSourcePos-    , importHash_+    ( importHash_     , importType_     , localOnly     )@@ -57,9 +62,9 @@           whitespace           _ <- optional _in           whitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           tokens <- Megaparsec.takeRest-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           return (Src begin end tokens)  -- | Given an Src of a let expression return the Src containing the type@@ -73,13 +78,13 @@           nonemptyWhitespace           _ <- label           whitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           (tokens, _) <- Megaparsec.match $ optional (do             _ <- _colon             nonemptyWhitespace             _ <- expr             whitespace)-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           _ <- Megaparsec.takeRest           return (Src begin end tokens) @@ -95,9 +100,9 @@           setSourcePos left           _let           nonemptyWhitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           (tokens, _) <- Megaparsec.match label-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           _ <- Megaparsec.takeRest           return (Src begin end tokens) @@ -111,9 +116,9 @@           whitespace           _openParens           whitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           (tokens, _) <- Megaparsec.match label-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           _ <- Megaparsec.takeRest           return (Src begin end tokens) @@ -127,9 +132,9 @@           whitespace           _openParens           whitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           (tokens, _) <- Megaparsec.match label-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           _ <- Megaparsec.takeRest           return (Src begin end tokens) @@ -143,9 +148,9 @@           setSourcePos left           _ <- importType_           whitespace-          begin <- getSourcePos+          begin <- Megaparsec.getSourcePos           (tokens, _) <- Megaparsec.match $ optional importHash_-          end <- getSourcePos+          end <- Megaparsec.getSourcePos           _ <- Megaparsec.takeRest           return (Src begin end tokens) @@ -163,10 +168,10 @@  where   parseImportLink = do     setSourcePos left-    begin <- getSourcePos+    begin <- Megaparsec.getSourcePos     (tokens, _) <-       Megaparsec.match $ (localOnly *> return ()) <|> (httpRaw *> return ())-    end <- getSourcePos+    end <- Megaparsec.getSourcePos     _ <- Megaparsec.takeRest     return (Src begin end tokens) @@ -308,4 +313,4 @@           <|> (do skipManyTill anySingle _arrow; return holeExpr)       whitespace       inner <- parseBinderExpr-      return (Lam name typ inner)+      return (Lam (makeFunctionBinding name typ) inner)
src/Dhall/LSP/Backend/Typing.hs view
@@ -4,6 +4,7 @@ import Dhall.Core     ( Binding (..)     , Expr (..)+    , FunctionBinding (..)     , Var (..)     , normalize     , shift@@ -49,8 +50,9 @@   return (Just $ getLetIdentifier src, typ)  -- "..." in a lambda expression-typeAt' pos _ctx (Note src (Lam _ _A _)) | Just src' <- getLamIdentifier src-                                         , pos `inside` src' =+typeAt' pos _ctx (Note src (Lam FunctionBinding { functionBindingAnnotation = _A} _))+  | Just src' <- getLamIdentifier src+  , pos `inside` src' =   return (Just src', _A)  -- "..." in a forall expression@@ -63,10 +65,11 @@   let a' = shift 1 (V x 0) (normalize a)   typeAt' pos ctx (shift (-1) (V x 0) (subst (V x 0) a' e)) -typeAt' pos ctx (Lam x _A b@(Note src _)) | pos `inside` src = do-  let _A' = Dhall.Core.normalize _A-      ctx' = fmap (shift 1 (V x 0)) (insert x _A' ctx)-  typeAt' pos ctx' b+typeAt' pos ctx (Lam FunctionBinding { functionBindingVariable = x, functionBindingAnnotation = _A} b@(Note src _))+  | pos `inside` src = do+      let _A' = Dhall.Core.normalize _A+          ctx' = fmap (shift 1 (V x 0)) (insert x _A' ctx)+      typeAt' pos ctx' b  typeAt' pos ctx (Pi x _A  _B@(Note src _)) | pos `inside` src = do   let _A' = Dhall.Core.normalize _A@@ -136,7 +139,7 @@   let a' = shift 1 (V x 0) (normalize a)   annotateLet' pos ctx (shift (-1) (V x 0) (subst (V x 0) a' e)) -annotateLet' pos ctx (Lam x _A b@(Note src _)) | pos `inside` src = do+annotateLet' pos ctx (Lam FunctionBinding{ functionBindingVariable = x, functionBindingAnnotation = _A } b@(Note src _)) | pos `inside` src = do   let _A' = Dhall.Core.normalize _A       ctx' = fmap (shift 1 (V x 0)) (insert x _A' ctx)   annotateLet' pos ctx' b