This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Adding configuration for new, tree-sitter based indentation logic #608
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.
Description of the Change
This adds the configuration needed for the new, tree-sitter based indentation logic. That new logic is implemented in this PR in atom/atom: atom/atom#18321.
Once that PR is merged, this one then fixes #594.
Alternate Designs
Since this only adds configuration, the real discussion about alternate design is in atom/atom#18321.
Benefits
Fixes several indentation issues that all arise from the fact that the previous regex based logic was inductive (i.e., only based on the previous line). This prevented the implementation of certain patterns that seem preferred by users (and seem more correct). See, e.g., atom/atom#6655 and others.
Possible Drawbacks
I'm not a huge fan of how I'm adding the functional configuration (precedingRowConditions) to the grammar. This clutters the namespace in that object a little (but not much). Other than that I don't see any downsides.-- this has now been improved to whereprecedingRowConditions
is no longer required.Applicable Issues
atom/atom#6655
#476
#560
to name a few.