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
Fix for incorrect highlighting in verbatim strings #13664
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anthony-c-martin
force-pushed
the
ant/grammar
branch
2 times, most recently
from
March 20, 2024 12:13
45bb5c2
to
5e7505f
Compare
Test this change out locally with the following install scripts (Action run 8375914687) VSCode
Azure CLI
|
anthony-c-martin
force-pushed
the
ant/grammar
branch
from
March 20, 2024 12:20
5e7505f
to
3d54b9a
Compare
anthony-c-martin
force-pushed
the
ant/grammar
branch
from
March 20, 2024 12:25
3d54b9a
to
ad13487
Compare
Comment on lines
+5
to
+18
export const baselineRecordEnabled = (process.env['BASELINE_RECORD']?.toLowerCase() === 'true'); | ||
|
||
export async function expectFileContents(filePath: string, contents: string) { | ||
if (baselineRecordEnabled) { | ||
await mkdir(path.dirname(filePath), { recursive: true }); | ||
await writeFile(filePath, contents, 'utf-8'); | ||
} else { | ||
// If these assertions fail, use 'npm run test:fix' to replace the baseline files | ||
expect(existsSync(filePath)).toBeTruthy(); | ||
|
||
const readContents = await readFile(filePath, { encoding: 'utf8' }); | ||
expect(contents).toBe(readContents); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic copied from the bicep-types repo, just to simplify updating of baselines.
jeskew
approved these changes
Mar 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed the following Bicep code was being highlighted incorrectly in VSCode + GitHub:
This PR fixes that and adds a baseline for it.
Previews visible here:
http://htmlpreview.github.io/?https://raw.githubusercontent.com/Azure/bicep/ant/grammar/src/monarch/test/baselines/strings.html
http://htmlpreview.github.io/?https://raw.githubusercontent.com/Azure/bicep/ant/grammar/src/highlightjs/test/baselines/strings.html
http://htmlpreview.github.io/?https://raw.githubusercontent.com/Azure/bicep/ant/grammar/src/textmate/test/baselines/strings.html
Microsoft Reviewers: Open in CodeFlow