Commit Graph

1406 Commits

Author SHA1 Message Date
Robin Krom
bde8af18c9
language: correct translation of sums of products in daml code gen (#2169)
* language: correct translation of sums of products in daml code gen

We fix the translation of data type constructors with several name
components for sums of products in the translation from daml-lf back to
source.
2019-07-16 22:40:22 +02:00
Stephen Compall
9367d6658f
Move navigator's ApiCodecCompressed to new lf-value-json library (#2136)
* move ApiCodecCompressed, ApiValueImplicits, and some aliases to new lf-value-json package

* adapt navigator to moved pieces

* start defining scalacheck extension to ApiCodecCompressedSpec

* experiment with an inductive case in TypedValueGenerators

* finish a List case for TypedValueGenerators; it's revealing

* remove accidentally readded duplicate aliases

* start tying knots in TypedValueGenerators

* verbatim copy ApiCodecCompressedSpec to lf-value-json

* shift some tests from navigator to lf-value-json

* test Optional and Map for ApiCodecCompressed

* heavier random testing of ApiCodecCompressed

* remove unused dependencies from lf-value-json
2019-07-16 16:38:33 -04:00
Gary Verhaegen
b8d356d8e3 enable old extension test (#2103) 2019-07-16 18:12:48 +00:00
Stefano Baghino
e845b5913d Release 0.13.13 (#2170)
https://www.youtube.com/watch?v=4m1EFMoRFvY
2019-07-16 17:32:41 +00:00
Moritz Kiefer
623e641ec9
Wait for child process to exit in the daml assistant and daml-helper (#2162)
fixes #2142

It turns out that typed-process has the behavior we want so rather
than rolling our own version of `withCreateProcess`, I just switched
to that.
2019-07-16 18:21:00 +02:00
Remy
3a93647eff improve doc about enum types (#2168)
* add a more meat to doc about enum types

* Update docs/source/app-dev/daml-lf-translation.rst

Co-Authored-By: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
2019-07-16 16:19:37 +00:00
Stephen Compall
1a93db264d
navigator: Use LF Value ADT in place of ApiValue ADT (#2053)
* replace ApiValue ADT with aliases to daml-lf/transaction Value ADT

* porting rest of navigator to LF Value ADT

* porting more of navigator to LF Value ADT

* last error, not first

* rename ApiValueImplicits file

* special conversion features for ImmArray and FrontStack

- just .to[ImmArray] or .to[FrontStack] any random collection

* finish porting most of navigator main code

* use numeric indices for record field name fallback when pretty-printing

* tuples are not serializable

* use numeric indices for label fallback in JSON verbose encoding

* make traverseEitherStrictly more likely to preserve the seq's class

* to shortcut for ImmArraySeq .to[ImmArraySeq]

* compiling, passing navigator backend tests

* test traverseEitherStrictly more, er, strictly

* pass scalacopts through to scaladoc

* deal with unused warning

* remove unneeded function

* simpler error reporting, more private functions in ApiCodecCompressed

* move slowApply to FrontStack, test it so it actually works

* remove unneeded toStrings; better error from impossible ValueTuple case

* scalafmt FrontStackSpec

* support alternative, label-free record JSON encoding

* fuse some list operations

- suggested by @stefanobaghino-da; thanks

* blue error message
2019-07-16 10:53:17 -04:00
Shayne Fletcher
5d9561b3cd hlint upgrade (#2158) 2019-07-16 14:20:28 +00:00
Gary Verhaegen
295c36ad2a
add gitignores to templates (#2159) 2019-07-16 14:59:08 +01:00
Martin Huschenbett
d5d08707c2 Drop support for DAML-LF 1.5 from damlc (#2161) 2019-07-16 13:52:29 +00: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
Fran
7324a5d8a7 Prune DA.Generics and fix up some docs. (#2153)
* Prune DA.Generics and fix up some docs.

* Add more --

* :flame-emoji:
2019-07-16 12:12:44 +00:00
Robin Krom
aff7f1bc67
Generate interface files from dalf (#2151)
* language: upgrading: generating interface files
2019-07-16 13:46:43 +02:00
Anup Kalburgi
ddd96a05ce Same chouce name visual (#2152)
* internal name

* Adding internal choice name

* correct but ugly

* no more awkard underscore for create and archive

* not more underscores

* creating archive is not necessary

* simplify

* Removing duplicate

* simplified code

* Using cons intead of ++

* not needed parans

* Formatting
2019-07-15 19:57:20 +00:00
Shayne Fletcher
1bdf212f47
Eliminate the maybe in the hlint option (#2145)
* Eliminate the maybe in the hlint option

* Allow multiple `--with-hlint ...`, `--without-hlint` flags

* Use 'lastMay'
2019-07-15 11:11:37 -04:00
nickchapman-da
102cca04cd
haskell ledger bindings, support uploadDarFile (#2146)
* support uploadDarFile

* comment

* move uploadDarFileGetPid into test code
2019-07-15 16:06:41 +01:00
Remy
7c8bb0257d java-codegen: add integration tests for lf 1.5 (#2143)
* java-codegen: add integration tests for lf 1.5

* formatting

* java-codegen: add README abotu tests organization
2019-07-15 14:35:35 +00:00
Andreas Herrmann
f64b63f7a3
Ensure that dev-env is in PATH for other dev-env tools (#2127)
This is relevant for users of the IntelliJ bazel plugin. It is common to
start IntelliJ via the GUI such that the dev-env is not loaded for
IntelliJ. The bazel plugin is then configured to execute the dev-env
bazel by entering the path into the corresponding configuration option.
However, this bazel is then executed without the dev-env tools in PATH.
Some of the repository rules expect certain dev-env tools in PATH, e.g.
python3. Those will then fail.

This patch ensures that the dev-env is loaded when executing dev-env
tools from outside the dev-env.
2019-07-15 15:29:00 +02:00
Remy
f57e437b80 daml-lf-repl: drop ad-hoc parser (#2104)
* daml-lf-repl: drop ad-hoc parser

* formatting

* Address Stefano's comment
2019-07-15 12:06:23 +00:00
Shayne Fletcher
4f3c4f828f
Improve diagnostics of hlint ideas (#2139)
* Improve diagnostics of hlint ideas

* Zero based
2019-07-15 07:21:57 -04:00
Fran
e30955963b damldoc: Derive missing type signatures and add links in type signatures. (#2132)
* Use type information in function docs

* idpToText -> packRdrName

* Use tycon to get superclasses

* Make anchors from tycons

* Generate all type anchors with tyConAnchor

* Type information is everywhere

* Render links.

* s/missing/available/

* Update golden tests

* Hlint / refactor

* Clean up import list

* Banish evil

* Catch lint

* Use mapMaybe

* Use list comprehensions instead

* packModule -> getModulename, dc_mod -> dc_modname

* Deal with tuple constructors properly

* Update the test case

* Better docs in Rst renderer

* Add test that uses type sig links

* Update release notes
2019-07-15 11:06:01 +00:00
Shayne Fletcher
a85fee85b3
Improve hlint options handling (#2138) 2019-07-15 05:41:06 -04:00
Stefano Baghino
26caa24c93 Remove dead file (#2140) 2019-07-15 08:51:40 +00:00
nickchapman-da
63dd57ab19
fix nim/chat apps (#2120) 2019-07-15 08:57:43 +01:00
Gary Verhaegen
e2d9541c8c bundle vsix in sdk tarball (#2113) 2019-07-12 21:35:05 +00:00
Remy
49d349d770 clean up unreleased.rst (#2137) 2019-07-12 20:55:00 +00:00
Remy
e7bbf87692 Freeze DAML-LF version 1.6 (#1937)
* daml-lf: cosmetic

* daml-lf: release V1.6

* daml-lf: update spec

* update unreleased.rst

* Address Martin's comments

* damlc: active daml-lf-target 1.6

* lf-encoder: fix testing dar generation

* daml-lf spec: simplify 1.dev description

* daml-lf: fix engine test

* daml-lf: fix version timeline

* extractor: fix test

* Address Stephen's comments

* Add more meat to the release notes

* java-codegen: update docs

* damlc: set 1.6 as default output version

* java-codegen update integration tests

* undo replicating typo

* release notes

* scala-codegen: update test

* java-codegen: fix doc

* extractor: fix  test

* address Gerolf's comments

* realse-notes: cleanup unreleased.rst

* Address last comment from Stephen

+ cosmetic cleanup

* formatting
2019-07-12 19:06:44 +00: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
Anup Kalburgi
31319c219d Removing redundant data (#2116)
* Removing redundant data

* Adding some comments

* handling the duplicate acchive option

* renaming record field

* using plural

* Tpl name
2019-07-12 15:29:39 +00:00
Moritz Kiefer
6fb2703d6d Add useNoFile helpers matching defineNoFile (#2126) 2019-07-12 15:06:03 +00:00
Andreas Herrmann
16a52e4f8b Update rules_haskell - bazel-runfiles (#2125) 2019-07-12 14:52:46 +00:00
Robin Krom
0f718eb371
language: fixed qualification in generated code (#2124)
we make sure the right things are qualified and the right things are not
qualified in generated code. we also add GHC.Types always to the imports
because it's potentially used by native types such as 'Int' and we don't
import Prelude.
2019-07-12 16:42:28 +02:00
Robin Krom
9a24c4a866
language: additional (hidden) compiler options needed for migrate (#2123)
This adds two compiler options ifaceDir and isGenerated to the compiler
options. These will be needed to write generated interface files to the
right directory and treat generated source files special when generating
interface files.
2019-07-12 16:41:10 +02:00
Gabor Aranyossy
77964ce426 Keeping loaded packages after reset (#2091)
* keeping loaded packages after reset

removing unnecessary extra reference

changelog

making InMemoryPackageStore immutable

* using Instant.now when loading packages in IndexServer
2019-07-12 12:20:18 +00:00
Stefano Baghino
f80de418f9 Filter out checkpoints in completion stream tailing test (#2122)
Fixes #2121
2019-07-12 12:06:04 +00:00
Moritz Kiefer
23723a6fc4 Fix extraction of Maven tarball in integration tests (#2119)
extractTarball tries to restore the ownership stored in the
tarball. This goes wrong when the tarball is fetched from CI since the
uid/gid might not exist locally.
2019-07-12 10:04:31 +00:00
Moritz Kiefer
25c0052bce
Fix VSCode extension (#2117)
There were two issues:

1. VSCode changed their packaging so we now need to depend on
`@types/vscode`. This broke `yarn run compile`. I have no idea why
this did not cause an error in the Bazel build. Presumably the giant
tsconfig that it generates was doing something different.

2. We excluded src/webview.js in .vscodeignore which means that it was
not included in `vsce package` and thereby also not in the extension
included in the marketplace.
2019-07-12 11:09:37 +02:00
Stefano Baghino
c651e94f82 Throw away unused resource extensions (#2118) 2019-07-12 08:35:34 +00:00
nickchapman-da
4909ee1f01
refactor Stream -> StreamCore/StreamExtra (#2114) 2019-07-11 18:52:50 +01:00
Moritz Kiefer
8b4d8872f0 s/save/safe/ (#2107) 2019-07-11 16:57:58 +00:00
nickchapman-da
a183df6585
haskell ledger bindings: improve thread handling (#2096)
* no forkIO

* mask_ body of asyncStreamGen

* reinstate flaky = True

* use: MonadUnliftIO

* thank you HLint
2019-07-11 17:25:02 +01:00
Moritz Kiefer
48a3f77c4f
Report progress in VSCode (#2112)
For now, we only show a “Progressing” message and a done/todo
indicator. We could eventually try to come up with something better
but I’m not quite sure what that would be since we try a lot of things
in parallel and the triggering request isn’t particularly
useful (users won’t know what a codelens request is and why they have
to wait for it).

Note that VSCode seems to have some delay in updating these
notifications so you only see the done/todo reports if it is
processing for a while.
2019-07-11 17:49:23 +02:00
Gabor Aranyossy
33c746fe9b loading Dars from ZipInputStreams (#2005)
* loading Dars from ZipInputStreams

formatting and cleanup

fixing DarReaderTest not compiling

fmt

using IOUtils to read the ZipInputStream

fixing CodeGen

fixing broken legacy DAR loading

fixed v2 ReferenceServer

cleanup

* fixing rebase conflicts

* introduced a fromFile method to avoid having to do boiler-plating where the input is a File

* addressing leaking resources

* cleanup

* inlining closures

* closing the darStream
2019-07-11 15:37:21 +00:00
Fran
ed904d1855 damldocs: Generate doc anchors at doc extraction. (#2109)
* Generate anchors in haddock parse.

* Simplify function anchors.

* Fix tests

* Fix golden test

* Fix empty doc test.
2019-07-11 15:22:11 +00:00
Moritz Kiefer
e374a9adaa Include NOTICES file in release tarballs (#2110) 2019-07-11 15:02:29 +00:00
varun
feeda440fa
HOTFIX: web-ide: removing web-ide from daml repo. (#2108) 2019-07-11 10:31:47 -04:00
Fran
d887ab4a39
Update CODEOWNERS. (#2106)
* Add myself to daml-assistant.

* Remove neil-da
2019-07-11 15:21:06 +01:00
Moritz Kiefer
1083b23fc0
Use a separate thread for sending GCP log messages (#2102)
Apart from simplifying the code, this should also make startup
significantly faster in some cases, e.g., when the initial log request
times out.
2019-07-11 13:19:02 +02:00