-
Notifications
You must be signed in to change notification settings - Fork 373
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
Add function to find unclosed brackets. #345
Comments
There isn't, and it's not feasible to implement. Entire files, particularly in Vim, need to be context-dependent. Beyond just making sure the pairs are balanced in the file, it has to make sure they are balanced in the code and not in the comments, for most files. Then it has to eliminate certain contexts, such as The TL;DR: is that this cascades into a semantic language parser, which is obscenely complex, and well outside the scope of what a Vim plugin written in old Vimscript should be doing anyway. Use an LSP client instead (prabirshrestha/vim-lsp, neoclide/coc.nvim, or others), or an LSP linter (dense-analysis/ale, or others) if you only care about linting and not autocomplete, or don't want autocomplete at all. Yes, it can be somewhat RAM-heavy, but it comes with more benefits than just pair balance checks, notably by checking all syntax problems, and not just balancing issues. Also, most semi-modern computers have more than enough RAM to run an LSP. Beyond that, you get the choice between nothing, or a dumb, context-disregarding check that can and inevitably will cause more problems than it's worth. Or, of course, running a compiler manually yourself, or a linter if a compiler doesn't exist for your language. |
There are often unclosed brackets are typed by mistake. I wonder if there any method to find the unclosed brackets in the whole file.
Thank you!
The text was updated successfully, but these errors were encountered: