-
Notifications
You must be signed in to change notification settings - Fork 29.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
YAML incorrect highlighting #82300
Comments
(Experimental duplicate detection) |
Can you please provide a copy/pastable example? Does this reproduce with all extension disabled? |
Yes, I disabled all extensions and the problem persists. apiVersion: v1
kind: ConfigMap
metadata:
name: varnish-vcl
namespace: test
labels:
app: varnish
release: test
data:
vcl_synth_500.vcl: |
// Custom error
set resp.http.Cache-Control = "no-cache, max-age: 0, must-revalidate";
set resp.http.x-sitename = "test";
set resp.http.x-sitetitle = "test";
synthetic( {"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
background-color: #ffffff;
font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
text-align: center;
color: #656669;
}
#error-box {
margin-top: 100px;
}
#emoji {
font-size: 100px;
}
</style>
<title>"} + resp.http.x-sitetitle + {" - Something went wrong</title>
</head>
<body>
<div id="error-box">
<div id="error-message">
<span id="emoji">🤔</span>
<h1>Something went wrong, but it's not your fault.</h1>
<h2>We are working on it, please check back shortly.</h2>
</div>
</div>
<!--"} + resp.status + {"-->
</body>
</html>
"} );
return (deliver); |
VSCode gets its YAML grammar from Textmate: https://github.com/microsoft/vscode/blob/master/extensions/yaml/syntaxes/yaml.tmLanguage.json On the Textmate repo, they've discussed the same problem and determined that it's a problem with the parser and not the grammar: textmate/yaml.tmbundle#17 (comment) Hopefully this will help with tracking down the root of the issue. |
Thanks for the context @cthrasher! Based on the discussion in textmate/yaml.tmbundle#17 (comment), this is not something that's solvable with a Textmate grammar without adding an exception to the single line parsing (and single line parsing is fundamental to textmate). The real solution is #50140 or #77140 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
Hello,
I've been experiencing a problem with YAML files. Some files are not correctly highlighted:
Thanks.
The text was updated successfully, but these errors were encountered: