Daml CodeLens inconsistently working

Hi everyone! first time posting here.

I am having a problem with codelens. VSCode has been very inconsistent in showing me the “Script results” codelens above the setup script = do line of code of the main.daml file in the tutorials. It sometimes appears and some other times it does not, and feels like magic to me.

I have already tried activating and deactivating the codelens editor value of the settings.json file of VSCode, and honestly I do not think it solves the issue.

I am following the introduction to DAML videos from Levente.
If anyone has experienced the same thing, and has some pointers on how to solve it, please share them :smiley:

1 Like

Hi @LimitBreaker98 and welcome to the forum!

Sorry to hear that you’re having issues, I’ve heard this occasionally but unfortunately I’ve never been able to reproduce it. Can you reproduce this on the skeleton project that you get from daml new foobar? It would also be great if you could share:

  1. Your vscode version
  2. The version of the vscode extension for Daml
  3. Your SDK version
  4. Any other vscode extension that you enabled.

I don’t expect disabling & reenabling code lenses to do anything. What you can try is Control/Command-Shift-P -> Reload Window which restarts the language server and might help but that’s only a workaround not a fix.

2 Likes

Thanks for the suggestion! Apologies for the late reply, was very busy with university :). Will keep up with whatever I see for this issue and reply in the future. For me it just works inconsistently and I haven’t figured out how to reproduce it.

Regarding the questions:

VsCode Version: 1.61.0
Daml extension: v1.17.1
SDK version declared on daml.yaml: v1.16.0 (Will try updating to latest to see if it fixes anything)
4. Bunch of extensions, over 33 :).

Thank you for your help!

So I think I figured out how to make it work. Basically, if you just disable all of your extensions except the DAML one, it loads the codelens behavior automatically. I do not have time to check through all of my extensions one by one to see which ones are conflicting, but if someone is in the need of just writing DAML, this workaround should suffice.