Hi,
I would like to mention a minor annoyance in the VS Code extension.
The cci-language-server
always reports an error when I am trying to pass an enum parameter to a command that expects a string parameter. This is however perfectly ok, as enum parameter is just a string parameter restricted to a few values. Once committed and pushed, the pipeline reports no errors and runs correctly.
The problem happens only when the command is my own or from a third-party orb. There are no complaints about passing to a string-consuming CircleCI builtin command, such as store_artifacts
.
A workaround is to concatenate the parameter with an empty string, but it is confusing and adds a space at the end I believe.
Here is a copyable version of the code:
version: 2.1
orbs:
android: circleci/android@2.3.0
commands:
stringeater-choking-on-enums:
parameters:
string-parameter:
type: string
steps:
- run: echo "do nothing"
jobs:
parametric-job:
resource_class: large
docker:
- image: cimg/android:2021.12.2-node
parameters:
enum-parameter:
type: enum
default: apple
enum:
- apple
- orange
steps:
- store_artifacts:
path: << parameters.enum-parameter >>
- stringeater-choking-on-enums:
string-parameter: << parameters.enum-parameter >>
- stringeater-choking-on-enums:
string-parameter: << parameters.enum-parameter >> ""
- android/fastlane-deploy:
lane-name: << parameters.enum-parameter >>
workflows:
build:
jobs:
- parametric-job:
enum-parameter: apple
- parametric-job:
enum-parameter: orange
Also, perhaps off topic, I cannot get any suggestions or error reprimands from the same cci-language-server
when I am editing a command that lives in its own yml
file in an orb repository. That is, the functionality is limited to the .circleci/config.yml
file of any repository. Is this the way it is, or did I just fail to activate some setting?
These autosuggestions and error highlighting are a godsend and it would be pleasant to have them also when editing an orb.
Thanks!