* Improve bash completions for daml-assistant.
* Install bash completion script automatically
* Better default logic for bash completions
* specifically -> explicitly
* Copyright headers
* Better hook logic and refactoring
* Handle non-standard installations more robustly.
* Handle CI env & add changelog note.
CHANGELOG_BEGIN
- [DAML Assistant] Bash completions for the DAML assistant are now
available via ``daml install``. These will be installed automatically
on Linux and Mac. If you use bash and have bash completions installed,
these bash completions let you use the tab key to autocomplete
many DAML Assistant commands, such as ``daml install`` and
``daml version``.
CHANGELOG_END
* Mention bash completion in assistant docs
* Remove promises
* Move Any wrappers and Archive to stable packages
There are no actual API or functionality changes in this PR but the
logic for locating the stable packages has slightly changed since the
Any wrappers package only makes sense for LF 1.7. To address this, we
simply filter out stable packages for newer LF versions since it
doesn’t make sense to depend on those anyway.
CHANGELOG_BEGIN
- [DAML Compiler] Move ``Archive`` type to a separate DALF.
CHANGELOG_END
* More comments
* Fix java codegen tests
* fix more tests
* Force cache reset on Windows
* Revert "Force cache reset on Windows"
This reverts commit 9f2b7d70b2.
* Extend Priority type with Telemetry value
* Include Telemetry logging level in logger
* Log viewing of scenario results
* Update ghcide with telemetry logging level
* language: compile everything in the source directory
This removes the need to specify a 'main'. Instead we 'source' in
daml.yaml should point to the source root directory.
* Delete obsolete proto3-suite patch
My patch has been upstreamed so no need to keep it around in our repo.
* Upgrade proto3-wire
* Adapt to changes in proto3-suite
Add a command line option to `damlc inspect` which allows for configuring the
details level of the pretty printed DAML-LF. Right now the only difference is
that levels bigger than 0 print all location information. Level 0, which is
the default, also prints location information top level declarations.
This feature is useful for debugging location information.
For example, we print two spaces if there's no annotation between `def` and
the function. This PR fixes this by using the `empty` document instead of the
document containing the empty string. (Please don't ask me why they are
different.)
* Supporting producing sdist tarballs for the HS ledger bindings
The README.md has an explanation for how you can use this.
This should hopefully allow others to experiment with the bindings.
* Improve debugging output
Displaying the exception makes it easier to figure out what is going
wrong.
I’ve also added a HasCallStack constraint to `locateRunfiles` since it
looked like that was failing. Turned out to be a call to `create` that
didn’t go via `locateRunfiles` but I think it’s useful either way.
Should be more useful with https://github.com/tweag/rules_haskell/pull/1007
* Update compiler/hie-core/src/Development/IDE/Core/Shake.hs
Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
* DA.Bazel.Runfiles based on bazel-runfiles
* locateRunfilesMb -> locateRunfiles
* .exe extension on Windows
* Add docstring to locateRunfiles
* bazel-runfiles: Normalize on Windows
* 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
* Move prettyPosition over to a more sensible place
* Avoid some pretty printing
* Remove duplicate methods and switch to having a function to get the logger handle
* Remove unncessary bits of the logger
* Remove reportSeriousErrorDie - was unused
* Rename the Logger methods to Logger rather than Handle
* Delete the unique supply
* Decrease the use of getServiceEnv
* Move getIdeOptions inside Service
* Add getFilesOfInterest rule
* Hide the existence of Env
* Inline some redundant forwarding methods
* Add a FIXME for a dodgy function
* Delete some redundant imports
* Rename Map to HMap, since I need to use Data.Map too
* Make the Shake-specific Diagnostics functions into that module
* Delete errorDiag which was unused
* Inline the diagnostic function, since it had one user
* Add ofInterest rule as a separate module
* Sort the exposed modules
* Fix up the demo
* Make sure you add the OfInterestVar global
* HLint
* Get rid of some of interest stuff in other places
* Remove the OfInterest stuff from Service
* Delete the entirely unused reflow function
* Don't have Data.Text.Prettyprint.Doc.Syntax reexport stuff
* Move most of the pretty printing inside hie-core
* Get rid of the prettyprinter-syntax dependency from hie-core
* Get rid of prettyprinter-syntax, by collapsing the one definition into DA.Pretty
* Add --install-assistant option
* Better doc on iActivate
* Determine whether to install assistant based on new flag
* Fix logic and update install warning
* Remove --activate from install.sh
* Add missing ]
* Change deprecation warning.
* Add release notes for new option.
* Update help text for install-assistant
* Fix release notes
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.
* 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
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.
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.
* 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.
* 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.
* 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
* 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
* 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