[Typescript][Angular2] Annotations with access modifiers and reformatting code


I am running into a problem where annotations followed by an access modifier are reformatted weirdly. Example:

constructor(@MyAnnotation private _myArg: string) {}

will be formatted into


                  private _myArg: string) {}


I would like to keep the annotation and the argument specification on the same line. Funny thing is that if you leave the access modifier away (remove private), the formatter will keep it on the same line. 

Already found this old topic:http:// https://intellij-support.jetbrains.com/hc/en-us/community/posts/206988665-reformat-code-with-annotation but I am unable to find anything called 'Field anotations' in the Code Style > TypeScript settings. 

1 comment
Comment actions Permalink

Hi there,

AFAIK it's https://youtrack.jetbrains.com/issue/WEB-20849 (already fixed; wait for next update)

Also: https://youtrack.jetbrains.com/issue/WEB-20691 (still pending)


Please sign in to leave a comment.