Skip to content

Pressing enter at end of line on generator method in TS/JS duplicates leading asterisk #100030

Closed
@rbuckton

Description

@rbuckton
  • VSCode Version: 1.47.0-insider (user setup)
  • Commit: 6af2987
  • Date: 2020-06-11T13:30:35.121Z (1 day ago)
  • Electron: 7.3.1
  • Chrome: 78.0.3904.130
  • Node.js: 12.8.1
  • V8: 7.8.279.23-electron.0
  • OS: Windows_NT x64 10.0.18363

Steps to Reproduce:

  1. Create a new TS or JS file
  2. Add a class with a generator method that has a leading multiline or JSDoc comment.
    • NOTE: There must be a space between the * token and the method name.
  3. Place cursor at the end of the line that starts the generator method body and press enter.

Expected:
4. A new line is added with the correct indentation.

Actual:
4. A new line is added indented to the same level as the method name and an asterisk (*) is added as if this were a line continuation of a multiline or JSDoc comment.

generator-multiline

Notes:

  • This does not occur if the method does not start with a multiline or JSDoc comment.
  • This does not occur if there is no space between the asterisk (*) and the method name.
  • This does not occur for functions (as there is a leading function keyword between the start of the line and the asterisk (*)
  • This does not occur for generator methods with a leading keyword before the *, such as static or async in JS or static, async, public, private, or protected in TS.

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

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code InsidersjavascriptJavaScript support issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions