Skip to content

Commit d33e130

Browse files
authored
Enable DAML Script service by default and document it (#7229)
* Enable DAML Script service by default and document it fixes #7193 changelog_begin - [DAML Script] DAML Scripts are now run in DAML Studio just like scenarios. The functionality for inspecting the results is identical. If you encounter issues, please report them. changelog_end * fix double "is identical" changelog_begin changelog_end
1 parent aafb4a2 commit d33e130

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

compiler/damlc/lib/DA/Cli/Options.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ enableScenarioOpt = EnableScenarioService <$>
209209

210210
enableScriptsOpt :: Parser EnableScripts
211211
enableScriptsOpt = EnableScripts <$>
212-
flagYesNoAuto "daml-script" False "Enable/disable support for running DAML Scripts" internal
212+
flagYesNoAuto "daml-script" True "Enable/disable support for running DAML Scripts" internal
213213

214214
dlintEnabledOpt :: Parser DlintUsage
215215
dlintEnabledOpt = DlintEnabled

compiler/lsp-tests/src/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ scriptTests damlcPath scriptDarPath = testGroup "scripts"
542542
, "- daml-script.dar"
543543
]
544544
withCurrentDirectory dir $
545-
runSessionWithConfig conf (damlcPath <> " ide --daml-script=yes") fullCaps' dir s
545+
runSessionWithConfig conf (damlcPath <> " ide") fullCaps' dir s
546546

547547
executeCommandTests :: (forall a. Session a -> IO a) -> (Session () -> IO ()) -> TestTree
548548
executeCommandTests run _ = testGroup "execute command"

docs/source/daml-script/index.rst

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ in a special process and do not interact with an actual ledger. This
1515
means that you cannot use scenarios to test other ledger clients,
1616
e.g., your UI or :doc:`DAML triggers </triggers/index>`.
1717

18-
DAML script addresses this problem by providing you with an API with
18+
DAML Script addresses this problem by providing you with an API with
1919
the simplicity of DAML scenarios and all the benefits such as being
20-
able to reuse your DAML types and logic while running against an
21-
actual ledger. This means that you can use it to test automation
22-
logic, your UI but also for
23-
:ref:`ledger initialization <script-ledger-initialization>` where scenarios
24-
cannot be used (with the exception of :doc:`/tools/sandbox`).
20+
able to reuse your DAML types and logic while running against an actual
21+
ledger in addition to allowing you to experiment in :ref:`DAML Studio <scenario-results>`.
22+
This means that you can use it to test automation logic, your
23+
UI but also for :ref:`ledger initialization
24+
<script-ledger-initialization>` where scenarios cannot be used (with
25+
the exception of :doc:`/tools/sandbox`).
2526

2627
You can also use DAML Script interactively using :doc:`/daml-repl/index`.
2728

docs/source/daml/daml-studio.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,17 @@ You can `hover`_ over most symbols in the code to display additional information
9797

9898
.. _hover: https://code.visualstudio.com/docs/editor/editingevolved#_hover
9999

100-
Scenario results
101-
================
100+
.. _scenario-results:
102101

103-
Top-level declarations of type ``Scenario`` are decorated with a ``Scenario results`` code lens.
104-
You can click on the ``Scenario results`` code lens to inspect the
105-
execution of the scenario.
102+
Scenario and DAML Script results
103+
================================
104+
105+
Top-level declarations of type ``Scenario`` or ``Script`` are decorated with
106+
a ``Scenario results`` or a ``Script results`` code lens.
107+
You can click on the code lens to inspect the
108+
execution transaction graph and the active contracts. The functionality
109+
for inspecting the results is identical for DAML Scripts
110+
and scenarios.
106111

107112
For the scenario from the :download:`Iou<daml-studio/daml/Iou.daml>`
108113
module, you get the following table displaying all contracts that are

0 commit comments

Comments
 (0)