calva icon indicating copy to clipboard operation
calva copied to clipboard

bad calva.autoEvaluateCode settings causes errors during activation

Open ollemartensson opened this issue 1 year ago • 1 comments

When I started to use Calva for the first time copilot suggested nonsense configuration(like it so often does) in the settings.json and I kept the calva.autoEvaluateCode part of it since I wanted to remember to check it out later and it looked like placeholder config.

Then I started to get indications that calva was not active when the calva key-bindings did not work anymore.

I did not know what was wrong at first so I started to discuss this in a slack thread:

Like I described there this is the steps I took to investigate this further:

  1. Uninstalled VSCode and erased all earlier settings and data.
  2. Downloaded the latest VSCode the erased all earlier VSCode settings.
  3. Opened up a clojure project with a deps.edn in it.
  4. Installed the calva extension.
  5. Ran: Developer: Show Running Extensions which are hanging in Activating... state.
  6. Ran: Developer: Show Logs > Extension Host showing the following error:

snippet.log

After a while I started to remove calva config section by section and found that:

;; removing this fixes the problem
"calva.autoEvaluateCode": {
        "onFileLoaded": {
            "enabled": true,
            "exclude": []
        },
    }
;; this does not work 
"calva.autoEvaluateCode": {
        "onFileLoaded": {
            "clj": ""
        },
    }
;; Neither does this:
"calva.autoEvaluateCode": {}

So it seems to me that the parsing of config probably should be more resilient but I leave it up to you to decide how to take this further :)

ollemartensson avatar Jun 05 '24 12:06 ollemartensson

I agree we probably should at least sanity check this crucial configuration and warn about it if it looks funny.

PEZ avatar Jun 21 '24 09:06 PEZ