Monday, August 20, 2018

How to wrap parameter in VS Code?

What is the right setting for wrapping parameter in VS Code on the same level?

This is what i have:

constructor(private stateParams: angular.ui.IStateParamsService, 
  private $interval: angular.IIntervalService) {

This is what i would like to:

constructor(private stateParams: angular.ui.IStateParamsService, 
            private $interval: angular.IIntervalService) {

Solved

I'd also like to know how, shame this is not implemented by default..

The only workaround I could come up with is to install a plugin like Better Align and do the following :

constructor(
    private translate:    TranslateService,
    private _titleSetter: TitleSetterService,
    private _i18nLoader:  TranslationFilesLoaderService,
    private _router:      Router,
    private _formBuilder: FormBuilder
) {

which, BTW, can be done without the plugin and would look like this :

constructor(
    private translate: TranslateService,
    private _titleSetter: TitleSetterService,
    private _i18nLoader: TranslationFilesLoaderService,
    private _router: Router,
    private _formBuilder: FormBuilder
) {

but it provides you some other features on how to align your code.

Hope it helps a bit..


Perhaps this?

"editor.wrappingIndent": "same"

No comments:

Post a Comment