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

[FEATURE REQUEST] Refactor require to use pcall in language configurations #377

Open
connorgmeehan opened this issue Aug 1, 2022 · 0 comments
Labels
scope: enhancement New feature or request
Milestone

Comments

@connorgmeehan
Copy link
Collaborator

connorgmeehan commented Aug 1, 2022

What is the feature, what would you like to be able to do?

Sometimes dependencies aren't installed, this is especially an issue in language configurations where the execution is not tied to the plugin being installed / loaded (unlike a config function). I would like all require to be refactored to the following for safety.

local ok, dep = pcall(require, 'dep')
if not ok then
  return
end

What is the use case, why do you want this feature?

This would allow doom-nvim to start without errors if there is an issue loading a dependency.

Possible Implementation (if applicable)

Create a safe require function in utils.lua that tries to require a dep, logs and returns nil if it fails or returns the dep.

Additional context

@connorgmeehan connorgmeehan added the scope: enhancement New feature or request label Aug 1, 2022
@connorgmeehan connorgmeehan added this to the 4.1.0 milestone Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant