fix: bug in Restrict continue comment#322668
Open
RedCMD wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates multiple built-in language configurations to refine the “continue line comment on Enter” rule, reintroducing a non-whitespace (\S) requirement so // alone won’t trigger comment continuation. This is aligned with the goal of reducing accidental comment continuation in common non-comment scenarios (e.g., URLs/paths) while still supporting intentional line comments.
Changes:
- Tightened
beforeTextfor//continuation to require actual comment content (\S) and to better constrain where//is recognized as a comment start. - Simplified
afterTextfrom^(?!\s*$).+to^(?!\s*$)across affected language configurations. - Adjusted C# rules to explicitly handle
///documentation comment continuation separately from normal//comments.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/typescript-basics/language-configuration.json | Updates // on-enter continuation regex to require non-whitespace content. |
| extensions/swift/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/rust/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/php/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/objective-c/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/less/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/json/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/javascript/javascript-language-configuration.json | Updates // on-enter continuation regex to require non-whitespace content. |
| extensions/java/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/groovy/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/go/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
| extensions/csharp/language-configuration.json | Separates /// doc-comment continuation from // and updates // continuation regex. |
| extensions/cpp/language-configuration.json | Aligns // on-enter continuation rule with the tightened regex. |
Comments suppressed due to low confidence (1)
extensions/csharp/language-configuration.json:107
- The documentation-comment onEnter rule also matches lines starting with
////because it only checks for a///prefix. That will cause Enter inside a normal////line comment to continue with///instead of//.
Consider excluding a 4th slash via a negative lookahead so only exactly-three-slash doc comments trigger this rule.
"beforeText": "^\\s*\/\/\/",
aiday-mar
approved these changes
Jun 24, 2026
alexdima
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #236828
fixes #321230
re-adds the
\\Srequirement to the regex