Skip to content

Folding of multi-line comments above certain JavaScript ES6 constructions #55249

@scriptfoundry

Description

@scriptfoundry
  • VSCode Version: 1.25.1
  • OS Version: OS X 10.12.6

Steps to Reproduce:

  1. Open VS Code
  2. Create new file
  3. Set language type to JavaScript
  4. Enter the following example code:
    /**
     * Return a sum
     * @param y {Number}
     * @param z {Number}
     * @returns {Number} the sum of y and z
     */
    function sum1(y, z) {
        return y + z;
    }

    /**
     * Return a sum
     * @param y {Number}
     * @param z {Number}
     * @returns {Number} the sum of y and z
     */
    const sum2 = (y, z) => {
        return y + z;
    };
  1. Attempt to fold each comment block. The first one folds. The second one has no folding mark and cannot fold.
  2. Shut down VS Code without closing this file
  3. Reopen VS Code
  4. Folding marks will appear briefly before the second comment but it will not be clickable and will disappear after about a second. No comments appear in the developer's console.
  5. Change the sum2 function to a normal (ES5) function declaration and the comment folding marks reappear and the comment folds normally.

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

Notes:

While searching for a way to duplicate, I found that this same multi-line-comment folding behaviour happened in other languages, including C, C# and PHP, but I could not find any way to replicate it in Java. I have no idea if this problem is actually present in these other languages.

Metadata

Metadata

Assignees

Labels

editor-foldingEditor code folding issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions