Field coloring varies based on newlines
See original GitHub issueActual Behavior
Field coloring varies depending whether the opening brace or directive is on the same line as the type definition. Especially in more complex cases (the Bar example below) it may be preferable to have directives on their own lines.
See field: String
below:
Expected Behavior
Colors don’t change based on locations.
Steps to Reproduce the Problem Or Description
Example code from screenshot:
type Foo1 {
field: String
}
type Foo2
{
field: String
}
type Bar1 @auth(rules: [
{ allow: groups, groups: ["Admin"] }
{ allow: groups, groups: ["Everyone"], operations: [read] }
]) {
field: String
}
type Bar2
@auth(rules: [
{ allow: groups, groups: ["Admin"] }
{ allow: groups, groups: ["Everyone"], operations: [read] }
]) {
field: String
}
Specifications
- GraphQL for VSCode Extension Version: 0.1.7
- VSCode Version: 1.32.3
- OS Name: macOS
- OS Version: Mojave
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Working with (wanted) line breaks and the Table > Email tools
I have a workflow that pulls from SharePoint, slices into various pieces based on project owner and status, and mails out separate tables ......
Read more >Prevent `less -R` from resetting colours across newlines
How do I tell less , with -R or otherwise, not to reset colors across newlines( \n )? Here's an example of what...
Read more >Replace space with new line - Unix & Linux Stack Exchange
The above says to substitute one or more whitespace characters ( \s\+ ) with a newline ( \n ). The -i parameter stands...
Read more >Make line breaks work when you render text in a React or Vue ...
Prove it, Cassidy · No changes · Replace with br · Use CSS white-space.
Read more >How to add Multi-Line Text to Fields in a PDF Forms Document
Java uses "\n" and "\r" to signify newline and carriage return characters. The interpretation of these characters varies across platforms.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just spent some hours to see if I could learn something about grammars and be able to fix it. With my very limited knowledge, what I found out was that as soon as the
{
is in a new line, it gets themeta.selectionset.graphql
scope.So if I modify the
graphql-operation-def
entry in the grammar file, to include#graphql-type-object
before#graphql-selection-set
then it all seemed to work fine.Unfortunately I am unaware of side effects of this change and probably will need several more hours to learn grammars, so I’m hoping it at leasts helps someone else.
@hkumar0132 possibly? if you’re familiar with regular expressions then definately. all these issues labelled “grammar” will just involve modifying the expressions in the grammar json files. here’s where to get started:
https://github.com/graphql/vscode-graphql#development