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

Trying to add tree-sitter/tree-sitter-c #205

Closed
peterjmorgan opened this issue Oct 22, 2022 · 4 comments
Closed

Trying to add tree-sitter/tree-sitter-c #205

peterjmorgan opened this issue Oct 22, 2022 · 4 comments

Comments

@peterjmorgan
Copy link

peterjmorgan commented Oct 22, 2022

I've tried to follow the instructions perfectly, but I've never used nix before this.

I added the following stanza to flakes.nix:

  tree-sitter-c = {
      url = "github:tree-sitter/tree-sitter-c";
      flake = false;
    };

and the following line to the updateVendor stanza:

ln -s ${inputs.tree-sitter-c} vendor/tree-sitter-c

then ran direnv reload. I don't see an operation happening that is fetching the git repo from github, so I feel like I'm missing something (perhaps obvious).

The update-vendor script runs, but never finds a path in /nix/store that has tree-sitter-c so it cannot update the symlink to the vendor directory.

I'm stuck here, and hoping a nudge in the right direction might help me progress.

@BrianHicks
Copy link
Owner

Hey Peter! Sorry you're having trouble here. Good news: I tried copying/pasting your snippets myself and it looks like it works. Here's how I can tell:

  • after I run direnv reload, I see a new entry in flake.lock that contains the tree-sitter-c hashes. (I pasted your snippet after line 62 in the file, but really it should be alphabetically first.)
  • after direnv reload succeeds, running update-vendor creates vendor/tree-sitter-c

If you can see those two things as well, I think you're good to go. Otherwise, could you clarify on this by pasting the exact error message you're seeing?

The update-vendor script runs, but never finds a path in /nix/store that has tree-sitter-c so it cannot update the symlink to the vendor directory.

@BrianHicks
Copy link
Owner

(note, however: I'm out of the office this week so I will probably be slow to respond again. It looks like you're on the right path here, though, so hopefully it's OK!)

@peterjmorgan
Copy link
Author

@BrianHicks Thank you! For some reason, direnv wasn't triggering. It worked spontaneously the next time I tried, and yes, everything worked wonderfully. I got tree-sitter-c added and going to add python next :)

I will setup a PR soon if you're interested

@BrianHicks
Copy link
Owner

yes, that'd be just fine! Until/unless we do something like #88 it'll always be fine to add more languages.

Mephistophiles added a commit to Mephistophiles/tree-grepper that referenced this issue Dec 11, 2022
Mephistophiles added a commit to Mephistophiles/tree-grepper that referenced this issue Dec 11, 2022
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

No branches or pull requests

2 participants