Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

nvim-treesitter depencency check to prevent errors #6

Open
ttytm opened this issue Oct 6, 2022 · 3 comments · May be fixed by #7
Open

nvim-treesitter depencency check to prevent errors #6

ttytm opened this issue Oct 6, 2022 · 3 comments · May be fixed by #7

Comments

@ttytm
Copy link

ttytm commented Oct 6, 2022

As the modules depend on nvim-treesitter. I think it could be nice to add a little dependency check if it is installed.

It could be as simple as a:
if not pcall(require, "nvim-treesitter") then return end
inside lua/module-template.lua.

If preferred, it could include a little print to inform the end user of the module about the missing dependency:
print "module-template requires nvim-treesitter to be installed"

Next to following a good practice of checking for dependencies, for me this would mostly aim to prevent errors when pulling a config and doing a first setup, when treesitter is not yet fully installed. E.g.,
Screenshot_20221006_141210

Would a PR on this have a chance?

@vigoux
Copy link
Member

vigoux commented Jan 13, 2023

Hey, it would definitely have a change, do you want to make it ?

@ttytm
Copy link
Author

ttytm commented Jan 13, 2023

Thanks for the reply @vigoux!

Coming back to this issue I notice that it had some spelling and semantic errors that also needed a fix to make the proposal understandable.

And of course, I'll be back at my desk on Sunday to submit the PR 👍

@vigoux
Copy link
Member

vigoux commented Jan 13, 2023

Awesome then ! Thanks !

@ttytm ttytm linked a pull request Jan 14, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants