How to set flags when calling "setup"

For example, I want to launch clangd with flags --completion-style=detailed --header-insertion=never. What arguments should I pass when calling setup{}?

I think you can do:

  cmd = {
  -- other options

It works.

Another question about lua: If I write this,

local servers = { "clangd", "rust_analyzer" }
local command = {}

command.clangd = {

local lspconfig = require("lspconfig")

for _, lsp in ipairs(servers) do
  lspconfig[lsp].setup {
    cmd = command[lsp]

Is it OK when starting rust-analyzer?

Yep, it should be okay. Not having any value means it’s nil, so it’ll fallback to the default value.

I got it. Thank you!