When setting the underline diagnostic settings:
vim.diagnostic.config({
underline = { severity = vim.diagnostic.severity.ERROR },
}
...the DiagnosticUnnecessary semantic tokens are suppressed.
This causes LSP's to not grey out unused variables.
This is intentional as stated in neovim/neovim#26796
However, it is very unintuitive, so perhaps for this reason it deserves a comment or a value of like underline = { severity = vim.diagnostic.severity.HINT } or underline = true