fix google formatters
This commit is contained in:
@ -27,7 +27,10 @@ function M.setup(capabilities)
|
||||
"bzl",
|
||||
"typescript",
|
||||
},
|
||||
root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||
-- root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||
root_dir = function(fname)
|
||||
return string.match(fname, "(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$")
|
||||
end,
|
||||
settings = {},
|
||||
},
|
||||
}
|
||||
@ -55,7 +58,9 @@ function M.setup(capabilities)
|
||||
"typescript",
|
||||
"javascript",
|
||||
},
|
||||
root_dir = lspconfig.util.root_pattern("BUILD"),
|
||||
root_dir = function(fname)
|
||||
return string.match(fname, "(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$")
|
||||
end,
|
||||
settings = {},
|
||||
},
|
||||
}
|
||||
@ -83,6 +88,9 @@ function M.setup(capabilities)
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
underline = true,
|
||||
}),
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
|
||||
focusable = false,
|
||||
}),
|
||||
}
|
||||
|
||||
cider_lsp_handlers["$/syncResponse"] = function(_, result, ctx)
|
||||
|
@ -19,7 +19,7 @@ return {
|
||||
{ import = "nvgoog.google.misc" },
|
||||
-- maktaba is required by all google plugins
|
||||
glug("maktaba", {
|
||||
lazy = true,
|
||||
lazy = false,
|
||||
dependencies = {},
|
||||
config = function() -- init?
|
||||
vim.cmd("source /usr/share/vim/google/glug/bootstrap.vim")
|
||||
@ -109,18 +109,20 @@ return {
|
||||
{ "junegunn/fzf.vim", dependencies = { "junegunn/fzf" } },
|
||||
-- Format google code
|
||||
glug("codefmt-google", {
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
glug("codefmt", {
|
||||
-- TODO: remove prettier when http://cl/549024543 is submitted and deployed
|
||||
-- - remove prettier from the plugin options
|
||||
-- - set js/ts to use prettier instead of clang-format
|
||||
-- autocmd FileType javascript,typescript,javascriptreact,typescriptreact,css,scss,html,json AutoFormatBuffer prettier
|
||||
lazy = false,
|
||||
opts = {
|
||||
clang_format_executable = "/usr/bin/clang-format",
|
||||
clang_format_style = "function('codefmtgoogle#GetClangFormatStyle')",
|
||||
gofmt_executable = "/usr/lib/google-golang/bin/gofmt",
|
||||
prettier_executable = "/google/data/ro/teams/prettier/prettier",
|
||||
ktfmt_executable = { "/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt", "--google-style" },
|
||||
},
|
||||
}),
|
||||
},
|
||||
opts = {
|
||||
auto_format = {
|
||||
["borg"] = "gclfmt",
|
||||
["gcl"] = "gclfmt",
|
||||
@ -144,8 +146,6 @@ return {
|
||||
["sql"] = "format_sql",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
cmd = { "FormatLines", "FormatCode", "AutoFormatBuffer" },
|
||||
event = "BufWritePre",
|
||||
-- Setting up autocmds in init allows deferring loading the plugin until
|
||||
|
Reference in New Issue
Block a user