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

Bicep Syntax Highlighting missing on docs.microsoft.com #2662

Closed
afscrome opened this issue May 13, 2021 · 6 comments
Closed

Bicep Syntax Highlighting missing on docs.microsoft.com #2662

afscrome opened this issue May 13, 2021 · 6 comments
Labels
enhancement New feature or request revisit

Comments

@afscrome
Copy link
Contributor

Bicep version
N/A

Describe the bug
Syntax highlighting isn't showing up on docs.microsoft.com for bicep code snippets

To Reproduce
https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/bicep-file#resource-and-module-decorators

I'd expect snippets such as the following to have syntax highlighting:
image

@ghost ghost added the Needs: Triage 🔍 label May 13, 2021
@alex-frankel
Copy link
Collaborator

It's planned and we actually already have the highlight.js grammar done.

Unfortunately, docs.microsoft.com is going through some architectural changes w.r.t. syntax highlighting that are blocking us from making progress.

Current ETA is end of this calendar year :(

@alex-frankel alex-frankel added this to the Committed Backlog milestone May 14, 2021
@alex-frankel alex-frankel added revisit enhancement New feature or request and removed Needs: Triage 🔍 labels May 14, 2021
@Jaykul
Copy link
Contributor

Jaykul commented Jul 2, 2021

Looks like there's some syntax highlighting now, but it's got some bugs. Keywords are being highlighted in the middle of strings?

image

@alex-frankel
Copy link
Collaborator

Closing this one since at least the first iteration is done. @Jaykul - the reason this is happening is due to the simplicities of TextMate grammars which power syntax highlighting on docs.microsoft.com and GitHub. The syntax highlighting in the VS code extension is powered by semantic highlighting which is much more robust. Unfortunately, unless we can switch to semantic highlighting there will be odd quirks like this going forward.

@Jaykul
Copy link
Contributor

Jaykul commented Jul 3, 2021

@alex-frankel I hear you, but ... not highlighting the things inside strings is definitely doable even in regex grammars. I mean, we've all been using regex-powered syntax highlighting for a couple decades (notepad++, scintilla, textmate, sublime, etc) and let's be honest, most of the languages being highlighted on docs.microsoft.com are more complex than this one 😉

@alex-frankel
Copy link
Collaborator

To the extent that we can fix it easily, I am all for it. I was mostly trying to provide context as to why there is a highlighting mismatch between docs and our tooling.

Can you file a separate issue for this one so we can track it? cc @anthony-c-martin as FYI

@anthony-c-martin
Copy link
Member

I suspect this is happening because expression defined in the hightlight.js grammar is referencing KEYWORDS:

const expression: Mode = {
keywords: KEYWORDS,
variants: [
/* placeholder filled later due to cycle*/
],
};

@ghost ghost locked as resolved and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request revisit
Projects
None yet
Development

No branches or pull requests

4 participants