Commit Graph

39 Commits

Author SHA1 Message Date
Moritz Kiefer
38f3b99d9a
Remove Data.Aeson.TH.Extended (#1635)
The only remaining user is DA.Daml.GHC.DamlDoc.Types and I replaced
that by Generics based deriving. The instances should produce
identical output.
2019-06-13 14:26:04 +02:00
Moritz Kiefer
8029080fc7
Use FromServerMessage directly (#1583)
Previously we had two layers of indirection:

In the compiler we emitted Event, we then translated this to
ClientNotification which was then translated to
FromServerMessage.

Apart from being confusing and convoluted this also resulted in us
doing the conversion to generic LSP types too late so we had scenario
specific code in places where it shouldn’t be.

This PR removes the indirection and just uses FromServerMessage
directly.
2019-06-11 16:03:44 +02:00
Moritz Kiefer
4537a936dc
Avoid errors due to unhandled requests in VSCode (#1538) 2019-06-06 14:44:42 +02:00
Moritz Kiefer
217c56d072
Add an option to the IDE to disable the scenario service (#1522)
* Add an option to the IDE to disable the scenario service

This is useful for several reasons:

1. We currently have to disable all tests using the scenario service
on Windows since they are extremely flaky due to issues we haven’t
been able to solve so far. This allows us to run at least a subset of
tests on CI.

2. The LSP tests currently start a new instance of damlc for each
test (we might want to revisit this but it seems to be sufficiently
fast so far) and not starting the scenario service allows us to speed
things up a bit.

3. On large projects, this could be useful to avoid having the IDE use
up even more memory and speed things up a bit. However, this PR does
not yet expose this in a convenient way so there is more work to be
done (in separate PRs) to make that a viable option.

* Fix LSP tests on Windows
2019-06-06 12:06:07 +02:00
Moritz Kiefer
9689f00e58
Initial boilerplate for an LSP-based test suite (#1516)
This needs more work but I’d like to get the initial boilerplate in
first. We will also have to make some changes to lsp-test and expand
it in various ways but those should hopefully be upstreamable.
2019-06-04 20:48:18 +02:00
Moritz Kiefer
e400bc7eb8
Remove use of managed for starting the scenario service (#1508)
Ironically `managed` didn't turn out to make our code more manageable
and we ended up mostly using it in very isolated places only to then
immediately convert it back to bracket-style functions using `with`.

This PR also removes the use of `managed` from the GcpLogger which was
the only other place where we are using it and it finally kills the
rather silly logic that starting up the scenario service was tied to
having an event logger.
2019-06-04 17:17:05 +02:00
Moritz Kiefer
96fda7f4a0
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
Moritz Kiefer
d4ccf0af75
Handle exceptions when sending logOptOut messages (#1492)
We already do this for all other log messages and it makes sense to do
it for the opt out message as well.

This should fix #1487.
2019-06-03 15:09:54 +02:00
Moritz Kiefer
d438616521
Remove unused LSP code (#1471)
Now that we use haskell-lsp for most things, we can klil
da-hs-json-rpc completely and most of da-hs-language-server as well.
2019-05-31 14:42:24 +02:00
Moritz Kiefer
6467a3b5a4
Switch to using haskell-lsp for IO (#1466)
* Switch to using haskell-lsp for IO

I’ve tried to keep this as small as possible for review so this PR
does not attempt to remove a lot of the things that are now unused.

There is also still a compatibility layer in place to avoid changing
too many things at once.

I tested this in the IDE on Linux and Windows and diagnostics,
scenario results, hover, goto definition all seem to work as expected.
2019-05-31 13:53:16 +02:00
Moritz Kiefer
df674c5569
Move DA.LanguageServer.Protocol to haskell-lsp-types (#1437)
There are still a few types left over that I will replace in separate PRs.
2019-05-28 20:45:29 +02:00
A. F. Mota
2329b1b97a
Display warnings in daml build. (#1375)
* Display warnings in daml build.

* Prevent errors from showing twice.

* Use flagYesNoAuto for scenario service.
2019-05-24 14:36:48 +02:00
Martin Huschenbett
6e73868220 Replace all occurrences of Tagged in DAML-LF AST with newtypes (#1289)
* Replace all occurrences of Tagged in DAML-LF AST with newtypes

This must end as it makes the code bases harder to understand without
adding any benefits.

* Add two more usages of mkVal

* Remove Orphans.Lib_hashable

* Remove tagged from package dependencies

* Derive stock classes as such
2019-05-21 16:19:57 +00:00
Moritz Kiefer
7afc8af554
Add --open-browser flag to daml start (#1176)
I went with the yes/no/auto approach we already use in the assistant
and moved the logic for that to da-hs-base.
2019-05-16 10:28:49 +02:00
Moritz Kiefer
41968cb4f7 Fix filename of Data.Conduit.Tar.Extra (#1143)
Somehow, I managed to accidentally use the weird . syntax in the
filename instead of moving it to the proper location.
2019-05-15 09:40:55 +01:00
Moritz Kiefer
ad10f98020
Fix SDK integration tests on Windows (#1125)
* Fix SDK integration tests on Windows

* Switch to Haskell-based tar extraction
2019-05-14 21:55:45 +02:00
Moritz Kiefer
218bd691f2 Fail if modules listed in exposed-modules are not in the DALF (#1054)
fixes #1041
2019-05-10 02:37:27 +00:00
Michał Majcherski
784fc1b8dd
windows: adds Bazel's MANIFEST file lookup to DA.Bazel.Runfiles (#801) 2019-05-08 13:17:36 +02:00
A. F. Mota
2d2159cd0a Fix getDispatchEnv / getDamlEnv re-entrancy. (#951)
* Add two failing getDispatchEnv tests.

* Fix getDispatchEnv idempotency.

* Fix new test formatting.

* Make getDamlAssistantPath look in env first.

* Fix daml env var overriding.

* Test all the Nothing cases of env var dispatching.

* Fix dispatchEnv and getDamlEnv for Nothings.

* Add hlint rule to avoid future setEnv debacles.

* Fix other uses of setEnv.

* Fix type error.

* Fix reviewer comments

* setEnv comment
2019-05-06 19:25:30 +00:00
Neil Mitchell
11b1d1deb9
Use less da-base (#919)
* Delete Test.Tasty.HUnit.Extended - no one was using the extended pieces

* Delete stuff from TH.Extended that was unused

* Delete stuff from Control.Monad.Except.Extended and simplify

* Delete unused stuff from Data.Text.Extended

* Inline the one use of runDefaultExceptT

* Delete Control.Monad.Except.Extended

* Clean up getAssociatedVirtualResources by inlining and thinking

* Fix dumb typos in getVirtualResources

* Remove usages of Control.Monad.Except.Extended

* Add a missing package import
2019-05-05 21:48:37 +01:00
Neil Mitchell
fe3e5c9639
Delete DA.Prelude (#914)
* Use DA.Prelude a lot less

* Make LANGUAGE pragmas have the right case

* Don't reexport DA.Prelude

* Remove more DA.Prelude imports

* Remove the nastiest renaming DA.Prelude

* Final removal of DA.Prelude

* Kill DA.Prelude

* Add missing dependencies

* More missing package imports

* More missing package imports

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs

* Update compiler/daml-lf-ast/src/DA/Daml/LF/Ast/Base.hs
2019-05-04 18:51:56 +01:00
Neil Mitchell
3cab59ad6d Remove completely redundant imports of DA.Prelude (#911)
* Remove completely redundant imports of DA.Prelude

* Start chipping away at some NoImplicitPrelude too
2019-05-04 12:40:07 +00:00
Neil Mitchell
f256ef09c4 Delete modules that appear entirely unused (#909) 2019-05-04 11:54:27 +00:00
Neil Mitchell
4040dffc7a
Start cleaning up pretty-print (#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
Neil Mitchell
5ed95bc64c
Move DA.Pretty into da-hs-base (#818)
* Move DA.Pretty into da-hs-base

* Bazel formatting

* Remove another instance of da-hs-pretty
2019-05-01 14:50:19 +01:00
Neil Mitchell
1b146a273b
Delete unused Haskell modules (#817) 2019-05-01 13:58:22 +01:00
DavidM-D
8da835489f New diagnostics implementation (#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
836d65e0ba
Add explicit export list (#806)
* Add explicit export lists in some places

* Add another explicit export
2019-04-30 21:08:36 +01:00
Neil Mitchell
d75b716bb7 Kill data loc (#804)
* Remove most of Data.Loc

* Kill more of Data.Loc

* Inline Data.Loc in the one place it is used
2019-04-30 17:21:06 +00:00
Martin Huschenbett
7f3556266c
Remove orphans instances for Binary and FromJSON/ToJSON (#723) 2019-04-26 13:25:42 +02:00
Martin Huschenbett
fffd8d03e8 Stop using Template Haskell to derive type class instances (#262)
* Stop using Template Haskell to derive type class instances

Template Haskell is notorious for causing slow build times. That's why we
remove the `makeInstances*` family of functions and use proper `deriving`
clauses instead.

* Make hlint happy

* Make hlint even more happy

* Derive Data

* Remove ToJSON instances from DAML-LF AST
2019-04-25 16:35:35 +02:00
Martin Huschenbett
e54ec705b5
Stop deriving ToJSON/FromJSON when using makeInstances (#695)
This is mostly a preparation for dropping `makeInstances` entirely.

As a side effect we have to change how we test properties of the DAML-LF
generated by damlc. Previously, we turned the AST into JSON using its
`ToJSON` instances. Now, we turn the AST into JSON using the `ToJSONPB`
instances generated by `proto3-suite`. The resulting JSON is then
inspected using the `jq` tool in both cases. This change actually improves
our testing since we're now testing properties of the generated protobuf
encoding of the AST rather than of our pleasant Haskell representation of
the AST.
2019-04-25 15:38:41 +02:00
Moritz Kiefer
1cc0126395 Disable echo in daml wrapper script (#655)
When echo is enabled (which is the default), the IDE can get really
confused since it tries to interpret the commands as LSP messages
which obviously fails.
2019-04-24 19:00:21 +00:00
gleber
aa70c7f64e
Enforce consistent formatting of BUILD files. (#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
david-md-da
e165f1df00
Tag errors as errors rather than debug messages (#360) 2019-04-10 17:49:43 +02:00
david-md-da
159b0bca4d
Added tracking of telemetry opt-out (#357) 2019-04-10 17:45:17 +02:00
Brian Healey
4d7f455168
HOTFIX rename COPYRIGHT so github correctly shows apache2 license for repo (#274) 2019-04-05 22:10:47 -04:00
moritzkiefer-da
fd156c33df
Add daml start (#254)
* Add daml start
2019-04-05 19:34:23 +02:00
Digital Asset GmbH
05e691f558 open-sourcing daml 2019-04-04 09:33:38 +01:00