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

Skip comments entirely when evaluating indentation #209861

Closed
aiday-mar opened this issue Apr 8, 2024 · 3 comments
Closed

Skip comments entirely when evaluating indentation #209861

aiday-mar opened this issue Apr 8, 2024 · 3 comments
Assignees
Labels
editor-autoindent Editor auto indentation issues polish Cleanup and polish issue

Comments

@aiday-mar
Copy link
Contributor

aiday-mar commented Apr 8, 2024

In relation to #209519

As part of the indentation improvement, we would like to entirely strip comments from the current line being considered before evaluating the indentation rules

Simplify the indentation regexes in order not to take into account comment placements for indentation.

@aiday-mar aiday-mar added polish Cleanup and polish issue editor-autoindent Editor auto indentation issues labels Apr 8, 2024
@aiday-mar aiday-mar self-assigned this Apr 8, 2024
@RedCMD
Copy link
Contributor

RedCMD commented Apr 8, 2024

I think this is a good idea
but would it be optional or forced?

@aiday-mar
Copy link
Contributor Author

After discussion with my colleagues, we decided this would be forced. That is comments will never be considered in the indentation evaluation.

@aiday-mar
Copy link
Contributor Author

Fixed with #210641. This PR actually treats strings, regexe and comment tokens in a similar manner. The language configuration brackets in these tokens are stripped and the indentation rules are evaluated on the stripped lines

@microsoft microsoft locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-autoindent Editor auto indentation issues polish Cleanup and polish issue
Projects
None yet
Development

No branches or pull requests

2 participants