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

Support toplevel interpolations in graphql tags #3370

Merged
merged 4 commits into from Dec 3, 2017

Conversation

Projects
None yet
3 participants
@lydell
Collaborator

lydell commented Dec 1, 2017

Fixes #3318.

# comment
\${test} # comment
\`

This comment has been minimized.

@lydell

lydell Dec 1, 2017

Collaborator

All the comments after the interpolations here are currently moved to the next line. Is this a deal-breaker? This seems to require some larger changes to made.

This comment has been minimized.

@azz

azz Dec 1, 2017

Member

Probably not a deal-breaker. I'm guessing comments are pretty uncommon here. I've only ever used comments in GraphQL schemas.

@azz

This comment has been minimized.

Member

azz commented Dec 1, 2017

Multiparser refactor looks good. Haven't reviewed GraphQL changes properly yet but test outputs look good.

@lydell

This comment has been minimized.

Collaborator

lydell commented Dec 1, 2017

I need to figure out why the parentParser thing doesn’t work, though.

}
}
function fromMarkdown(path, options) {
function parseAndPrint(passedOptions) {

This comment has been minimized.

@duailibe

duailibe Dec 1, 2017

Member

You'd need to pass the previous and next options here so the parentParser thing works.. see printSubtree how it builds next.options but gets the parentParser from options

Right now, you have parser === parentParser

@lydell lydell changed the title from [WIP] Support toplevel interpolations in graphql tags to Support toplevel interpolations in graphql tags Dec 1, 2017

@lydell

This comment has been minimized.

Collaborator

lydell commented Dec 1, 2017

I think I'm happy with this now. Would be awesome if it could make it into the 1.9 release!

@duailibe duailibe added this to the 1.9 milestone Dec 1, 2017

@lydell

This comment has been minimized.

Collaborator

lydell commented Dec 2, 2017

Haven't reviewed GraphQL changes properly yet

@azz Do you want to take a look before merging, or should I just press the green button?

@azz

azz approved these changes Dec 3, 2017

@azz azz merged commit d80728b into prettier:master Dec 3, 2017

4 checks passed

codecov/patch 100% of diff hit (target 80%)
Details
codecov/project 97.06% (+0.1%) compared to 23c306c
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@lydell lydell deleted the lydell:gql-interpolations branch Dec 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment