-
Notifications
You must be signed in to change notification settings - Fork 13
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 for string literal comments #21
Comments
Hi! these should be fixed and highlighted like normal strings in 1.0.0 . please share a screenshot if you run into any more trouble. |
Semi-related, but I used It took me about 5 hours to figure out my JSON kept breaking because those aren't parsed as comments anymore, but the syntax highlighting made it seem that way. I tried tracing the logic for this through here, and it seems this is not coming back from being a non-default feature flag in the parser.
Might be a good idea to disable that in the Atom language because it's pretty confusing to have what look like comments become the bug. |
Wow, so you can't even have non-description comments in the SDL? Interesting 😖 Atom lets you tell it how comments work: https://github.com/rmosolgo/language-graphql/blob/master/settings/language-graphql.json#L4 But if |
I could be totally wrong because I'm more "1 in 1000 depedencies" than "this is my baby" relative to GraphQL, but based on this it seems string literal I'm not an Atom extension expert either — hey, I can name most dinosaurs — but maybe change this: {
".source.graphql": {
"editor": {
"commentStart": "# "
}
}
} To this? {
".source.graphql": {
"editor": {
"commentStart": "\" ",
"commentEnd: " \""
}
}
} |
@rmosolgo It appears the current docstring syntax requires that every field definition be followed by a comma. That's not required in the spec, and newlines are valid. As such, my current schema sdl files don't use commas for field definitions and that breaks the syntax highlighting when using doc strings. |
Changing line 109 of
Highlights properly for me (no idea if this gets the scopes right, but not sure they were being used for anything meaningful). |
Commas in comments seem to break syntax highlighting after the comma. |
Not sure how to report properly on this, but I'm using the const typeDefs = gql`
"""
String input format MM-DD-YYYY
"""
scalar DateInput
input DateRangeInput {
start: DateInput
end: DateInput
}`; The |
as of graphql 0.12.3 you can now add comments as string literals
if we could highlight this somehow, maybe even as comments. note: they can be multi line.
The text was updated successfully, but these errors were encountered: