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 typescript indentation #431

Closed
wants to merge 1 commit into from
Closed

Fix typescript indentation #431

wants to merge 1 commit into from

Conversation

dkns
Copy link

@dkns dkns commented Sep 6, 2019

After latest update I noticed that my .ts files were no longer indenting. 664aa98 is the first commit that introdcues this behaviour.

Removing runtime! indent/javascript.vim from indent/typescript.vim seems to fix this issue although I'm not sure if it won't break anything else in the process as I'm not really familiar with vimscript.

I can provide more info if needed.

@sheerun
Copy link
Owner

sheerun commented Sep 6, 2019

Probably connected to MaxMEllon/vim-jsx-pretty#86

Man I'm tired of these typescript issues, I think I'll just switch provider to yats

@sheerun
Copy link
Owner

sheerun commented Sep 6, 2019

btw. I cannot merge this because we don't modify upstream files

@sheerun
Copy link
Owner

sheerun commented Sep 6, 2019

@dkns Could you check if newest version of vim-polyglot works for you? I've switched provider to yats

@dkns
Copy link
Author

dkns commented Sep 6, 2019

@sheerun I think there might be some issue on my part. I created this mini vimrc:

set nocompatible
set runtimepath^=/home/user/.config/nvim/plugged/vim-polyglot
filetype plugin indent on
syntax on
set hidden

then created this typescript file

class Student {
    fullName: string;
    constructor(public firstName: string, public middleInitial: string, public lastName: string) {
        this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
}

interface Person {
    firstName: string;
    lastName: string;
}

function greeter(person: Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
}

let user = new Student("Jane", "M.", "User");

document.body.textContent = greeter(user);

And when I run nvim -u mini.vim foo.ts it works i.e. it indents properly. But it doesn't work with my full vimrc.

@sheerun
Copy link
Owner

sheerun commented Sep 6, 2019

I'll be tracking it here: #432

@dkns dkns deleted the fix-typescript-indentation branch September 11, 2019 13:17
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.

2 participants