-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bicep: Resolved TODO + improvements #3028
Conversation
This is brilliant! And yes the highlighting makes sense.
These are the array functions for ARM templates If the regex you mention covers camel case words without spaces (and I think it does) then it could work |
Question: how do you get to see the highlighting? Is there a way to test locally? I was just basing my work on the test results - I didn't realise there was an alternative! Also, would it be better to have a different name for the file |
Yes, it does. I'll remove the ARM template functions then since they are already highlighted by the function regex.
Yes, you can use the local version of the test page. Just open
True, it has data types. However, we use the token name I'll just name the token |
Great work! |
Hey @RunDevelopment ! Do you have an idea when you're likely do the next release of prism? I'm really looking forward to using Bicep - but can't until a new version ships! |
@johnnyreilly In about a month. In the meantime, it is available on our download page and you can configure npm to get prism directly from this repo. Our master branch is always stable. |
Thanks - in my case I'm going to be consuming it via Docusaurus and so it won't be until the new version that I'll be able to consume this. I look forward to next month! |
Interestingly I did give adding this dependency to my Docusaurus "prismjs": "PrismJS/prism", and updating my prism: {
additionalLanguages: ["bicep"],
}, But when I ran I experienced this issue:
Not sure if this is a sign of an issue - or just user error on my behalf. Thought I'd mention it just in case this is significant. |
That should work, I think. It might be some dependency problem. Could you please check the following:
|
yes - it looks like it's a transitive dependency issue with I was able to workaround it by adding the following to the "resolutions": {
"prismjs": "PrismJS/prism"
}, |
I ended up writing this up here: https://blog.johnnyreilly.com/2021/08/19/bicep-syntax-highlighting-with-prismjs |
This PR resolves the TODO for interpolated strings and multiline strings.
I also added highlighting for object properties, data types, and arbitrary functions.
@johnnyreilly
I never used Bicep. Does this highlighting make sense?
Also, this is a bit late, but what are these function names? Will the more general function detection I used (
/\b[a-z_]\w*(?=[ \t]*\()/i
) find them as well?