Shows private Ruby methods with indicators in Neovim.
{
'l-lin/private-ruby.nvim',
ft = 'ruby',
opts = {
-- Those are the default values:
indicator = {
text = '', -- Indicator text (max 2 chars for gutter)
hl = 'DiagnosticHint', -- Highlight group
position = 'virtual_text', -- 'virtual_text' or 'gutter'
},
detect = {
kind = 'auto', -- Detection mode (see below)
},
},
}The detect.kind option controls how private methods are detected:
| Mode | Behavior | Use When |
|---|---|---|
auto |
Try Tree-sitter first, fallback to regex if unavailable | Default - works everywhere |
treesitter |
Use only Tree-sitter, no fallback (returns empty if unavailable) | You want accurate detection and have Tree-sitter installed |
regex |
Use only regex-based detection, no fallback | Tree-sitter is unavailable or you prefer regex |
:PrivateRubyRefresh- Manually refresh indicators:PrivateRubyClear- Manually clear indicators
This version uses regex-based detection. Known limitations:
- Does not handle
private :method_namesymbol syntax - Does not handle
private_class_method - May miscount
endkeywords in complex code (heredocs, inline blocks) - Metaprogramming-defined methods are not detected
mise run test # Run tests with mini.test
mise run smoke # Smoke test: load pluginMIT