You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'reindent all lines' removes leading space in comment #19142
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/'use strict';classA{}
use the 'Reindent all lines' command
check out the file comment. The space before '*' has been removed
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Reacted by Derek Pavao, MrAnima, jpw and Sean Juarez
Block comment's indentation is currently handled by onEnterRules and not filtered out in Indentation Rules. There are actually two ways to mitigate this issue
Honor onEnterRules in Reindent lines, which is a breaking change
Yes, I'm not sure the typescript label is relevant here.
My use case is I'm about to sort out lots of formatting issues in a rough-looking ES6 codebase that does at least have JSDoc comments, and I think I cant use "Reindent lines" to do so without messing up the comments (thereby annoying linters, and/or changing the code style). I will have to subsequently do a regexp find & replace on all the block comments (also regexp may vary per file), or a lot of copy & pasting around :(
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
Activity
rebornix commentedon Jan 24, 2017
Block comment's indentation is currently handled by onEnterRules and not filtered out in Indentation Rules. There are actually two ways to mitigate this issue
unIndentPatternif possible.hexpunk commentedon Oct 11, 2018
FWIW, this affects pretty much all languages with doc comments, not just typescript. I experienced this bug today in a PHP file.
jpw commentedon Jun 12, 2019
Yes, I'm not sure the
typescriptlabel is relevant here.My use case is I'm about to sort out lots of formatting issues in a rough-looking ES6 codebase that does at least have JSDoc comments, and I think I cant use "Reindent lines" to do so without messing up the comments (thereby annoying linters, and/or changing the code style). I will have to subsequently do a regexp find & replace on all the block comments (also regexp may vary per file), or a lot of copy & pasting around :(
Also see this stackoverflow issue (I am not the author of that).
vscodebot commentedon Oct 11, 2019
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!