Indentation in gql` string literals is wrong, unconfigurable
See original GitHub issueVersion and Environment Details
Operation system: macOS 10.14.5
IDE name and version: InteliJ IDEA Ultimate 2019.1.3
Plugin version: v2.1.0
Expected Behaviour
I should be able to configure the number of spaces used for indentation in .graphql
files and in gql
string literals. These two indentation setups should be the same.
Actual Behaviour
In my current setup I have my JS files set to indent code at 2 spaces. When these files include gql string literals the indentation within that gql code is 4 spaces. In my fully GraphQL files like thing.graphql
the indentation is handled with 2 spaces.
In this issue #180 there is a mention of the GraphQL pane in the Preferences > Code Style. I don’t see this pane any longer. Was it removed, or do I have something misconfigured? Forgive me if this is something wrong about my install. I couldn’t find any details about how to set this in past issues or the existing documentation.
Steps to Reproduce / Link to Repo with Reproduction and Instructions
Create a .js file, add a gql
string literal. If you have your Javascript indent spaces set to 2 spaces, the gql fragment will still get set to 4 spaces.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:10
Top GitHub Comments
Hmm, it appears the the “Other File Types” setting only applies to
.graphql
files and not injected GraphQL in JavaScript.I haven’t changed anything between 2.0 and 2.1 so not sure what’s going on. Could be a change in how the IntelliJ platform formats injected languages.
It’s likely that the code style page for GraphQL needs to be reintroduced to fix this.
@jimkyndemeyer
Seems like this option is not working too.