Closed rsslldnphy closed 3 years ago
@rsslldnphy it sounds like you're running into the same problem that's described in #24?
hm running into the specific behaviour mentioned in #24 but yes definitely the same in that i'm having indentation issues within template literals. hopefully a fix for one will be a fix for both!
Fixed by #58
🎉 thanks @jparise !
actually this is still happening for me in typescript files :-(
looking at the updated tests in the PR, it looks like the javascript test asserts on the indentation behaviour i would expect:
but the typescript test asserts on different behaviour (i.e. the leading spaces being stripped away):
i am not super hot on vimscript but the ts/js after/indent files look almost identical to me so not sure what might be causing it!
@rsslldnphy I don't write much TypeScript. Could you provide an example of how you think the formatting should look?
Hi @jparise , yes no problem - in this case I think it should look exactly identical to the javascript version:
Expect (propertly indented):
const query = gql`
{
user(id: ${uid}) {
firstName
lastName
}
}
`;
Reopening this issue until we can sort out the remaining indentation problems with GraphQL syntax embedded within templates.
Hi, I'm not sure if this is meant to happen but I'm finding that graphql in template literals is having any leading spaces stripped away on indent. I usually indent my graphql template literals by 2 spaces, but with this text:
the command
gg=G
results in this:the query has now been shifted to the left so it's flush with the start of the line.
i've removed everything from my
~/.config/nvim/init.vim
apart from:is this expected behaviour? examples i've seen in the docs show template literals indented by two spaces - is there a config option i'm missing? thanks!
Vim Version