diff --git a/WORKSPACE b/WORKSPACE index f93e75a852c..a38fdf77897 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -382,6 +382,10 @@ load("//bazel_tools:haskell.bzl", "add_extra_packages") # For the time being we build with GMP. See https://github.com/digital-asset/daml/issues/106 use_integer_simple = not is_windows +HASKELL_LSP_COMMIT = "7024e38d4b463b3eaf1c44c6453eb608dd8f28a9" + +HASKELL_LSP_HASH = "7d706fbc1beb49a9345083d3eadb5e311936a2a8449e7765a65aa7d298dff9d6" + hazel_repositories( core_packages = core_packages + { "integer-simple": "0.1.1.1", @@ -430,11 +434,25 @@ hazel_repositories( hazel_hackage("shake", "0.17.8", "ade4162f7540f044f0446981120800076712d1f98d30c5b5344c0f7828ec49a2") + hazel_hackage("filepattern", "0.1.1", "f7fc5bdcfef0d43a793a3c64e7c0fd3b1d35eea97a37f0e69d6612ab255c9b4b") + hazel_hackage("terminal-progress-bar", "0.4.0.1", "c5a9720fcbcd9d83f9551e431ee3975c61d7da6432aa687aef0c0e04e59ae277") + + hazel_hackage("rope-utf16-splay", "0.2.0.0", "83d1961bf55355da49a6b55d6f58d02483eff1f8e6df53f4dccdab1ac49e101d") + hazel_hackage( "unix-compat", "0.5.1", "a39d0c79dd906763770b80ba5b6c5cb710e954f894350e9917de0d73f3a19c52", patches = ["@com_github_digital_asset_daml//bazel_tools:unix-compat.patch"], + ) + + # This is a special version of Haskell LSP without GPL dependencies + hazel_github( + "haskell-lsp", + HASKELL_LSP_COMMIT, + HASKELL_LSP_HASH, + ) + + hazel_github( + "haskell-lsp", + HASKELL_LSP_COMMIT, + HASKELL_LSP_HASH, + name = "haskell-lsp-types", + directory = "/haskell-lsp-types/", ), pkgs = packages, ), diff --git a/compiler/haskell-ide-core/src/Development/IDE/State/Shake.hs b/compiler/haskell-ide-core/src/Development/IDE/State/Shake.hs index 553a256b752..d7f3ed6e268 100644 --- a/compiler/haskell-ide-core/src/Development/IDE/State/Shake.hs +++ b/compiler/haskell-ide-core/src/Development/IDE/State/Shake.hs @@ -201,6 +201,9 @@ setValues state key file val = modifyVar state $ \inVal -> do f = concatMap fst . Map.elems return (outVal, (f <$> Map.lookup file inVal, f $ outVal Map.! file)) +-- | The outer Maybe is Nothing if this function hasn't been computed before +-- the inner Maybe is Nothing if the result of the previous computation failed to produce +-- a value getValues :: forall k v. IdeRule k v => Var Values -> k -> FilePath -> IO (Maybe (Maybe v)) getValues state key file = do vs <- readVar state diff --git a/util.bzl b/util.bzl index 667fa071a20..46cbf125c32 100644 --- a/util.bzl +++ b/util.bzl @@ -31,9 +31,16 @@ def hazel_hackage(name, version, sha, **kwargs): return [(name, {"version": version, "sha256": sha} + kwargs)] # Things we override from GitHub -def hazel_github_external(project, name, commit, sha): - return [(name, {"url": "https://github.com/" + project + "/" + name + "/archive/" + commit + ".zip", "sha256": sha, "stripPrefix": name + "-" + commit})] +def hazel_github_external(project, repoName, commit, sha, directory = "", name = None): + return [( + name or repoName, + { + "url": "https://github.com/" + project + "/" + repoName + "/archive/" + commit + ".zip", + "sha256": sha, + "stripPrefix": repoName + "-" + commit + directory, + }, + )] # Things we get from the digital-asset GitHub -def hazel_github(name, commit, sha): - return hazel_github_external("digital-asset", name, commit, sha) +def hazel_github(repoName, commit, sha, directory = "", name = None): + return hazel_github_external("digital-asset", repoName, commit, sha, directory = directory, name = name)