Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Highlight embedded graphql #187

Merged
merged 1 commit into from
Jan 11, 2017
Merged

Highlight embedded graphql #187

merged 1 commit into from
Jan 11, 2017

Conversation

rmosolgo
Copy link
Contributor

image

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

I recently discovered that language-ruby will highlight SQL inside <<-SQL heredoc blocks. Cool!

I often use <<-GRAPHQL to write inline GraphQL queries, so I thought, maybe I can modify language-ruby to highlight GraphQL within those blocks.

This PR adds GraphQL highlighting within <<-GRAPHQL heredoc blocks, as shown above.

Alternate Designs

I didn't consider alternate designs, I just copied and modified one of the other heredoc highlighters.

Benefits

GraphQL users can have highlighted GraphQL inside their Ruby files.

Possible Drawbacks

This introduces a maintenance burden: more lines of code means more things that can break 😬

This heredoc highlighter is not tested. I didn't find tests for the others, either. Are there any?

Applicable Issues

Fixes #173

Thanks for considering this change!

'beginCaptures':
'0':
'name': 'punctuation.definition.string.begin.ruby'
'contentName': 'source.sql'
Copy link
Contributor

@50Wliu 50Wliu Jan 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source.graphql

'include': '#interpolated_ruby'
}
{
'include': 'source.sql'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do believe you meant source.graphql here?

@rmosolgo
Copy link
Contributor Author

😆 Sorry about that. I was having a hard time testing out the changes locally, and I ended up with two different copies of the source. Apparently I pushed the wrong one! Force-pushed with corrections.

@50Wliu 50Wliu merged commit c4b5e5f into atom:master Jan 11, 2017
@50Wliu
Copy link
Contributor

50Wliu commented Jan 11, 2017

Thanks!

@rmosolgo
Copy link
Contributor Author

Hi, is there a release schedule for this project? I'm looking forward to this feature but I'm happy to wait if a release is planned sometime in the future.

@50Wliu
Copy link
Contributor

50Wliu commented Jan 25, 2017

It's currently planned to be included in the Atom 1.15.0 release. We don't publish release dates, however.

@rmosolgo
Copy link
Contributor Author

Thanks for the info, I'll keep an eye out for that Atom release!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: GraphQL Heredoc highlighting
2 participants