nix-community / rnix-lsp

WIP Language Server for Nix! [maintainer=@aaronjanse]
MIT License
708 stars 41 forks source link

is this how it should work? #25

Closed breuerfelix closed 3 years ago

breuerfelix commented 3 years ago

Hey! glad i stumbled on this repo :) configured it with neovim nightly and builtin lsp. this is how it looks: image

at least i get an error message but it is always formatted like this. "error node at ....".
Is there a way to turn on more specific error messages ? or is this currently the only error message possible with rnix lsp ?

cheers

jD91mZM2 commented 3 years ago

Unfortunately, this is the only type of error message we have currently. Not sure why I haven't fixed it yet, but I think rnix-parser saves enough information. It could probably be tweaked fairly easily to support more error types here

jD91mZM2 commented 3 years ago

Ended up having to bump a long chain of dependencies, but pull requests have been filed and things are in motion. You can compile the bump-rnix branch and run it to get somewhat more interesting error messages

breuerfelix commented 3 years ago

i would love to test and give some feedback! BUT ... i am farily new to nixos, wenn i know that i would have to solve this with an overlay but i never wrote an overlay that compiles a package from scratch with a specify branch :D

do you have some overlay config to get me going here ?

wikku commented 3 years ago

I'm also a noob, but I think that you won't easily build&install the bump-rnix branch with Nix because the flake files on this branch haven't been updated. If you just want the binary, build it with cargo (nix-shell should provide it to you).

jD91mZM2 commented 3 years ago

Yeah the flake is broken right now, not sure if naersk has problems with git dependencies or patches, or if I just borked something.

breuerfelix commented 3 years ago

finally i installed the branch with cargo and pointed my coc-vim to the binary (i have ditched neovim nightly lsp since at this stage it is not as good as coc ... too much error and mistages i had to solve at work) and it is amazing!

way better error message :) would love to have this merged! also i would love to contribute to add more to it but i really have to dig into this. maybe i will find some time for it in the future :)

573 commented 3 years ago

Ended up having to bump a long chain of dependencies, but pull requests have been filed and things are in motion. You can compile the bump-rnix branch and run it to get somewhat more interesting error messages

just for reference this is how you can use the branch: https://github.com/nix-community/rnix-lsp/issues/32#issuecomment-806611737

Ma27 commented 3 years ago

This seems to be fixed on master and will be part of 0.2.0.

(If I missed something, please ping me!)

573 commented 2 years ago

~Have to reopen as I still get the OPs messages when using v0.2.4 (which is in nixos-unstable) as opposed to the better explained ones when using bump-rnix branch.~

EDIT: See derived ticket

Example with bump-rnix:

■ unexpected TOKEN_PAREN_CLOSE at 1941..1942, wanted any of [TOKEN_PAREN_OPEN, TOKEN_REC, TOKEN_CURLY_B_OPEN, TO■ unexpected TOKEN_PAREN_CLOSE at 1941..1942, wanted any of [TOKEN_PAREN_OPEN, TOKEN_REC, TOKEN_CURLY_B_OPEN, TO