ghcide/BUILD.bazel
Neil Mitchell 16873edb44 hie-core Logging and exceptions (#1933)
* Rename reportSeriousError to reportInternalError

* Stop using logError for logging things that are warnings to the user, not errors by us

* Rename logError

* Sort the log fields properly

* Delete tagAction from Logger

* Strip down the pure logger

* Delete unused pieces of the logger

* A quick check suggests the call stack will be useful in approximately none of the callers of logging, so just remove it

* When reporting an internal error, give as much detail as we can

* Change our logger to be based on Priority values

* HLint fixes

* Rename makeNopLogger

* In hie-core say what level of message you are setting

* Delete the unused makeOneLogger

* Make sure we can show messages floating around

* If a notification/response handler throws an exception, report it upwards

* Remove reportInternalError in favour of a general logging mechanism

* Add missing dependencies

* Just call fail for a dodgy error report

* Add a FIXME

* Make missing modules just an error
2019-09-10 14:52:17 +02:00

93 lines
2.0 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",
"async",
"base",
"binary",
"bytestring",
"containers",
"data-default",
"deepseq",
"directory",
"extra",
"filepath",
"hashable",
"haskell-lsp",
"haskell-lsp-types",
"mtl",
"network-uri",
"prettyprinter",
"prettyprinter-ansi-terminal",
"rope-utf16-splay",
"safe-exceptions",
"sorted-list",
"shake",
"stm",
"syb",
"text",
"time",
"transformers",
"unordered-containers",
"utf8-string",
]
da_haskell_library(
name = "hie-core",
srcs = glob(["src/**/*.hs"]),
hazel_deps = depends + [
"ghc-lib",
"ghc-lib-parser",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
)
da_haskell_library(
name = "hie-core-public",
srcs = glob(["src/**/*.hs"]),
compiler_flags = ["-DGHC_STABLE"],
hazel_deps = depends + [
"ghc",
"ghc-boot",
"ghc-boot-th",
],
# Override the -hide-package flags defined in WORKSPACE
# -hide-package=ghc-boot-th -hide-package=ghc-boot
repl_ghci_args = [
"-package=ghc-boot",
"-package=ghc-boot-th",
],
src_strip_prefix = "src",
visibility = ["//visibility:public"],
)
da_haskell_binary(
name = "hie-core-exe",
srcs = glob(["exe/**/*.hs"]),
hazel_deps = [
"base",
"containers",
"data-default",
"directory",
"extra",
"filepath",
"ghc-paths",
"ghc",
"haskell-lsp",
"hie-bios",
"optparse-applicative",
"shake",
"text",
],
src_strip_prefix = "test",
visibility = ["//visibility:public"],
deps = [
"hie-core-public",
],
) if not is_windows else None # Disable on Windows until ghc-paths is fixed upstream