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

TypeScript - Indentation rules are not aware of Doc comments #29753

Closed
alexdima opened this issue Jun 28, 2017 · 4 comments · May be fixed by #201421
Closed

TypeScript - Indentation rules are not aware of Doc comments #29753

alexdima opened this issue Jun 28, 2017 · 4 comments · May be fixed by #201421
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@alexdima
Copy link
Member

Have a TypeScript file configured with Tabs@4

// IMacLinuxKeyMapping
class A {
	/**
	 * used only for debug purposes.
	 */
	private readonly _codeInfo: KeyMapping[];
}

Select IMacLinuxKeyMapping and paste it on top of KeyMapping

indent-on-paste

@alexdima alexdima changed the title Indentation on paste is not aware of JSDoc comments Indentation on paste is not aware of Doc comments Jun 28, 2017
@alexdima alexdima changed the title Indentation on paste is not aware of Doc comments TypeScript - Indentation rules are not aware of Doc comments Jun 28, 2017
@alexdima
Copy link
Member Author

alexdima commented Jun 28, 2017

Another test case is pasting our copyright header when creating a new .ts file. It drives me crazy that the copyright header linter always fails while committing:

Pasting the following in a TypeScript file results in the leading spaces being stripped:

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

===>

/*---------------------------------------------------------------------------------------------
*  Copyright (c) Microsoft Corporation. All rights reserved.
*  Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

@rebornix
Copy link
Member

Auto indent should honor onEnter rules while guessing the good indent. Already have this fixed for moving lines, but not pasting.

I cannot get rid of onEnter rules any more :(

@rebornix rebornix added the bug Issue identified by VS Code Team member as probable bug label Jun 28, 2017
@rebornix rebornix modified the milestones: July 2017, June 2017 Jun 28, 2017
@rebornix
Copy link
Member

This two issues are fixed by ignoring Comments and honor onEnter rules when pasting.

@alexdima
Copy link
Member Author

Nice!

@alexdima alexdima added the verified Verification succeeded label Jun 29, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
russelldavis added a commit to russelldavis/vscode that referenced this issue Sep 30, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing
this special handling gives us the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Oct 1, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Oct 2, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Oct 3, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Oct 7, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Oct 12, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Dec 23, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
russelldavis added a commit to russelldavis/vscode that referenced this issue Dec 23, 2023
The special handling for comments was originally added in 886f472
to fix microsoft#29753, but it had the side effect of preventing a desired auto
indent in the majority of cases when pasting lines beginning with a
comment (basically, all cases except multiline docblock style comments
at the leftmost indentation level). That case has since been solved in
a different way by e77b196, so removing this special handling gives us
the best of both worlds.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants