Adam S
05/31/2023, 8:50 AMexpr {}
syntax)
I’m not a fan of thesyntax to access the variables. I think they should be accessible directly, which makes the code look more Kotlinesque and helps with auto-complete discovery.expr {}
I expected to be able to use the variables directly, so I first tried, which failed."kotlin-konan-${runner.os}"
I wasn’t able to find anything close using auto-complete, so I tried using, which seemed to work but of course it’s not the ‘proper’ way. I had to look it up"kotlin-konan-\${{runner.os}}"
in the docs.expr {}
Adam S
05/31/2023, 8:52 AM```> expr { "${github.repository_owner} == 'typesafegithub' || ${github.event_name} != 'schedule'" }
> ```
^^ here is an example of why accessing directly the variables wouldn’t work, there would be multipleinstead of just one.${{ }}
The expression makes only sense… inside an expression bloc.
That’s whatis modellingexpr { }
@jmfayard https://kotlinlang.slack.com/archives/C02UUATR7RC/p1685520581717289?thread_ts=1685519816.431979&cid=C02UUATR7RChey 👋 I understand that the output is different, but I didn’t know there was a problem with having multiple
${{}}
. I can see some examples in the docs that have multiple
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
Adam S
05/31/2023, 8:56 AMcondition = "${github.repository_owner} == 'typesafegithub' || ${github.event_name} != 'schedule'",
which to me is more readable, but what’s I’m more focusing on is that it’s more discoverable. I can use autocomplete to get the variables, while expr {}
hides the variables and has no visible KDoc (because of an IJ bug?/feature?) so (as a new user) I have no idea that it’s supposed to be used. It’s awkward that I have to look up the details in the docsAdam S
05/31/2023, 9:00 AMgithub
valuejmfayard
05/31/2023, 9:11 AMexpr { }
https://github.com/typesafegithub/yaml2kotlinAdam S
05/31/2023, 9:18 AMAdam S
05/31/2023, 9:18 AMjmfayard
05/31/2023, 9:18 AMAdam S
05/31/2023, 9:19 AMjmfayard
05/31/2023, 9:19 AMVampire
05/31/2023, 10:37 AM@file:Import
usage.
The missing docs is the same why you cannot navigate to the source though the source archive would be available.
The issue to track is https://youtrack.jetbrains.com/issue/KTIJ-16532 and to mitigate it, just add the library to your production dependencies as long as you are editing the workflow scripts, then navigation to source and documentation work properly.