rmosolgo / language-graphql

GraphQL support for Atom text editor
MIT License
57 stars 13 forks source link

Syntax highlighting for new description syntax #17

Closed kbrandwijk closed 6 years ago

kbrandwijk commented 6 years ago

Hi, the latest GraphQL spec updated the description syntax: https://github.com/graphql/graphql-js/pull/927. This is not supported by the current syntax highlighting. An example:

"""
Description that is

spanning multiple lines
"""
type Test {
   "Field description"
   field: String
}

The current comment element is here: https://github.com/rmosolgo/language-graphql/blob/master/grammars/graphql.json#L162-L169 but for backwards compatibility, I think two new elements (descriptionline and descriptionblock) might be best?

rmosolgo commented 6 years ago

Thanks for opening the issue! Yes, I think you're right that adding new elements would be best. AFAIK, "block strings" (delimited with """) are valid anywhere that a string is allowed, right? So, maybe we should add rules for block strings? (https://github.com/facebook/graphql/pull/327)

kbrandwijk commented 6 years ago

Yes, but those are two different things. Block strings are allowed for field values (so in input values). This issue is about descriptions, which can be normal strings or block strings.