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

YAML incorrect highlighting #82300

Closed
Dijir opened this issue Oct 11, 2019 · 6 comments
Closed

YAML incorrect highlighting #82300

Dijir opened this issue Oct 11, 2019 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar

Comments

@Dijir
Copy link

Dijir commented Oct 11, 2019

Hello,

I've been experiencing a problem with YAML files. Some files are not correctly highlighted:
yaml
yaml2

Thanks.

  • Version: 1.39.0-insider (user setup)
  • Commit: c8252b6
  • Date: 2019-10-04T09:24:45.690Z
  • Electron: 4.2.10
  • Chrome: 69.0.3497.128
  • Node.js: 10.11.0
  • V8: 6.9.427.31-electron.0
  • OS: Windows_NT x64 10.0.18995
@vscodebot
Copy link

vscodebot bot commented Oct 11, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@alexr00
Copy link
Member

alexr00 commented Oct 11, 2019

Can you please provide a copy/pastable example?

Does this reproduce with all extension disabled?

@alexr00 alexr00 added info-needed Issue requires more information from poster grammar Syntax highlighting grammar labels Oct 11, 2019
@Dijir
Copy link
Author

Dijir commented Oct 15, 2019

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">&#x1f914;</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);

@cthrasher
Copy link

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.

@alexr00
Copy link
Member

alexr00 commented Nov 1, 2019

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

@alexr00 alexr00 added *duplicate Issue identified as a duplicate of another issue(s) and removed info-needed Issue requires more information from poster labels Nov 1, 2019
@vscodebot
Copy link

vscodebot bot commented Nov 1, 2019

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!

@vscodebot vscodebot bot closed this as completed Nov 1, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar
Projects
None yet
Development

No branches or pull requests

3 participants