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

feat: add todo.txt tree-sitter #7835

Merged
merged 1 commit into from Aug 9, 2023

Conversation

Jan9103
Copy link
Contributor

@Jan9103 Jan9103 commented Aug 4, 2023

Add support for todo.txt (docs, website).

Since i often use todo.txt for organizing and markdown is already included i wanted to offer upstreaming my config.

The official file extension is .todo.txt, but that doesn't work with helix (and a bunch of other editors) due to the recognition prioritization, therefore i also added the alternative .todotxt extension.

This uses the same tree-sitter as neovim.

languages.toml Outdated Show resolved Hide resolved
languages.toml Outdated
[[language]]
name = "todotxt"
scope = "text.todotxt"
file-types = ["todo.txt", "todotxt"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file-types = ["todo.txt", "todotxt"]
file-types = [".todo.txt"]

This should work to catch .todo.txt files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried it and test.todo.txt was not recognised.
as far as im aware this is not fixable without changing the recognition code since it checks the extension first (docs) and only checks other methods if it dosnt match (and .txt is the extension)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, I was thinking that .todo.txt was the full filename

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use suffix here, I think that should catch test.todo.txt:

file-types = [{ suffix = ".todo.txt"}, "todotxt"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that worked. pushed a new commit

@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. A-language-support Area: Support for programming/text languages labels Aug 8, 2023
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 9, 2023
@pascalkuthe pascalkuthe merged commit c0eae84 into helix-editor:master Aug 9, 2023
6 checks passed
@Jan9103 Jan9103 deleted the todotxt-support branch August 9, 2023 13:55
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants