Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,42 @@ If you want to pass configuration to lspconfig:
83
83
}
84
84
```
85
85
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
+
86
122
## Disclaimer
87
123
88
124
This project is not officially connected to the Ruby LSP project, or officially
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ Features:
12
12
13
13
- Some conveniences around interacting with the Ruby LSP.
14
14
15
+ - Basic code lens support.
16
+
15
17
# Setup ~
16
18
17
19
This module needs a setup with `require (' ruby-lsp' ).setup ({})` (replace `{}`
0 commit comments