feat(bazel): add Bazel plugins and completion
Add vim-bazel (with its vim-maktaba dependency) and bazel.nvim for running Bazel from the editor, with an errorformat that sends Bazel build and test failures to the quickfix list. cmp-bazel supplies a Bazel completion source, wired into blink.cmp through blink.compat. lazy-lock.json pins the five new plugins.
This commit is contained in:
@@ -2,9 +2,12 @@
|
||||
"LazyVim": { "branch": "main", "commit": "999700997f72227187d49d8b92667183dc7fc809" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "be687d17e4a9443e918c48c3c915b1f2ffd0f718" },
|
||||
"auto-save.nvim": { "branch": "main", "commit": "5961d5e041c227e4d99e9e44e3a7ce9c6826c145" },
|
||||
"bazel.nvim": { "branch": "master", "commit": "b1dbc8a7b0315902e1e3a14719cae290c53453f4" },
|
||||
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||
"blink.compat": { "branch": "main", "commit": "2ed6d9a28b07fa6f3bface818470605f8896408c" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"catppuccin": { "branch": "main", "commit": "edefef779ab08ce1a4a404713e3012b0d202bd35" },
|
||||
"cmp-bazel": { "branch": "main", "commit": "68b45f8d341e8783b3c08285a5b02cbf38e43547" },
|
||||
"conform.nvim": { "branch": "master", "commit": "016802de402556da54c36bd7359b441266b01cdd" },
|
||||
"crates.nvim": { "branch": "main", "commit": "7039bc1d130e424232a7aa64ceddb170a154ff5b" },
|
||||
"flash.nvim": { "branch": "main", "commit": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a" },
|
||||
@@ -44,8 +47,10 @@
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"ts-comments.nvim": { "branch": "main", "commit": "a59d6092213447450191122c9346f309161504cb" },
|
||||
"venv-selector.nvim": { "branch": "main", "commit": "cc4bb3975de8835291f9bb45889e96c6b2795fc4" },
|
||||
"vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "6d1d41da4873a445c5605f2005ad2c68c99d8770" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "afd07819d8efcefc3317205b855ad4e3513b0011" },
|
||||
"vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
return {
|
||||
{ "bazelbuild/vim-bazel", dependencies = { "google/vim-maktaba" } },
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = { "saghen/blink.compat", { "alexander-born/cmp-bazel", dependencies = "hrsh7th/nvim-cmp" } },
|
||||
opts = {
|
||||
sources = {
|
||||
compat = { "bazel" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"alexander-born/bazel.nvim",
|
||||
config = function()
|
||||
-- Info: to make tab completion work copy '/etc/bash_completion.d/bazel-complete.bash' to '/etc/bash_completion.d/bazel'
|
||||
|
||||
vim.g.bazel_config = vim.g.bazel_config or ""
|
||||
vim.g.bazel_cmd = "bazel"
|
||||
|
||||
vim.cmd([[
|
||||
set errorformat=ERROR:\ %f:%l:%c:%m
|
||||
set errorformat+=%f:%l:%c:%m
|
||||
set errorformat+=[\ \ FAILED\ \ ]\ %m\ (%.%#
|
||||
|
||||
" Ignore build output lines starting with INFO:, Loading:, or [
|
||||
set errorformat+=%-GINFO:\ %.%#
|
||||
set errorformat+=%-GLoading:\ %.%#
|
||||
set errorformat+=%-G[%.%#
|
||||
|
||||
" Errorformat settings
|
||||
" * errorformat reference: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#errorformat
|
||||
" * look for message without consuming: https://stackoverflow.com/a/36959245/10923940
|
||||
" * errorformat explanation: https://stackoverflow.com/a/29102995/10923940
|
||||
|
||||
" Ignore this error message, it is always redundant
|
||||
" ERROR: <filename>:<line>:<col>: C++ compilation of rule '<target>' failed (Exit 1)
|
||||
set errorformat+=%-GERROR:\ %f:%l:%c:\ C++\ compilation\ of\ rule\ %m
|
||||
set errorformat+=%tRROR:\ %f:%l:%c:\ %m " Generic bazel error handler
|
||||
set errorformat+=%tARNING:\ %f:%l:%c:\ %m " Generic bazel warning handler
|
||||
" this rule is missing dependency declarations for the following files included by '<another-filename>'
|
||||
" '<fname-1>'
|
||||
" '<fname-2>'
|
||||
" ...
|
||||
set errorformat+=%Ethis\ rule\ is\ %m\ the\ following\ files\ included\ by\ \'%f\':
|
||||
set errorformat+=%C\ \ \'%m\'
|
||||
set errorformat+=%Z
|
||||
|
||||
" Test failures
|
||||
set errorformat+=FAIL:\ %m\ (see\ %f) " FAIL: <test-target> (see <test-log>)
|
||||
|
||||
" test failures in async builds
|
||||
set errorformat+=%E%*[\ ]FAILED\ in%m
|
||||
set errorformat+=%C\ \ %f
|
||||
set errorformat+=%Z
|
||||
|
||||
" Errors in the build stage
|
||||
set errorformat+=%f:%l:%c:\ fatal\ %trror:\ %m " <filename>:<line>:<col>: fatal error: <message>
|
||||
set errorformat+=%f:%l:%c:\ %trror:\ %m " <filename>:<line>:<col>: error: <message>
|
||||
set errorformat+=%f:%l:%c:\ %tarning:\ %m " <filename>:<line>:<col>: warning: <message>
|
||||
set errorformat+=%f:%l:%c:\ note:\ %m " <filename>:<line>:<col>: note: <message>
|
||||
set errorformat+=%f:%l:%c:\ \ \ requ%tred\ from\ here " <filename>:<line>:<col>: <message>
|
||||
set errorformat+=%f(%l):\ %tarning:\ %m " <filename>(<line>): warning: <message>
|
||||
set errorformat+=%f:%l:%c:\ %m " <filename>:<line>:<col>: <message>
|
||||
set errorformat+=%f:%l:\ %m " <filename>:<line>: <message>
|
||||
]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user