Skip to content

fix(javascript): sync JSDoc continuation patterns with TypeScript language config - #308433

Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
microsoft:mainfrom
yogeshwaran-c:fix/js-ts-language-config-jsdoc-sync
Jul 27, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 2 commits into
microsoft:mainfrom
yogeshwaran-c:fix/js-ts-language-config-jsdoc-sync

Conversation

@yogeshwaran-c

Copy link
Copy Markdown
Contributor

Both configs carry a comment saying they should stay in sync, but two JSDoc continuation regex patterns had drifted in the JavaScript config.

The JS config required a literal space before * in JSDoc continuation lines; the TS config did not. This caused Enter-key JSDoc continuation to silently not trigger in .js files when the * was indented only with tabs.

Fixes by removing the extra mandatory space from the two patterns, matching the TypeScript config.

Both language configuration files carry a comment stating they should
stay in sync with each other, but two JSDoc-related regex patterns had
drifted in the JavaScript file.

1. `unIndentedLinePattern` — the third alternative that matches an
   in-progress JSDoc continuation line (`* comment text`) required a
   literal space immediately before the `*`:
     Before: `^(\\t|[ ])*[ ]\\*([ ]...`
     After:  `^(\\t|[ ])*\\*([ ]...`

2. `onEnterRules` — the `beforeText` pattern for the rule that appends
   `* ` when pressing Enter inside a JSDoc block had the same extra
   space requirement.

The TypeScript configuration does not require this leading space, which
means that JSDoc comments whose `*` continuation lines are indented with
tabs only (e.g. `\t* line`) were recognized correctly in TypeScript
files but not in JavaScript files. After this change both files use the
same permissive pattern.

Also aligns the `wordPattern` character-class order (`@~` → `@~`,
purely cosmetic, no behavioral difference).
Copilot AI review requested due to automatic review settings July 27, 2026 21:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Synchronizes JavaScript JSDoc continuation regexes with TypeScript so tab-indented * lines continue correctly.

Changes:

  • Removes mandatory spaces before JSDoc continuation markers.
  • Aligns equivalent JavaScript and TypeScript regex patterns.
Show a summary per file
File Description
extensions/javascript/javascript-language-configuration.json Updates JSDoc continuation and matching configuration patterns.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Medium

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) enabled auto-merge (squash) July 27, 2026 23:01
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 58a6f63 into microsoft:main Jul 27, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.132.0 milestone Jul 27, 2026
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants