kcl-lang / vscode-kcl

VS Code KCL Extension
https://kcl-lang.io
Apache License 2.0
5 stars 12 forks source link

support embedded KCL editing #62

Open dansrogers opened 2 months ago

dansrogers commented 2 months ago

Feature Request

I would like KCL to support editing strings embedded in yaml block strings as is common with kcl functions.

Is your feature request related to a problem? Please describe:

The problem is that I don't benefit from the kcl extension when writing embedded kcl scripts. To work around this, I copy and paste that script into a temp file, edit it there, then paste it back.

Describe the feature you'd like:

I would like KCL to support code completion and syntax highlighting within yaml block strings that represent yaml code. There are extensions that do similar things such as https://marketplace.visualstudio.com/items?itemName=ruschaaf.extended-embedded-languages and https://marketplace.visualstudio.com/items?itemName=harrydowning.yaml-embedded-languages

Describe alternatives you've considered:

The alternative I'm using is copy-pasting the kcl script into another file, editing until I'm happy with it, then pasting it back.

I've also looked into (but not implementing) using oci containers to host my script -- but for scripts that are never reused and reasonable to embed, that results in a fairly large edit - test loop, and requires I have a solution for registry hosting, which i didn't need before. It also exposes a bunch of implementation details in a public registry that might create maintenance issues.

I've also looked into writing my kcl script containing yaml with kcl -- but the files I'm editing are crossplane compositions, which benefit from the upbound vscode extension for a variety of consistency checks.

Teachability, Documentation, Adoption, Migration Strategy:

I don't think a migration strategy would be required -- and users of the kcl lang vscode plugin would benefit in a wider range of scenarios.

Peefy commented 2 months ago

cc @He1pa