Skip to content

feat: add todo.txt tree-sitter - #7835

Merged
pascalkuthe merged 1 commit into
masterfrom
unknown repository
Aug 9, 2023
Merged

feat: add todo.txt tree-sitter#7835
pascalkuthe merged 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Aug 4, 2023

Copy link
Copy Markdown

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.

Comment thread languages.toml Outdated
Comment thread languages.toml Outdated
[[language]]
name = "todotxt"
scope = "text.todotxt"
file-types = ["todo.txt", "todotxt"]

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@ghost
ghost 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
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 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.

2 participants