Opinionated Neovim diagnostics + quickfix code actions for ZIO, Cats-Effect (IO/Resource), and Cats tagless-final (F[_]) Scala code.
- 90 Treesitter patterns detecting common effect code smells with idiomatic replacements
- 35 ZIO patterns
- 40 Cats-Effect patterns
- 15 Cats tagless-final patterns
- Native diagnostics & code actions via
vim.diagnostic.set()and LSP handler - Metals-aware — type verification ensures replacements only apply to actual effect types
- Evidence-gated — tagless-final patterns verify typeclass bounds in enclosing
defsignatures - Configurable severity — set each pattern as
HINT,INFO,WARN,ERROR, orOFF
- Neovim 0.11+
- nvim-metals
- plenary.nvim
lazy.nvim:
{
'olisikh/scala-hints.nvim',
opts = {},
dependencies = {
'nvim-lua/plenary.nvim',
'scalameta/nvim-metals',
},
}- Open a Scala file with Metals running
- Diagnostics appear automatically (default:
HINTseverity) - Apply fixes via
:lua vim.lsp.buf.code_action()or your keymap
| Command | Description |
|---|---|
:ScalaHintsApplyBuffer |
Apply all fixes in the current buffer |
require('scala-hints').setup({
diagnostics = {
default_severity = 'HINT',
overrides = {
['zio/zip_left_value'] = 'OFF',
['zio/zio_die'] = 'WARN',
},
},
})See Configuration for all options.
Full documentation is available on the Wiki:
- Installation — setup instructions
- Configuration — all options
- Patterns — all 90 patterns with detection rules
- ZIO — deep dive into ZIO patterns (35)
- Cats-Effect — IO/Resource patterns (40)
- Cats Tagless-Final — F[_] patterns (15)
- No diagnostics? Wait for Metals to initialize (
MetalsReady/MetalsInitialized) - Diagnostics disappear after undo? Reopen the buffer or save to refresh
See AGENTS.md for architecture details and the pattern addition guide.
