Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6dd0301

Browse files
authoredMay 1, 2025
Document code lens support (#28)
* Document code lens support * Add note about lazy-loading
1 parent 8cf0b9b commit 6dd0301

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
 

‎README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,42 @@ If you want to pass configuration to lspconfig:
8383
}
8484
```
8585

86+
## Code Lens
87+
88+
This plugin provides code lens support for some Rails-specific features:
89+
90+
- `openFile` – Jump from a controller action to the corresponding view or route
91+
definition.
92+
- `runTest` – Run a test file or an individual test and display the output in a
93+
split window.
94+
- `runTask` – Run database migrations.
95+
96+
Code lens virtual text will be added where these features are available.
97+
98+
You can run available lens actions using `vim.lsp.codelens.run()`. Or, add a key
99+
mapping:
100+
101+
```lua
102+
{
103+
'adam12/ruby-lsp.nvim',
104+
ft = { 'ruby', 'eruby' },
105+
...
106+
keys = {
107+
{
108+
'<leader>cl',
109+
function()
110+
vim.lsp.codelens.run()
111+
end,
112+
desc = 'Run Code Lens',
113+
},
114+
},
115+
}
116+
```
117+
118+
Note: When you include a `keys` entry in your plugin spec, Lazy.nvim will treat the
119+
plugin as lazy-loaded and only load it when one of those keys is pressed. To
120+
ensure the plugin loads when editing Ruby files, use the `ft` (filetype) option.
121+
86122
## Disclaimer
87123

88124
This project is not officially connected to the Ruby LSP project, or officially

‎doc/ruby-lsp.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Features:
1212

1313
- Some conveniences around interacting with the Ruby LSP.
1414

15+
- Basic code lens support.
16+
1517
# Setup ~
1618

1719
This module needs a setup with `require('ruby-lsp').setup({})` (replace `{}`

0 commit comments

Comments
 (0)
Failed to load comments.