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

fix: Fix vscode-graphql-syntax’s grammar to support string literals on separate lines [Reapply & Fix] #3545

Merged
merged 4 commits into from Mar 16, 2024

Commits on Mar 11, 2024

  1. fix: Fix vscode-graphql-syntax’s grammar to support string literals o…

    …n separate lines (graphql#3518)
    
    * Allow newlines after `graphql(` before start of query string
    * Fix mistaken reverse order of optional `(` and generic `<.*>`
    * Replace `(` in second match with newline one
    * Match graphql calls separately for string literals inside calls
    * Add missing endCaptures to new rule
    kitten committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    3457af3 View commit details
    Browse the repository at this point in the history
  2. Remove lookbehind in grammar and add inner TS/JS source patterns

    Using a positive lookbehind can subtly break Textmate/VSCode’s syntax
    highlighting. The positive lookbehind (according to some online sources)
    can fail unexpectedly when they contain whitespace matches.
    
    This means that we should instead match explicitly, like the other
    patterns do. This means however, that we might match too much and
    I noticed that arguments to the function aren't highlighted correctly.
    
    According to the interpolation rule in `graphql.json` we now include
    patterns for JS/TS/etc as a fallback pattern.
    
    This fixes the issue and prevents the case where the rule was
    conflicting with normal JS/TS patterns in a different tmLanguage
    grammar.
    kitten committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    39cdd1e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    69cc36e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1bd052b View commit details
    Browse the repository at this point in the history