I am using Ubuntu 18.0.4 and VS code version 1.36.1
Initial days of DAML development I could see the “script result” option over test code block but recently it’s not available/disabled.
It’s a really great feature to test daml code. How can I get it back in my VS code?
Also, have noticed that I can’t even see this feature in online web IDE (mozilla FF, Chrome).
Is there something missing at my end? Please suggest
Hi @Hem-M, welcome to the Daml Forums. The Script Results only appear after successful compilation. Could you try to run
daml build in your project to see whether it builds successfully?
You can also see that in the IDE if you open the “Problems” pane. I don’t know how to do that in Ubuntu. Probably via the View menu.
Welcome to Daml @Hem-M , as @bernhard said, it has to be compiled first.
@bernhard Yes, you are correct re Ubuntu:
VS Code → View → Problems or ‘Ctrl-Shift-M’
Thanks for a quick reply.
- I have build the project with “daml build” as suggested, still the same. In fact, I have also executed “daml start” successfully with navigator and interacted with ledger via browser.
- I have imported Daml.Script in my Main.daml
3. I have Daml 1.1.1 extension by Digital Asset Holdings LLC in my VSC
any other possibilities?
I was reminded of this the other day; the Script function will not work if you did not open VS Code, using
daml studio in the base directory of your Daml app, the one that contains the `daml.yaml’.
Weird but true, it is actually a confirmed bug.
In this example, the file path is:
$ ls -al
quid@agis ~/Projects/daml/private-nft/nft ll
drwxrwxr-x 4 quid quid 4096 Jun 15 21:45 .
drwxrwxr-x 3 quid quid 4096 Jun 14 20:02 ..
drwxrwxr-x 4 quid quid 4096 Jun 15 21:45 .daml
drwxrwxr-x 2 quid quid 4096 Jun 9 12:49 daml
-rw-rw-r-- 1 quid quid 366 Jun 7 15:24 daml.yaml
-rw-r--r-- 1 quid quid 319 May 28 17:11 .dlint.yaml
-rw-r--r-- 1 quid quid 174 May 28 17:11 .gitattributes
-rw-r--r-- 1 quid quid 44 Jun 7 16:47 .gitignore
-rw-rw-r-- 1 quid quid 33385 Jun 11 19:42 navigator.log
-rw-rw-r-- 1 quid quid 3 Jun 14 18:04 package.json
-rw-rw-r-- 1 quid quid 82 Jun 14 18:04 package-lock.json
-rw-rw-r-- 1 quid quid 3414 Jun 11 15:14 sandbox.log
Open VS Code here
$ daml studio
Script should work, let me know.
That is an old version. The extension version should match SDK version. Are you on SDK 1.1.1? Could you try `daml install latest && daml studio?
daml install latest gives result – SDK version 1.13.1 is already installed.
I guess my VSC version(old) is not supporting latest version of Daml extension by Digital Asset Holdings LLC.
I’ll try to update VSC to latest and get back to you… cheers !!
If the vscode marketplace doesn’t work for you for whatever reason you can try running
daml studio --replace=always. That will install the extension matching the current project version. Note however that this extension will not autoupgrade.
You can run
daml studio --replace=published to go back to the extension from the marketplace which will autoupgrade (unless you disabled that in vscode).
I am surprised that VS Code would not auto-upgrade by default, as wouldn’t most people will be at the Stable version of the relevant, target programming language?
As said in my previous message in
updated VSC (1.57) and which in turn updated a new version of Daml extension by Digital Asset Holdings LLC (1.13.1) and then opened my project with command
daml studio --replace=always
Now i see “Script results” function in IDE.
No idea whether update fixed this issue or the above command.
The short explanation is that the extension installed by
daml studio --replace=always does not have the same name as the one you can get from the marketplace. If you install from the marketplace, you get auto-upgrades by default. But if you force the installation from
daml studio, as far as VSCode is concerned you have a local extension that does not exist in the marketplace so it simply cannot upgrade it automatically, as it has no idea where to get a new version.