Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#86176: Consider indenting with comments (that contain apostrophes) #86216

Closed
wants to merge 1 commit into from
Closed

#86176: Consider indenting with comments (that contain apostrophes) #86216

wants to merge 1 commit into from

Conversation

jzyrobert
Copy link
Contributor

@jzyrobert jzyrobert commented Dec 4, 2019

This PR fixes #86176

I propose adding (\/\/.*|\/\*.*?\*\/)? to the increaseIndentPattern regex.

(
\/\/.* Allow for any // comment
| or
\/\*.*?\*\/ Allow for any block comments that complete
)
? Optionally

This matches:
if () { // <Any comment with ' or ">
or
if () { /* <Any comment with ' or "> */

But not
if () { /* <Any comment with ' or "> (block comment does not finish)

There may be edge cases that this does not consider that could cause issues?

@alexdima alexdima assigned rebornix and unassigned alexdima Feb 4, 2020
@jzyrobert
Copy link
Contributor Author

@rebornix Hi, do you have any opinions on this?

@rebornix rebornix added editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality labels Oct 8, 2020
@joaomoreno joaomoreno changed the base branch from master to main February 15, 2021 08:51
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 27, 2021

I ended up fixing this differently in d89e2e1. It is scoped to just allow a single line comments after an opening {

@mjbvz mjbvz closed this Feb 27, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Javascript: code blocks auto indent improperly when apostrophes/quotation marks are present
4 participants