module-template icon indicating copy to clipboard operation
module-template copied to clipboard

nvim-treesitter depencency check to prevent errors

Open ttytm opened this issue 3 years ago • 3 comments

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?

ttytm avatar Oct 06 '22 13:10 ttytm

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

vigoux avatar Jan 13 '23 08:01 vigoux

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 👍

ttytm avatar Jan 13 '23 12:01 ttytm

Awesome then ! Thanks !

vigoux avatar Jan 13 '23 13:01 vigoux