Commit Graph

32 Commits

Author SHA1 Message Date
Martin Huschenbett
ab07b05fcb Clean up rules_daml (the bazel rules for DAML) (#3495)
There are rules that are used nowhere and seem like old cruft.
2019-11-18 08:12:47 +00:00
Andreas Herrmann
c994703c0c Update rules_haskell (#3473)
* Update rules_haskell & rules_nixpkgs

* Define dadew POSIX toolchain on Windows

* Build hpp with stack and Cabal

* Replace Hazel hpp by @stackage hpp

* replace backslash by forward slash

* Cabal wrapper exclude bindist includes

* ghci-grpc patch fix missing argument

* Switch to rules_haskell master
2019-11-15 10:50:12 +00:00
Moritz Kiefer
36719717fa
Update to current state of progress reporting in LSP (#3211)
* Update to current state of progress reporting in LSP

* fix ide-debug-driver

* Fix tests

* Fix build of ghcide executable
2019-10-17 16:14:49 +02:00
Remy
e45b585307 daml-lf: repackage daml-lf archive proto (daml_lf -> daml_lf_dev) (#3169) 2019-10-15 09:36:11 +00:00
Remy
d64df4b5f7 daml-lf: clean achive bazel build (#3175)
* clean the mess in daml-lf achive bazel build

* add release note

* Address Moritz's comments

* more release notes
2019-10-15 08:36:46 +00:00
Anup Kalburgi
3686162c02
Adding visual -web command (#3009)
adding the visual-web command to damlc
2019-09-27 10:26:20 -04:00
associahedron
183d28995f Make CPP work in damldocs. (#2891)
* Make CPP work in damldocs.

* buildifier

* Use getTemporaryDirectory

* lint
2019-09-13 11:09:39 +00:00
associahedron
2027d39206 Enable {-# LANGUAGE CPP #-} for daml. (#2878)
* Passing the preprocessor

* Add ghcversion.h

* Remove {-# LANGUAGE CPP #-} for now.

* Remove spurious #line

* Always add platform info, and pass -P flag

* buildifier

* Generate blank ghcversion.h to get around copyright headers check.

* Reviewer suggestions
2019-09-11 15:28:34 +00:00
Moritz Kiefer
f7befca723
Get ghcide from the new upstream repo (#2867)
* Get ghcide from the new upstream repo

* Update azure-pipelines.yml

Co-Authored-By: Gary Verhaegen <gary.verhaegen@digitalasset.com>
2019-09-11 08:57:48 +02:00
Moritz Kiefer
d2b68d45d4 Rename hie-core to ghcide (#2820)
* Rename hie-core to ghcide

The name `hie-core` has caused a lot of confusion as to how we relate
to haskell-ide-engine so changing it should hopefully help with that.
I also think that ghcide is still a good name once we hopefully
integrate with haskell-ide-engine more closely.

The name ghcide seems to have a reasonable amount of support on
Twitter https://twitter.com/ndm_haskell/status/1170681262987710464
which is of course the only good way to come up with names.

* Add a readme that points people to the new directory.

* Fix bogus replacements

* Use a proper link

* links are hard
2019-09-09 13:55:16 +00:00
Robin Krom
aa1e95173a
language: check dflags for errors (#2748)
* language: check dflags for errors

We add a check when we build the dflags for cases that will lead to a
failed build and emmit a clearer error message. Currently this only
includes a check, to see whether the current installed unit id is also
imported as a package from the package database.

* exclude ghc-prim from check

* exclude code generation from dflag check

* add an internal option to turn dflags check off
2019-09-06 21:24:46 +02:00
Andreas Herrmann
ed39800a9f Rename hazel_deps to hackage_deps (#2789)
* hazel_deps --> hackage_deps

Mechanical change:

```
sed -i 's/hazel_deps/hackage_deps/g' $(ag -l hazel_deps)
```

* Hazel dependencies --> Hackage dependencies
2019-09-06 09:01:09 +00:00
Moritz Kiefer
336cad1016
Fix ghc-pkg runfiles (#2726)
This allows us to run "damlc build" in Bazel rules which is a
prerequisite for doing anything with DAML packages as they don’t work
with "damlc package".
2019-09-02 18:50:25 +02:00
Moritz Kiefer
abfce20ce9
Fix damlc manifest writer (#2689)
Previously, we didn’t broke at 72 chars instead of 72 bytes and we did
not take the newline character into account.
2019-08-28 16:31:20 +02:00
Anup Kalburgi
09b766c502 Visual integration with LSP (#2597)
* daml visualize with lsp

* Working command execution with ide

* Have to call visual now

* Split function

* Wrong constuctions of world or the module

* Working almost

* Have to gather all modules

* Now works end to end. Considers all the daml files in workspace

* removing unused code

* removing unused dependency

* Removing unused JS code and better error message

* Function re-arrange

* Removing us of heaad, instead handling error

* Format and rearranging

* Removing unused assignment

* Formating everything

* missed dependency

* Generating visual only for the file that is open

* Using modules from generated pkg, error messages

* Bringing back the commands

* Names and formating

* consitent error message

* Removing Just pattern match using _use now

* package

* Moving visual to a different module

* Function simple

* Removing Rule as it increases memeory consumption

* TODO LSP error

* White space

* Fmt things

* Handling if command was executed for a non daml files

* Better error message

* debugging

* Fix executeCommand

* Adding tests to execute command. Thanks moritz

* Unwanted lines

* Spaces and comment

* 3rd time ?

* Spaces are white

* assert equal instead of assert bool
2019-08-26 15:47:29 +00:00
Robin Krom
2374b8c231
Migrate same package name (#2564)
* language: smoothing out the migration experience

Some improvements to make the migration process simpler when migrating
between packages with the same name, e.g. foo-1.0.0 -> foo-2.0.0. This
is the main use case.
2019-08-20 11:02:41 +02:00
Moritz Kiefer
3e2ccc0842
Switch to a streaming zip encoding (#2595)
This switches the creation of the archive in `daml build` from
`zip-archive` to `zip`. This has a few advantages:

1. It gets rid of lazy IO for reading all the interface and source
files. This avoids the high usage of file handles in `daml build`.

2. It seems to be a slight improvement in max memory usage and runtime
and a giant improvement in allocations (but I think the latter
probably comes primarily from the fact that the locations are moved to
the bzip C library). The improvement in max memory usage is less than
I expected so probably there is still something off somewhere.

For now, I only switched over `createArchive`. Archive reading is
still done using `zip-archive`. We might want to switch that over in a
separate PR.
2019-08-19 20:15:13 +02:00
Andreas Herrmann
76b9a477b3 hie-bios: Don't hard-code import-dirs (#2562)
* hie-bios: Don't hard-code import-dirs

* Formatting
2019-08-15 16:08:35 +00:00
Gary Verhaegen
99ea93168d
update copyright notices (#2499) 2019-08-13 17:23:03 +01:00
Andreas Herrmann
a1c21d9829
Update rules haskell (#2509)
* update rules_haskell

* adapt rules_haskell patches

* io_tweag_rules_haskell --> rules_haskell

* io_tweag_rules_haskell --> rules_haskell

* haskell:haskell.bzl --> haskell:defs.bzl

* rules_haskell_dependencies
2019-08-13 16:46:31 +02:00
Robin Krom
829cb4cef5
Daml stdlib with versions (#2479)
* language: build daml_stdlib with a version in the package name.

* versioned daml-stdlib in damlc

* reformat bazel files

* fix daml_doc_test
2019-08-12 16:05:28 +02:00
Shayne Fletcher
b3dac78e66
hlint.yaml => dlint.yaml; globally disable "use newtype" hint (#2341) 2019-07-30 14:39:46 -04:00
associahedron
3d6f740964
damldocs: Hook up multiple file rendering to cli options. (#2295)
* Hook up multiple file rendering to cli options

* Fix --output help

* Fix bazel rules, boo

* Fix rule again

* Address reviewer comments
2019-07-26 13:45:06 +01:00
Fran
d0dd201380
damldocs: Backend for rendering docs to multiple pages. (#2259)
* Begin multi-page rendering

* Fixed multi-file output rendering for HTML

* Remove renderSimpleHtml

* Remove unnecessary imports

* Remove unused lang extensions

* Address reviewer comments
2019-07-23 19:04:10 +01:00
Moritz Kiefer
5aa3cba949
Add a damlc doctest command and test the standard library (#2157)
There is lots of room for improvements here but I think this is a good
first step. The 3 main things that could be improved imho are:

- Rewrite source locations to point to the original file rather than
  the generated module

- Provide some way to declare things like imports or more general,
  setup code that is added to the generated module.

- Prettier/more helpful output during a run, e.g., print the list of
  successful tests.
2019-07-16 15:51:01 +02:00
Fran
0fc0ca6574
damldocs: Anchors and type signature links for markdown output. (#2156)
* Move renderer monoid to its own module.

* Markdown rendering

* Add md stdlib bazel rules

* Update damldoc tests
2019-07-16 13:53:15 +01:00
Shayne Fletcher
dd77ea99e1 remove filegroup now there's only hlint.yaml (#2133) 2019-07-12 16:57:37 +00:00
Shayne Fletcher
dcd20ace8a Daml hlint integration (#2115)
* Get draft rule in

* Hlint is now firing

* First hlint unit test

* This gets hlint working in the ide

* Select hlint.yaml contextually. Wip

* Fix prod path

* Switch between prod and test versions of hlint.yaml

* Format

* Ignore hlint hints in the language tests

* Add some debugging stuff. LSP stress test is broken

* Update compiler/damlc/daml-ide-core/src/Development/IDE/Core/Rules/Daml.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Tidy up some details

* Simplify settings (remove unused parseFlags)

* Fix LSP stress tests

* ./fmt.sh

* Collapse to one hlint.yaml, provide options

* Fix location of hlint runfiles

* Disable hlint by default; enable for shake-ide tests

* lint (ironic)

* Remove filtering of lints from integration test

* ./fmt.sh

* Respect the flag

* Silence opininated lint

* Update compiler/damlc/daml-opts/daml-opts-types/DA/Daml/Options/Types.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update compiler/damlc/lib/DA/Cli/Damlc.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* I really did mean optHlintEnable here

* Move hlint enabled check to ofInterest like shouldRunScenarios

* Rename variable

* Cache settings

* Missed a merge conflict

* lift liftIO

* Remove the hlint-testing POC

* use useNoFile_
2019-07-12 16:17:06 +00:00
Fran
a8f98172c9 damldoc: Move towards extracting information from TypecheckedModule in HaddockParse. (#2013)
* Run typechecker in damldocs (but don't use result yet)

* Add Modulename to TypeApp constructor.

* Add md_name where appropriate.

* Thread a DocCtx through each doc extractor.

* Move template set and choices map into docctx

* Use Typename for template set and choice map

* Make Anchor a newtype and move it to Types

* Make Modulename in TypeApp an Anchor instead.

* Remove import of hidden module.

* Qualify that which doth need be qualified

* Update tests

* Build stdlib in such a way that it passes typechecking.

* Update release notes.

* Remove MOVE Prelude directives in daml-prim.

* Use optional in damldoc options

* Update function hashes

* Compile base packages to json first
2019-07-09 15:34:06 +00:00
Moritz Kiefer
2371d173b1
Move all damlc tests to compiler/damlc/tests (#2057)
I’ve also changed some of the names to be more sensible.
2019-07-09 13:38:58 +02:00
Moritz Kiefer
edff8a416d
Move files in daml-foundations/daml-ghc to compiler/damlc (#2037)
* Move files in daml-foundations/daml-ghc to compiler/damlc

There is also a bit of refactoring going on to actually split things
apart into sensible targets. What is still missing is a cleanup of the
module hierarchy and a cleanup of the test targets but I’ll leave
those for separate PRs.

As a nice bonus, this also reduces dependencies between targets so it
will speed up compiles.

* Update .hie-bios
2019-07-08 17:55:51 +02:00
Moritz Kiefer
bb3a98bf61
Move code in daml-tools outside of daml-foundations (#2033) 2019-07-08 11:40:48 +02:00