Skip to content

Commit c2cdbec

Browse files
mrcjkbGithub Actions
andauthored
feat: :RustLsp openDocs command (#326)
Co-authored-by: Github Actions <actions@github>
1 parent 513d2ba commit c2cdbec

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [4.18.0] - 2024-03-27
10+
11+
### Added
12+
13+
- `:RustLsp openDocs` command [[#325](https://github.com/mrcjkb/rustaceanvim/issues/325)].
14+
915
## [4.17.0] - 2024-03-26
1016

1117
### Added

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,21 @@ vim.keymap.set(
452452
```
453453
</details>
454454

455+
<details>
456+
<summary>
457+
<b>Open docs.rs documentation</b>
458+
</summary>
459+
460+
Open docs.rs documentation for the symbol under the cursor.
461+
462+
```vimscript
463+
:RustLsp openDocs
464+
```
465+
```lua
466+
vim.cmd.RustLsp('openDocs')
467+
```
468+
</details>
469+
455470
<details>
456471
<summary>
457472
<b>Parent Module</b>

doc/rustaceanvim.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ It accepts the following subcommands:
4343
'renderDiagnostic' - Display a hover window with the rendered diagnostic,
4444
as displayed during `cargo build`.
4545
'openCargo' - Open the Cargo.toml file for the current package.
46+
'openDocs' - Open docs.rs documentation for the symbol under the cursor.
4647
'parentModule' - Open the current module's parent module.
4748
'workspaceSymbol {onlyTypes?|allSymbols?} {query?}'
4849
Filtered workspace symbol search.

lua/rustaceanvim/commands/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ local rustlsp_command_tbl = {
139139
require('rustaceanvim.commands.open_cargo_toml')()
140140
end,
141141
},
142+
openDocs = {
143+
impl = function(_)
144+
require('rustaceanvim.commands.external_docs')()
145+
end,
146+
},
142147
parentModule = {
143148
impl = function(_)
144149
require('rustaceanvim.commands.parent_module')()

lua/rustaceanvim/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
--- 'renderDiagnostic' - Display a hover window with the rendered diagnostic,
3737
--- as displayed during `cargo build`.
3838
--- 'openCargo' - Open the Cargo.toml file for the current package.
39+
--- 'openDocs' - Open docs.rs documentation for the symbol under the cursor.
3940
--- 'parentModule' - Open the current module's parent module.
4041
--- 'workspaceSymbol {onlyTypes?|allSymbols?} {query?}'
4142
--- Filtered workspace symbol search.

0 commit comments

Comments
 (0)