Skip to content

Conversation

kristijanhusak
Copy link
Member

Summary

With the change on nightly neovim/neovim#35988, string parser creates a scratch buffer under the hood, and uses that as a source. This drastically decreases the performance of the current code.

This commit refactors the code to remove the string parser, and adds own loading of the org buffers for the tree-sitter usage. Performance should be same as before, with the downside that all of the org files that are in org_agenda_files are now loaded as unlisted buffers.

Changes

  • Remove usage of get_string_parser
  • Manually add and load all org agenda files as unlisted buffers, so they can be parsed with tree-sitter
  • Remove some of the code and tests that are no longer relevant

Checklist

I confirm that I have:

  • Followed the
    Conventional Commits
    specification
    (e.g., feat: add new feature, fix: correct bug,
    docs: update documentation).
  • My PR title also follows the conventional commits specification.
  • Updated relevant documentation, if necessary.
  • Thoroughly tested my changes.
  • Added tests (if applicable) and verified existing tests pass with
    make test.
  • Checked for breaking changes and documented them, if any.

@kristijanhusak
Copy link
Member Author

@chipsenkbeil just a heads-up about this change. I don't know if it affects org-roam.

@chipsenkbeil
Copy link
Contributor

@chipsenkbeil just a heads-up about this change. I don't know if it affects org-roam.

I think I refactored out all direct usage of treesitter in favor of your plugin's api, but will need to double check.

@ribru17
Copy link

ribru17 commented Oct 3, 2025

I think there may be a simpler way to prevent this perf regression; i think this was less about using a scratch buffer and more about parser:source() always returning a number now. I'm about to be afk but i will do some investigating

PriceHiller added a commit to PriceHiller/dots that referenced this pull request Oct 4, 2025
With the change on nightly neovim/neovim#35988,
string parser creates a scratch buffer under the hood, and uses that as
a source. This drastically decreases the performance of the current
code.

This commit refactors the code to remove the string parser, and adds own
loading of the org buffers for the tree-sitter usage.
Performance should be same as before, with the downside that all of the
org files that are in org_agenda_files are now loaded as unlisted
buffers.
For some reason, tests on older versions fail without reporting any
actual issues in the tests. Skip running tests on those versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants