-
Notifications
You must be signed in to change notification settings - Fork 95
Indentation in gql` string literals is wrong, unconfigurable #258
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
Comments
I faced with same issue. Seems like it happens after upgrade plugin to 2.1 from 2.0 or idea to 2019.1.3 from EAP |
Same here. After updating WebStorm to 2019.1.3 have got 4 spaces indentation in string literals with no possibility to configure |
Same issue for me (using windows). |
Seems like this option is not working too. |
@EugeneDraitsev Try with tab size 1: |
Hmm, it appears the the "Other File Types" setting only applies to 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. |
Fixed in 2.2.0 pending JetBrains approval: Added Code Style settings page to control indentation |
I can confirm with the updated plugin that this fixes the problem. Thanks for getting it fixed so quickly. |
Version 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 ingql
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.The text was updated successfully, but these errors were encountered: