jordanisaacs / neovim-flake

Nix flake for neovim with configuration
https://jordanisaacs.github.io/neovim-flake
MIT License
246 stars 54 forks source link

Doesn't work for python currently? #15

Closed msm-code closed 1 year ago

msm-code commented 1 year ago

I'm probably installing it incorrectly, but can't find more information about the installation in the readme. Maybe it could be updated?

I've tried to use the project with my main language (python) and I got treesitter errors in every line:

image

I'm not sure how to fix this. Code completion seems to work correctly.

Later I've tried rust (test.rs), and got an error about "can't find cargo" immediately. Am I supposed to install it separately? After doing this I got "LSP[rust_analyzer] rust-analyzer failed to discover workspace"

Finally I've tried to open a C++ file. It seems to work.

The parts that do work look great though. I would love to fix my configuration

jordanisaacs commented 1 year ago

It pulls in rust-analyzer automatically but not rust/cargo. That is probably the issue with rust.

Some of the treesitters have errors on the version of nixpkgs in the lock file. Python is one of those. Using a nixpkgs overlay and replacing the treesitter version with a working one would fix this. This isn’t an issue with Neovim configuration.

The next thing I am working on when I get the chance is a better way to install treesitter plugins annd allow easier version overriding (through a new module option).

msm-code commented 1 year ago

I see. Thanks for your reply! In this case I guess this issue can be closed.

How do you recommend I fix the issue with python on my end? I'm probably reading the flake wrong, but I don't see a way to disable treesitter for python only (so it's usable for python - doesn't have to be a perfect support).

jordanisaacs commented 1 year ago

I will leave it open till I get it fixed/a workaround on master. First and best option is to use a nixpkgs overlay (see: https://nixos.wiki/wiki/Overlays#Overriding_a_version) to find a version of the python treesitter that works. Second option is to disable treesitter altogether (options.vim.treesitter.enable = false). Note this will disable all treesitter stuff including highlighting.

jordanisaacs commented 1 year ago

Did some updates and it seems that python treesitter should be fixed (from :CheckHealth) so feel free to re-enable it. Only one that still seems to be broken is typescript.

msm-code commented 1 year ago

Thanks! I'll give it a try.