question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: Support graphql tagged heredoc string literals in non-js files

See original GitHub issue

Thanks for making this awesome plugin. Works great for our js codebase

However our graphql api is written using graphql-ruby and so all of our graphql specs are Ruby files. In these files we define heredoc string literals like this:

# spec/whatever_spec.rb

<<~GRAPHQL
  query Whatever {
    whatever {
      id
    }
  }
GRAPHQL

Would it be possible to support Ruby files with this plugin?

If so, is it something a new contributor would be able to tackle? I wouldn’t mind taking a stab at implementing it if someone gives me a few pointers where to start.

Thanks again!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TSMMarkcommented, Dec 3, 2020

@acao Still very interested in this but not sure how to start or how to test. Also I have no need for syntax highlighting, as that’s covered by another plugin I’m using https://marketplace.visualstudio.com/items?itemName=kumar-harsh.graphql-for-vscode

parsing ruby on the language server side for full-featured language support is another matter

Would we actually need to parse the Ruby language just to examine query strings? I found this opal package, something like that? https://github.com/opal/opal

0reactions
acaocommented, Apr 19, 2022

the language grammar files are where this happens for highlighting. they are json files with regular expressions for selecting tokens. if you see a graphql highlighting mode another extension has, you can open a PR

for actually supporting language features other than highlighting, that logic lives in the seperate LSP server repo that this repo depends on

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for string literals as description · Issue #196
A small concern, the GraphQL specification states that comments start with #. This will remain right? Because I see that "Support descriptions; ...
Read more >
vim-graphql
A Vim plugin that provides GraphQL file detection, syntax highlighting, ... GraphQL syntax inside of heredoc and nowdoc strings is supported.
Read more >
gatsby - How Can I Call a Template Literal Tag Function on ...
My question is, is there any way to "call that tag function" (or really any template literal tag function) on an ordinary (...
Read more >
autotests/input · master · Frameworks / Syntax Highlighting ...
Name Last commit Last update themes improve themes showcase to show more styles 2 years ago .gitignore Git Ignore: more highlight 2 weeks ago Dockerfile Add...
Read more >
libKF5SyntaxHighlighting5-5.71.0-lp152.1.1 RPM for ppc64le
0: * debchangelog: add Groovy Gorilla * fix unit test refs * Updated test file for Logtalk syntax highlighting * Update Logtalk language...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found