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

Remove nvim-treesitter from dependency list #1390

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

vhyrro
Copy link
Member

@vhyrro vhyrro commented Apr 13, 2024

This PR serves two purposes:

  1. Remove core.maneouvre (an already deprecated module in need of a rewrite)
  2. Remove nvim-treesitter from the dependency list

Why?

nvim-treesitter will soon be dropping their ts_utils module in the main branch. To accommodate for this ahead of time, Neorg is removing its reliance on nvim-treesitter as a dependency. Not only this, the main branch of nvim-treesitter will no longer ship the norg parser due to its reliance on C++ as its scanner (something that is fixed in the V3 parser but not yet shipped within Neorg).

The biggest benefit of this change is loading order - since Neorg needs nothing from nvim-treesitter any longer, nvim-treesitter can load naturally and thus hopefully prevent highlighting errors that we've seen so far.

There is a hack in the codebase right now related to MacOS installation (due to old compilers), but it's one that will soon be removed. The norg tree-sitter parser is already published on luarocks in precompiled form for all major operating systems in a way that complements and does not interfere with nvim-treesitter. This rock can be pulled down as a dependency and can immediately work with nvim-treesitter's builtin highlighting module or the rocks-treesitter.nvim module.

Testers Welcome

I encourage anyone to test this PR and report any errors you may encounter. This is marked as a breaking change but will not affect users, only external modules that may rely on ts_utils themselves :)

TODOs

  • Remove :Neorg sync-parsers (issue a deprecation warning for users when they try to use it)
  • Remove automatic parser pinning logic
  • Rename core.integrations.treesitter to core.treesitter (no longer an integration but a component of the core)
  • Remove MacOS hacks by using precompiled parser

@vhyrro vhyrro marked this pull request as ready for review April 13, 2024 17:30
@vhyrro
Copy link
Member Author

vhyrro commented Apr 13, 2024

Just one thing left: make luarocks.nvim use the rocks-binaries servers and precompile the parsers so that users needn't compile them on their machines. After that we're good to go! :D

@vhyrro
Copy link
Member Author

vhyrro commented Apr 19, 2024

Update: this PR in of itself is complete, it seems like our CI on rocks-binaries is having some issues with compiling C++ code properly, and we haven't found a way to fix it yet. Once that happens, this PR can finally be merged! Should make Neorg more stable :)

@Anrock
Copy link

Anrock commented Apr 19, 2024

@vhyrro is it possible to get this somehow to master without waiting for rocks-binaries CI? If I understand correctly that will lead to local treesitter compiling as the only option, am I right?

I'm kinda stuck without neorg now, since neorg depends on nvim-treesitter and rocks, and nvim-treesitter is horribly broken with rocks for some reason.

@vhyrro
Copy link
Member Author

vhyrro commented Apr 19, 2024

@Anrock seems like it's related to the actual compilation process itself which super sucks. I'm trying to fix it over here as fast as I can :)

@vhyrro
Copy link
Member Author

vhyrro commented Apr 20, 2024

btw @Anrock in the meantime you can use the git version of treesitter with :Rocks install rocks-git.nvim and :Rocks install nvim-treesitter/nvim-treesitter. That should at least resolve the treesitter errors.

We're revamping the luarocks-build-treesitter-parser dependency to use tree-sitter build (the new, recommended way of building TS parsers). It will probably be complete in the next day or two.

@cesorious
Copy link

Does this adresse usecases where rocks-treesitter.nvim is not used and tree-sitter-norg is installed directly through rocks?

@vhyrro
Copy link
Member Author

vhyrro commented May 24, 2024

Does this adresse usecases where rocks-treesitter.nvim is not used and tree-sitter-norg is installed directly through rocks?

Precisely :)

@vhyrro
Copy link
Member Author

vhyrro commented May 31, 2024

Temporarily on hold as even more nix + luarocks-related problems are fixed :|

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.

None yet

3 participants