Commit Graph

3121 Commits

Author SHA1 Message Date
Neil Mitchell
a1db4558d6 Minor IDE cleanups (haskell/ghcide#945)
* Kill RealLocated, it just duplicates something already in GHC

* Move some things back to UtilGHC, they are useful for setting DynFlags values
2019-05-06 18:35:43 +01:00
Neil Mitchell
c8584f8da5 Move the DAML config stuff out of haskell-ide-core (haskell/ghcide#940)
* Move the GHC config stuff out of haskell-ide-core

* Add an export list to UtilGHC
2019-05-06 14:11:36 +01:00
Neil Mitchell
8db3577db6 IDE cleanups and progress towards external usability (haskell/ghcide#930)
* Remove the requirement for Binary on Shake rules (was not used)

* Add a deriving Show on Event, easier for external integrations

* Rename GeneratePackageState to LoadPackageState and move its fields to the rule, rather than the key

* Inline getPackageState away

* Change to passing a ModRenaming to the package loader. Two reasons:
1) When loading non-DAML things we might want to omit the renaming
2) The type ModRenaming has documentation of semantics, unlike [(String, String)]
2019-05-06 10:57:17 +01:00
Neil Mitchell
940ffbecbf Avoid using package imports (haskell/ghcide#924)
* Hide the package ghc-boot-th by default

* Don't use package imports in haskell-ide-core
2019-05-05 21:22:15 +02:00
DavidM-D
b56fdcace3 Changed Diagnostics to FileDiagnostics (haskell/ghcide#897)
* Changed Diagnostics to FileDiagnostics

* Hlint fixes

* Fix tests

* Removed the lenses
2019-05-03 17:43:40 +00:00
Neil Mitchell
90b7572c44 Fix prettyRange so it prints ranges like it used to (haskell/ghcide#882)
Before it was garbled and wrong:
Range:    Range Start: Position Line: 2Character: 15End:   Position Line: 2Character: 15

After it's correct and like it was before:
Range:    3:15-3:17
2019-05-03 12:49:51 +01:00
DavidM-D
5f9af256e0 Restored filepaths to their error messages (haskell/ghcide#862) 2019-05-03 08:33:56 +02:00
Neil Mitchell
d7dd9bf540 Improve the error message if we can't find the file (haskell/ghcide#858) 2019-05-02 19:16:32 +00:00
Shayne Fletcher
2f9321ae51 Enable -Wprepositive-qualified-module (haskell/ghcide#823) 2019-05-01 21:09:38 +00:00
Neil Mitchell
006824954c Start cleaning up pretty-print (haskell/ghcide#821)
* Move from prettyDiagnostic to prettyDiagnostics

* Remove as much pretty print stuff as we can

* Try moving duplicate named functions with similar semantics and identical types to different names

* Change to returning pretty printed outputs from Diagnostics

* Remove a redundant import
2019-05-01 19:06:00 +01:00
DavidM-D
9f6b19a876 New diagnostics implementation (haskell/ghcide#737)
* Switch to haskell-lsp

* Fix build of data-default on Windows

* Use ghc environment files to avoid overflowing CLI length limits
2019-04-30 22:51:53 +02:00
Neil Mitchell
43b745fbf8 Add explicit export list (haskell/ghcide#806)
* Add explicit export lists in some places

* Add another explicit export
2019-04-30 21:08:36 +01:00
Neil Mitchell
ff6b32659c haskell/ghcide#564, fix JUnit tests (haskell/ghcide#799)
* Make the ScenarioService take an IO callback, not STM

* Remove a redundant space

* Use IO in preference to STM where we really don't care which is in use

* haskell/ghcide#564, always print out diagnostics for tests

* haskell/ghcide#564, fix getting the scenario names so if they can't be computed you give an answer

* Add a proper data type to represent pass/fail in the tests

* Centrailse printing a failure message

* Pull the test execution into a separate file, ensuring it always gives back an exit code

* Use nubOrd instead of Set

* Clean up how we figure out which files to test

* Fail if there are any errors

* Delete all the brittle failure tracking stuff

* Rename the compiler handle to h

* Only print out the successful results to stdout, since the unsuccessful ones end up in diagnostics

* Make JUnit output still print out the test results

* Make JUnit print out all the details

* Delete the stdio command path

* Break the bigger pieces apart in the test runner

* Inline testJUnit

* Shorten to UseColor

* Shorten to color

* Inline and comment part of the JUnit tests

* HLint

* Update daml-foundations/daml-tools/da-hs-daml-cli/DA/Cli/Damlc/Test.hs

Co-Authored-By: neil-da <35463327+neil-da@users.noreply.github.com>

* Fix an HLint refactoring snafu

* Fix up the damlc tests

* Tighten up a test by demanding it throws ExitFailure
2019-04-30 18:07:08 +00:00
DavidM-D
ccab8fb8b1 Add lsp deps (haskell/ghcide#724)
* Added GPL free versions of haskell-lsp as a dependency

* Cleared something up that I didn't understand

* Fixed bazel files
2019-04-26 14:00:15 +02:00
Neil Mitchell
09d9b1d957 Simplify IDE rules (haskell/ghcide#708)
* Move the IdeResult term  into the A data type

* Nothing ever consults the errors stored in A, so stop storing them

* Use the new Shake MonadFail Rules instance

* Document the information in the Shake database

* More documentation of the data in the Shake service

* Change getValues to avoid getting the diagnostics

* Avoid fmap over a pair, a bit weird
2019-04-25 22:04:01 +01:00
gleber
8b457900c5 Enforce consistent formatting of BUILD files. (haskell/ghcide#412)
* Add buildifier targets.

The tool allows to check and format BUILD files in the repo.

To check if files are well formatted, run:

    bazel run //:buildifier

To fix badly-formatted files run:

    bazel run //:buildifier-fix

* Cleanup dade-copyright-headers formatting.

* Fix dade-copyright-headers on files with just the copyright.

* Run buildifier automatically on CI via 'fmt.sh'.

* Reformat all BUILD files with buildifier.

Excludes autogenerated Bazel files.
2019-04-12 13:10:16 +02:00
Martin Huschenbett
906e15948c Add location information to DAML-LF produced by damlc (haskell/ghcide#390)
* Add location information to DAML-LF produced by damlc

This is required to get error locations in the scenario view. Rigth now,
the location information for `create`/`exercise` still points to the
template/choice. I'll fix that in a separate PR.

* Fix test expectations

* Fix more tests
2019-04-11 21:44:48 +02:00
Martin Huschenbett
36527bd928 Turn off -Woverlowed-literals in damlc (haskell/ghcide#375)
* Turn off -Woverlowed-literals in damlc

This flag does not play well with location information obtained via `-ticky`.
Also, the error message you get from overflowed literals suggests to use
`-XNegativeLiterals`, which is a bad idea since it changes the meaning of
`(-1)` from `\x -> x - 1` to `negate 1`.

* Fix module name in test

Co-Authored-By: martin-drhu-da <31696042+martin-drhu-da@users.noreply.github.com>
2019-04-11 13:52:22 +02:00
david-md-da
7d572593b8 Tag errors as errors rather than debug messages (haskell/ghcide#360) 2019-04-10 17:49:43 +02:00
Jost Berthold
bf486ad1fd HOTFIX damlc: allow for passing options to the underlying GHC (haskell/ghcide#346)
* HOTFIX damlc: allow for passing options to the underlying GHC

As `damlc` is based on GHC, it "understands" all options that GHC understands.
This PR introduces a way to use GHC options that are not exposed by the `damlc`
driver, by passing any number of `--ghc-option CUSTOM_OPTION` on the command line.

The code uses the GHC function which parses options inside files, so
prohibiting a few options that we would not want to expose (package db, output
file, etc).

All warnings that GHC emits during flag processing are presented to the user.

If an option contradicts a DAML compiler setting, the compilation will be
aborted with a GHC exception (calls makeDynFlagsConsistent internally).

* HOTFIX damlc: small clean-up
2019-04-10 21:48:08 +10:00
Digital Asset GmbH
d1fb5b616f open-sourcing daml 2019-04-04 09:33:38 +01:00