Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vxpm/ferris.nvim

Neovim plugin for interacting with Rust-Analyzer's LSP extensions
https://github.com/vxpm/ferris.nvim

ferris lua neovim nvim plugin rust rust-analyzer

Last synced: about 2 months ago
JSON representation

Neovim plugin for interacting with Rust-Analyzer's LSP extensions

Awesome Lists containing this project

README

        

# ferris.nvim 🦀
a neovim plugin for interacting with Rust Analyzer's LSP extensions

## installation & usage
_note: this plugin has only been tested with neovim 0.9+_

with lazy.nvim:
```lua
{
'vxpm/ferris.nvim',
opts = {
-- your options here
}
}
```

the available options (and their default values) are:
```lua
{
-- If true, will automatically create commands for each LSP method
create_commands = true, -- bool
-- Handler for URL's (used for opening documentation)
url_handler = "xdg-open", -- string | function(string)
}
```

you can also manually call the methods by requiring them:
```lua
local view_mem_layout = require("ferris.methods.view_memory_layout")

-- call the returned function to execute the request
view_mem_layout()
```
don't forget to call `setup` on `require("ferris")` beforehand, though! (not needed if
you're using the `opts` field in lazy.nvim)

## available methods
please do not mind the terrible screenshots... i was too lazy

Expand Macro

`require("ferris.methods.expand_macro")`

[![image.png](https://i.postimg.cc/8zfhSB9p/image.png)](https://postimg.cc/G4rBPYbV)

Join Lines

`require("ferris.methods.join_lines")`

View HIR

`require("ferris.methods.view_hir")`

[![image.png](https://i.postimg.cc/nr5CRNHv/image.png)](https://postimg.cc/bSxydCSJ)

View MIR

`require("ferris.methods.view_mir")`

[![image.png](https://i.postimg.cc/R0Rq5WSC/image.png)](https://postimg.cc/wt19DTRn)

View Memory Layout

`require("ferris.methods.view_memory_layout")`

[![image.png](https://i.postimg.cc/02wQ5WkB/image.png)](https://postimg.cc/56f1nmFB)

View Item Tree

`require("ferris.methods.view_item_tree")`

View Syntax Tree

`require("ferris.methods.view_syntax_tree")`

Open Cargo.toml

`require("ferris.methods.open_cargo_toml")`

Open Parent Module

`require("ferris.methods.open_parent_module")`

Open Documentation

`require("ferris.methods.open_documentation")`

Reload Workspace

`require("ferris.methods.reload_workspace")`

Rebuild Macros

`require("ferris.methods.rebuild_macros")`

## special thanks
[rust-tools](https://github.com/simrat39/rust-tools.nvim) for being the reason why this plugins exists.
initially, i didn't want any of the features it offered _except_ for recursive expansion of macros, so i made [rust-expand-macro.nvim](https://github.com/vxpm/rust-expand-macro.nvim).

however, i found myself wanting to use other methods as well, which led me to making ferris!

in comparison to rust-tools, this plugin is "simpler": it does not configure Rust Analyzer for you nor does it
provide debugging utilities. i myself consider this a benefit, but it's up to your judgement.