[[language]]
name = "rust"
auto-format = true

roots = [
  "Cargo.toml",
  "Cargo.lock"
]

[language.auto-pairs]
'(' = ')'
'{' = '}'
'[' = ']'
'"' = '"'
'`' = '`'

[language-server.rust-analyzer]
command = "rust-analyzer"

[language-server.rust-analyzer.config]
inlayHints.bindingModeHints.enable = true
inlayHints.closingBraceHints.minLines = 10
inlayHints.closureReturnTypeHints.enable = "with_block"
inlayHints.discriminantHints.enable = "fieldless"
inlayHints.lifetimeElisionHints.enable = "skip_trivial"
inlayHints.typeHints.hideClosureInitialization = false

diagnostics.enableInlineHints = true

check.command = "clippy"
check.args = ["--", "-W", "clippy::pedantic", "-W", "clippy::nursery", "-W", "clippy::unwrap_used", "-W", "clippy::expect_used"]
checkOnSave.command = "clippy"
checkOnSave.args = ["--", "-W", "clippy::pedantic", "-W", "clippy::nursery", "-W", "clippy::unwrap_used", "-W", "clippy::expect_used"]

[keys.normal]
C-t = ":run-shell-command cargo test -- --nocapture"

[[language]]
name = "latex"
auto-format = true

[language-server.texlab]
command = "texlab"