Skip to content
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

Fix indentation #152

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

thejohnfreeman
Copy link

There are 3 commits (right now) in this review. The first two updated to the latest indent file from 'pangloss/vim-javascript', and the third switched gears to HerringtonDarkholme/yats.vim. There are a few open issues with "indent" in their name:

I think TypeScript might be at the point that it deserves its own indent file, however, not one copied from JavaScript or Ruby. No one else is doing it, but I think this project, as the one chosen by sheerun/vim-polyglot for TypeScript, is the perfect candidate.

@leafgarland
Copy link
Owner

Hi, thanks for the very thorough write-up! I'm not going to get a chance to look at this for a day or two but will do as soon as I can.

This is just a thought but given that the indent file here is a copy anyway - do you think it is worth keeping one in this repo - perhaps this repo should focus on the syntax?

@brandoncc
Copy link

Any chance of getting this merged? Is it even up to date anymore?

@leafgarland
Copy link
Owner

@thejohnfreeman you mentioned using prettier instead, does that mean you have no more interest in this PR? If you still do, let me know as I'm happy to open up the repo to others who have more time.

@thejohnfreeman
Copy link
Author

You're right, I don't need this PR any more. You can close it or hand it off to someone else.

@aakropotkin
Copy link

Would be pretty nice to merge this in.

@sukima
Copy link

sukima commented Mar 23, 2019

@leafgarland what is blocking this PR? the indenting in TS is aweful and painful when writing code.

@thejohnfreeman You don't use Vim for coding anymore? If you do use Vim how do you get indenting working? This is confusing to have a PR fix a problem many are having and yet no option to fix the problem. It seems you did fix the problem with something magical called prettier. How do we enable this option in Vim?

@thejohnfreeman
Copy link
Author

@sukima I use ALE and Prettier.

let g:ale_fixers = {
      \  'javascript': ['prettier'],
      \  'typescript': ['prettier'],
      \}
let g:ale_fix_on_save = 1
$ yarn add -D prettier
# Once Prettier is installed in node_modules, ALE calls it automatically.

@leafgarland
Copy link
Owner

@sukima Nothing blocking it but having the author not use it makes me less keen to bring in a big change that nobody is vested in. Does this PR improve things for you?

@sukima
Copy link

sukima commented Mar 27, 2019

I don’t know I didn’t try it. I might try it later. All I know is that indentation doesn’t work and I (like others) would like it to work. I am curious why you haven’t run into this same issue especially if dog-fooding is important.

@aakropotkin
Copy link

Hey I’ve been using Prettier for the last several weeks, and while I like it, it is definitely not a Vim indent solution. Its more like GNU indent where it gets run on a whole file modifying it.

@leafgarland
Copy link
Owner

@sukima editing typescript is only a small part of my work currently and I have not had any issues with indenting. I am not in a position to dog-food this plugin anymore.

If anyone who does edit lots of typescript in vim would like to try this PR and say that it works better, then I am happy to merge it.

@mcabrams
Copy link

@leafgarland I spend most of my time either writing python or writing typescript (much of it in tsx) - I have definitely come to notice and struggle with the indenting in .tsx files.

At your suggestion, I tried to use this PR, and it had only been a couple hours so far, but I had noticed a definite improvement. There were still a few oddities, but it seems to have handled a few of the egregious issues. Then I looked, and saw that I hadn't even installed the pull request branch properly in Vundle, and I was just getting the experience without any typescript-vim installed! I'm not sure what exactly is causing the issue with the indentations in .tsx and typescript-vim, I'm not aware of any conflicting plugins I might have installed.

FWIW, I properly installed this pull request after my screw up, and noticed no improvement as far as indentation issues in .tsx files.

For now I have decided to opt for the indentation disable setting:
let g:typescript_indent_disable = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants