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

Top level error handling #973

Open
joaomendoncaa opened this issue Jan 9, 2025 · 3 comments
Open

Top level error handling #973

joaomendoncaa opened this issue Jan 9, 2025 · 3 comments
Labels
feature New feature or request

Comments

@joaomendoncaa
Copy link
Contributor

joaomendoncaa commented Jan 9, 2025

Feature Description

we should be more cognizant of error handling in autocmds. every time there's a problem with Blink's setup it explodes in your face, be it an error in installation, or a problem with some provider/source - we should be able to at least have an option to suppress these errors or make them more subtle (maybe just logs?).

especially in TextChangedI's case, neovim stays unusable - it's even hard to exit the damn thing 😄

imagem

@joaomendoncaa joaomendoncaa added the feature New feature or request label Jan 9, 2025
@joaomendoncaa
Copy link
Contributor Author

joaomendoncaa commented Jan 9, 2025

we could simply wrap all these autocmd callbacks with a pcall HOF util function, write errors to logs, and/or notify the user based on a config parameter

@itsthomashere
Copy link

we could simply wrap all these autocmd callbacks with a pcall HOF util function, write errors to logs, and/or notify the user based on a config parameter

I ran into this for quite sometime and it was really annoying too since it basically blocked neovim.

@Saghen Saghen changed the title blink.cmp is unusable if anything goes wrong at setup time Top level error handling Jan 9, 2025
@smjonas
Copy link
Contributor

smjonas commented Jan 9, 2025

I agree, trying to update my config to fix the issue was very annoying as the error appeared on every keystroke. In the code, I noticed that you're using Lua's error function. I would recommend using something like vim.notify_once instead which will only show the error once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants