Skip to content

Commit 513d2ba

Browse files
author
Marc Jakobi
committed
docs: use proper vimdoc syntax for commands
1 parent 5d6d145 commit 513d2ba

File tree

3 files changed

+74
-75
lines changed

3 files changed

+74
-75
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ vim.keymap.set(
166166
</summary>
167167

168168
```vimscript
169-
:RustLsp[!] debuggables [args[]]?
169+
:RustLsp[!] debuggables {args[]}?
170170
```
171171
```lua
172172
vim.cmd.RustLsp('debuggables')
@@ -212,7 +212,7 @@ vim.keymap.set(
212212
</summary>
213213

214214
```vimscript
215-
:RustLsp[!] runnables [args[]]?
215+
:RustLsp[!] runnables {args[]}?
216216
```
217217
```lua
218218
vim.cmd.RustLsp('runnables')
@@ -242,7 +242,7 @@ vim.keymap.set(
242242
and will block the UI.
243243

244244
```vimscript
245-
:RustLsp[!] testables [args[]]?
245+
:RustLsp[!] testables {args[]}?
246246
```
247247
```lua
248248
vim.cmd.RustLsp('testables')
@@ -329,8 +329,7 @@ vim.keymap.set(
329329
</summary>
330330

331331
```vimscript
332-
:RustLsp moveItem up
333-
:RustLsp moveItem down
332+
:RustLsp moveItem {up|down}
334333
```
335334
```lua
336335
vim.cmd.RustLsp { 'moveItem', 'up' }
@@ -474,7 +473,7 @@ vim.keymap.set(
474473
rust-analyzer supports filtering workspace symbol searches.
475474

476475
```vimscript
477-
:RustLsp[!] workspaceSymbol [onlyTypes?|allSymbols?] [query?]
476+
:RustLsp[!] workspaceSymbol {onlyTypes?|allSymbols?} {query?}
478477
```
479478
```lua
480479
vim.cmd.RustLsp('workspaceSymbol')
@@ -520,7 +519,7 @@ by setting the rust-analyzer
520519
</summary>
521520

522521
```vimscript
523-
:RustLsp ssr [query]
522+
:RustLsp ssr {query}
524523
```
525524
```lua
526525
vim.cmd.RustLsp { 'ssr', '<query>' --[[ optional ]] }
@@ -536,7 +535,7 @@ by setting the rust-analyzer
536535
</summary>
537536

538537
```vimscript
539-
:RustLsp crateGraph [backend [output]]
538+
:RustLsp crateGraph {backend {output}}
540539
```
541540
```lua
542541
vim.cmd.RustLsp { 'crateGraph', '[backend]', '[output]' }
@@ -577,7 +576,7 @@ by setting the rust-analyzer
577576
can be costly.
578577

579578
```vimscript
580-
:RustLsp flyCheck [run?|clear?|cancel?]
579+
:RustLsp flyCheck {run?|clear?|cancel?}
581580
```
582581
```lua
583582
vim.cmd.RustLsp('flyCheck') -- defaults to 'run'
@@ -603,7 +602,7 @@ by setting the rust-analyzer
603602
Useful for debugging or when working on rust-analyzer itself.
604603

605604
```vimscript
606-
:RustLsp view [hir|mir]
605+
:RustLsp view {hir|mir}
607606
```
608607
```lua
609608
vim.cmd.RustLsp { 'view', 'hir' }
@@ -624,7 +623,7 @@ by setting the rust-analyzer
624623
and a nightly compiler toolchain.
625624

626625
```vimscript
627-
:Rustc unpretty [hir|mir|...]
626+
:Rustc unpretty {hir|mir|...}
628627
```
629628
```lua
630629
vim.cmd.Rustc { 'unpretty', 'hir' }

doc/rustaceanvim.txt

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,59 +19,59 @@ and integrates with other rust tools.
1919

2020
Commands:
2121

22-
`:RustAnalyzer start` - Start the LSP client.
23-
`:RustAnalyzer stop` - Stop the LSP client.
24-
`:RustAnalyzer restart` - Restart the LSP client.
25-
`:RustAnalyzer reloadSettings` - Reload settings for the LSP client.
22+
':RustAnalyzer start' - Start the LSP client.
23+
':RustAnalyzer stop' - Stop the LSP client.
24+
':RustAnalyzer restart' - Restart the LSP client.
25+
':RustAnalyzer reloadSettings' - Reload settings for the LSP client.
2626

27-
The `:RustLsp[!]` command is available after the LSP client has initialized.
27+
The ':RustLsp[!]' command is available after the LSP client has initialized.
2828
It accepts the following subcommands:
2929

30-
`runnables [args[]]?` - Run tests, executables, etc.
31-
`:RustLsp!` means run the last runnable (ignores any args).
30+
'runnables {args[]}?' - Run tests, executables, etc.
31+
':RustLsp!' means run the last runnable (ignores any args).
3232
`args[]` allows you to override the executable's arguments.
33-
`debuggables [args[]]?` - Debug tests, executables, etc. (requires |nvim-dap|).
34-
`:RustLsp!` means run the last debuggable (ignores any args).
33+
'debuggables {args[]}?' - Debug tests, executables, etc. (requires |nvim-dap|).
34+
':RustLsp!' means run the last debuggable (ignores any args).
3535
`args[]` allows you to override the executable's arguments.
36-
`testables [args[]]?` - Run tests
37-
`:RustLsp!` means run the last testable (ignores any args).
36+
'testables {args[]}?' - Run tests
37+
':RustLsp!' means run the last testable (ignores any args).
3838
`args[]` allows you to override the executable's arguments.
39-
`expandMacro` - Expand macros recursively.
40-
`moveItem [up|down]` - Move items up or down.
41-
`hover [actions|range]` - Hover actions, or hover over visually selected range.
42-
`explainError` - Display a hover window with explanations form the Rust error index.
43-
`renderDiagnostic` - Display a hover window with the rendered diagnostic,
39+
'expandMacro' - Expand macros recursively.
40+
'moveItem {up|down}' - Move items up or down.
41+
'hover {actions|range}' - Hover actions, or hover over visually selected range.
42+
'explainError' - Display a hover window with explanations form the Rust error index.
43+
'renderDiagnostic' - Display a hover window with the rendered diagnostic,
4444
as displayed during `cargo build`.
45-
`openCargo` - Open the Cargo.toml file for the current package.
46-
`parentModule` - Open the current module's parent module.
47-
`workspaceSymbol [onlyTypes?|allSymbols?] [query?]`
45+
'openCargo' - Open the Cargo.toml file for the current package.
46+
'parentModule' - Open the current module's parent module.
47+
'workspaceSymbol {onlyTypes?|allSymbols?} {query?}'
4848
Filtered workspace symbol search.
4949
When run with a bang (`:RustLsp! workspaceSymbol ...`),
5050
rust-analyzer will include dependencies in the search.
5151
You can also configure rust-analyzer so that |vim.lsp.buf.workspace_symbol|
5252
supports filtering (with a # suffix to the query) or searching dependencies.
53-
`joinLines` - Join adjacent lines.
54-
`ssr [query]` - Structural search and replace.
55-
`crateGraph [backend]` - Create and view a crate graph with graphviz.
56-
`syntaxTree` - View the syntax tree.
57-
`view [mir|hir]` - View MIR or HIR.
58-
`flyCheck` [run?|clear?|cancel?]
53+
'joinLines' - Join adjacent lines.
54+
'ssr {query}' - Structural search and replace.
55+
'crateGraph {backend}' - Create and view a crate graph with graphviz.
56+
'syntaxTree' - View the syntax tree.
57+
'view {mir|hir}' - View MIR or HIR.
58+
'flyCheck' {run?|clear?|cancel?}
5959
- Run `cargo check` or another compatible command (f.x. `clippy`)
6060
in a background thread and provide LSP diagnostics based on
6161
the output of the command.
6262
Useful in large projects where running `cargo check` on each save
6363
can be costly.
6464
Defaults to `flyCheck run` if called without an argument.
65-
`logFile` - Open the rust-analyzer log file.
65+
'logFile' - Open the rust-analyzer log file.
6666

67-
The `:Rustc` command can be used to interact with rustc.
67+
The ':Rustc' command can be used to interact with rustc.
6868
It accepts the following subcommands:
6969

70-
`unpretty args[]` - Opens a buffer with a textual representation of the MIR or others things,
71-
of the function closest to the cursor.
72-
Achieves an experience similar to Rust Playground.
73-
NOTE: This currently requires a tree-sitter parser for Rust,
74-
and a nightly compiler toolchain.
70+
'unpretty {args[]}' - Opens a buffer with a textual representation of the MIR or others things,
71+
of the function closest to the cursor.
72+
Achieves an experience similar to Rust Playground.
73+
NOTE: This currently requires a tree-sitter parser for Rust,
74+
and a nightly compiler toolchain.
7575

7676
==============================================================================
7777
plugin configuration *rustaceanvim.config*

lua/rustaceanvim/init.lua

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,59 @@
1212
---
1313
---Commands:
1414
---
15-
--- `:RustAnalyzer start` - Start the LSP client.
16-
--- `:RustAnalyzer stop` - Stop the LSP client.
17-
--- `:RustAnalyzer restart` - Restart the LSP client.
18-
--- `:RustAnalyzer reloadSettings` - Reload settings for the LSP client.
15+
--- ':RustAnalyzer start' - Start the LSP client.
16+
--- ':RustAnalyzer stop' - Stop the LSP client.
17+
--- ':RustAnalyzer restart' - Restart the LSP client.
18+
--- ':RustAnalyzer reloadSettings' - Reload settings for the LSP client.
1919
---
20-
---The `:RustLsp[!]` command is available after the LSP client has initialized.
20+
---The ':RustLsp[!]' command is available after the LSP client has initialized.
2121
---It accepts the following subcommands:
2222
---
23-
--- `runnables [args[]]?` - Run tests, executables, etc.
24-
--- `:RustLsp!` means run the last runnable (ignores any args).
23+
--- 'runnables {args[]}?' - Run tests, executables, etc.
24+
--- ':RustLsp!' means run the last runnable (ignores any args).
2525
--- `args[]` allows you to override the executable's arguments.
26-
--- `debuggables [args[]]?` - Debug tests, executables, etc. (requires |nvim-dap|).
27-
--- `:RustLsp!` means run the last debuggable (ignores any args).
26+
--- 'debuggables {args[]}?' - Debug tests, executables, etc. (requires |nvim-dap|).
27+
--- ':RustLsp!' means run the last debuggable (ignores any args).
2828
--- `args[]` allows you to override the executable's arguments.
29-
--- `testables [args[]]?` - Run tests
30-
--- `:RustLsp!` means run the last testable (ignores any args).
29+
--- 'testables {args[]}?' - Run tests
30+
--- ':RustLsp!' means run the last testable (ignores any args).
3131
--- `args[]` allows you to override the executable's arguments.
32-
--- `expandMacro` - Expand macros recursively.
33-
--- `moveItem [up|down]` - Move items up or down.
34-
--- `hover [actions|range]` - Hover actions, or hover over visually selected range.
35-
--- `explainError` - Display a hover window with explanations form the Rust error index.
36-
--- `renderDiagnostic` - Display a hover window with the rendered diagnostic,
32+
--- 'expandMacro' - Expand macros recursively.
33+
--- 'moveItem {up|down}' - Move items up or down.
34+
--- 'hover {actions|range}' - Hover actions, or hover over visually selected range.
35+
--- 'explainError' - Display a hover window with explanations form the Rust error index.
36+
--- 'renderDiagnostic' - Display a hover window with the rendered diagnostic,
3737
--- as displayed during `cargo build`.
38-
--- `openCargo` - Open the Cargo.toml file for the current package.
39-
--- `parentModule` - Open the current module's parent module.
40-
--- `workspaceSymbol [onlyTypes?|allSymbols?] [query?]`
38+
--- 'openCargo' - Open the Cargo.toml file for the current package.
39+
--- 'parentModule' - Open the current module's parent module.
40+
--- 'workspaceSymbol {onlyTypes?|allSymbols?} {query?}'
4141
--- Filtered workspace symbol search.
4242
--- When run with a bang (`:RustLsp! workspaceSymbol ...`),
4343
--- rust-analyzer will include dependencies in the search.
4444
--- You can also configure rust-analyzer so that |vim.lsp.buf.workspace_symbol|
4545
--- supports filtering (with a # suffix to the query) or searching dependencies.
46-
--- `joinLines` - Join adjacent lines.
47-
--- `ssr [query]` - Structural search and replace.
48-
--- `crateGraph [backend]` - Create and view a crate graph with graphviz.
49-
--- `syntaxTree` - View the syntax tree.
50-
--- `view [mir|hir]` - View MIR or HIR.
51-
--- `flyCheck` [run?|clear?|cancel?]
46+
--- 'joinLines' - Join adjacent lines.
47+
--- 'ssr {query}' - Structural search and replace.
48+
--- 'crateGraph {backend}' - Create and view a crate graph with graphviz.
49+
--- 'syntaxTree' - View the syntax tree.
50+
--- 'view {mir|hir}' - View MIR or HIR.
51+
--- 'flyCheck' {run?|clear?|cancel?}
5252
--- - Run `cargo check` or another compatible command (f.x. `clippy`)
5353
--- in a background thread and provide LSP diagnostics based on
5454
--- the output of the command.
5555
--- Useful in large projects where running `cargo check` on each save
5656
--- can be costly.
5757
--- Defaults to `flyCheck run` if called without an argument.
58-
--- `logFile` - Open the rust-analyzer log file.
58+
--- 'logFile' - Open the rust-analyzer log file.
5959
---
60-
---The `:Rustc` command can be used to interact with rustc.
60+
---The ':Rustc' command can be used to interact with rustc.
6161
---It accepts the following subcommands:
6262
---
63-
--- `unpretty args[]` - Opens a buffer with a textual representation of the MIR or others things,
64-
--- of the function closest to the cursor.
65-
--- Achieves an experience similar to Rust Playground.
66-
--- NOTE: This currently requires a tree-sitter parser for Rust,
67-
--- and a nightly compiler toolchain.
63+
--- 'unpretty {args[]}' - Opens a buffer with a textual representation of the MIR or others things,
64+
--- of the function closest to the cursor.
65+
--- Achieves an experience similar to Rust Playground.
66+
--- NOTE: This currently requires a tree-sitter parser for Rust,
67+
--- and a nightly compiler toolchain.
6868
---@brief ]]
6969

7070
local M = {}

0 commit comments

Comments
 (0)