ghcide/BUILD.bazel
Moritz Kiefer 7c3213c3c5 Use haskell-lsp’s builtin VFS in "damlc ide" (#1489)
* Use haskell-lsp’s builtin VFS in "damlc ide"

haskell-lsp has a builtin VFS that it updates automatically on the
corresponding requests. This PR removes our own VFS implementation and
uses that builtin VFS in "damlc ide". To allow the use of functions
like setBufferModified (we use that heavily in daml-ghc-shake-test-ci)
without having to spawn an LSP server, we also add a fallback where we
spin up our own LSP implementation.
2019-06-03 16:19:30 +02:00

88 lines
1.9 KiB
Python

# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:haskell.bzl", "da_haskell_binary", "da_haskell_library")
load("@os_info//:os_info.bzl", "is_windows")
depends = [
"aeson",
"base",
"binary",
"bytestring",
"containers",
"deepseq",
"directory",
"either",
"extra",
"filepath",
"hashable",
"haskell-lsp",
"haskell-lsp-types",
"mtl",
"pretty",
"rope-utf16-splay",
"safe-exceptions",
"sorted-list",
"shake",
"stm",
"syb",
"text",
"time",
"transformers",
"uniplate",
"unordered-containers",
"uri-encode",
]
da_haskell_library(
name = "haskell-ide-core",
srcs = glob(["src/**/*.hs"]),
hazel_deps = depends + [
"ghc-lib",
"ghc-lib-parser",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"//libs-haskell/prettyprinter-syntax",
],
)
da_haskell_library(
name = "haskell-ide-core-public",
srcs = glob(["src/**/*.hs"]),
compiler_flags = ["-DGHC_STABLE"],
hazel_deps = depends + [
"ghc",
"ghc-boot",
"ghc-boot-th",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
deps = [
"//libs-haskell/prettyprinter-syntax",
],
)
da_haskell_binary(
name = "haskell-ide-core-demo",
srcs = glob(["test/**/*.hs"]),
hazel_deps = [
"base",
"containers",
"extra",
"filepath",
"ghc-paths",
"ghc",
"shake",
"text",
],
main_function = "Demo.main",
src_strip_prefix = "test",
visibility = ["//visibility:public"],
deps = [
"haskell-ide-core-public",
"//libs-haskell/prettyprinter-syntax",
],
) if not is_windows else None # Disable on Windows until ghc-paths is fixed upstream