Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow usage of bicep code in decorators #11977

Open
slavizh opened this issue Sep 29, 2023 · 5 comments
Open

Allow usage of bicep code in decorators #11977

slavizh opened this issue Sep 29, 2023 · 5 comments
Labels
enhancement New feature or request Needs: Upvote This issue requires more votes to be considered

Comments

@slavizh
Copy link
Contributor

slavizh commented Sep 29, 2023

Is your feature request related to a problem? Please describe.
I have the following example:

main.bicep

var defaultValue: {
  test: 'foo1'
}

type foo = {
  @description('Some description. Default value: ${defaultValue.test}')
  property1: 'foo1' | 'foo2'?
}

param foo foo

As you see in VSC the description does not work. That happens when you use bicep code inside description decorator. VSC does not throw any errors on main.bicep so it is expected this to work but in reality it does not.

image

The scenario here is that I just want to reference those default values as that way I can only have them in once place and upon changing I do not have to change them on multiple times. This is also useful when you have some content that is saved in text files like Kusto queries for which you can just reference that text file instead of adding the whole query all over again.

Describe the solution you'd like
A clear and concise description of what you want to happen.

@jeskew
Copy link
Contributor

jeskew commented Sep 29, 2023

This should raise an error diagnostic as of Bicep 0.21.1:

image

Which version of the VS Code extension is being used?

@slavizh
Copy link
Contributor Author

slavizh commented Oct 2, 2023

@jeskew yeah, seems now I get error. Previously there must be some crash or problem with bicep cli/extension as I was not getting that error but now on re-opened VSC I am getting it. Any chance being able to support that or it is too complex to implement? I am working on a schema for one solution and if needed I can share the code in private to check how UDT are implemented in real world template.

@shenglol
Copy link
Contributor

@slavizh Do you have other scenarios that require this functionality other than just for rendering default values?

@slavizh
Copy link
Contributor Author

slavizh commented Oct 12, 2023

@shenglol not at this point

@stephaniezyen stephaniezyen changed the title Allow usage of bicep code in decorators for user dfined types Allow usage of bicep code in decorators Oct 18, 2023
@shenglol
Copy link
Contributor

Related to #444.

@alex-frankel alex-frankel added Needs: Upvote This issue requires more votes to be considered and removed Needs: Attention 👋 labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs: Upvote This issue requires more votes to be considered
Projects
Status: Todo
Development

No branches or pull requests

5 participants