Skip to content

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

Closed

Description

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

Activity

  1. changed the title [-]Indentation on paste is not aware of JSDoc comments[/-] [+]Indentation on paste is not aware of Doc comments[/+] on Jun 28, 2017
  2. changed the title [-]Indentation on paste is not aware of Doc comments[/-] [+]TypeScript - Indentation rules are not aware of Doc comments[/+] on Jun 28, 2017
  3. alexdima commented on Jun 28, 2017

    @alexdima
    MemberAuthor

    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.
    *--------------------------------------------------------------------------------------------*/
  4. rebornix commented on Jun 28, 2017

    @rebornix
    Contributor

    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 :(

  5. added
    bug
    on Jun 28, 2017
  6. rebornix commented on Jun 28, 2017

    @rebornix
    Contributor

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

  7. alexdima commented on Jun 29, 2017

    @alexdima
    MemberAuthor

    Nice!

  8. locked and limited conversation to collaborators on Nov 17, 2017
  9. added 6 commits that reference this issue on Sep 30, 2023
    abf66c6
    674b1f5
    0c8dce3
    72ee458
    189bf2b
    79e2097
  10. added 2 commits that reference this issue on Dec 23, 2023
    4e916e6
    6aacdf1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions