Skip to content

Buggy Indentation in Markdown Code Blocks in IntelliSense Tooltips #37717

@Neonit

Description

@Neonit

TS Template added by @mjbvz

TypeScript Version: 3.9.0-dev.20200330

Search Terms

  • hover / quickinfo
  • jsdoc

  • VSCode Version: 1.43.2
  • OS Version: Windows 10 Pro

Steps to Reproduce:

  1. Copy the following code into a JS or TS file in VS Code:
    /**
    	In the following code block of this tab-indented documentation comment the base indentation is not removed for code lines starting with a whitespace (file lines 5, 10, 11). Also, all tabs are replaced by four spaces each.
    	```txt
    	1234567890
    		1234567890
    	1	234567890
    	123	4567890
    	1234	567890
    	12345678	90
    	 1234567890
    	    1234567890
    	```
    */
    function tab_indented_comment() {}
    
    /**
        In the following code block of this space-indented documentation comment the base indentation is not removed for code lines starting with a whitespace, but replaced with one space (file lines 20, 22, 23).
        ```txt
        1234567890 (no indentation)
          1234567890 (2 spaces)
        1234567890 (no indentation)
         1234567890 (1 space)
            1234567890 (4 spaces)
        ```
    */
    function space_indented_comment() {}
    
    /**
    In the following code block of this unindented documentation comment any tab indentation is removed (file lines 32, 33). Any space indentation with less than four spaces is removed (file lines 34, 35, 36). Any space indentation with four spaces or more is reduced by two spaces (file line 37, 38).
    ```txt
    1234567890 (no indent)
    	1234567890 (1 tab)
    		1234567890 (2 tabs)
     1234567890 (1 space)
      1234567890 (2 spaces)
       1234567890 (3 spaces)
        1234567890 (4 spaces)
          1234567890 (6 spaces)
    ```
    */
    function unindented_comment() {}
    
    /**
     * In the following code block of this star-prefixed documentation comment the offset space after the star is only removed from the first line (file line 46). It is added to all other lines. Also, all tabs are replaced by four spaces each.
     * ```txt
     * 1234567890 (no indent)
     * 	1234567890 (1 tab)
     * 		1234567890 (2 tabs)
     *  1234567890 (1 space)
     *   1234567890 (2 spaces)
     *    1234567890 (3 spaces)
     *     1234567890 (4 spaces)
     *       1234567890 (6 spaces)
     * ```
     */
    function starprefixed_comment() {}
    ```
  2. Have a look at the IntelliSense tooltips and the code block indentation. Screenshots here: https://imgur.com/a/2DpdXCv

Does this issue occur when all extensions are disabled?: Yes


Why are tabs converted to spaces at all? Don't do that. Just set tab-size: 4 in the CSS. Even better: Make the CSS configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions