Adding configuration for new, tree-sitter based indentation logic by chfritz · Pull Request #608 · atom/language-javascript · GitHub
Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Adding configuration for new, tree-sitter based indentation logic - #608

Open
chfritz wants to merge 2 commits into
atom:masterfrom
chfritz:tree-sitter-indentation-config
Open

chfritz wants to merge 2 commits into
atom:masterfrom
chfritz:tree-sitter-indentation-config

Conversation

@chfritz

@chfritz chfritz commented Oct 25, 2018 •

Copy link
Copy Markdown

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 where precedingRowConditions is no longer required.

Applicable Issues

atom/atom#6655
#476
#560
to name a few.

…core

See this PR in atom/atom: atom/atom#18321.

Once the other PR is merged, this one then fixes atom#594.

Updated: now without the need for a callback function as part of configuration
@chfritz

chfritz commented May 31, 2021

Copy link
Copy Markdown
Author

@chfritz

chfritz commented Jun 4, 2021

Copy link
Copy Markdown
Author

The failing tests don't seem to be related to the changes in this PR.

@sadick254

Copy link
Copy Markdown
Contributor

@chfritz am working on resolving those errors. We should be good to go once resolved.

@chfritz

chfritz commented Feb 13, 2022

Copy link
Copy Markdown
Author

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.

Implement new indentation logic based on tree-sitter

4 participants