Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: rename this plugin to rustaceanvim #5

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0] - 2023-10-22

### Changed

- Renamed this plugin to `rustaceanvim`,
to avoid potential clashes with [`vxpm/ferris.nvim`](https://github.com/vxpm/ferris.nvim),
`vxpm/ferris.nvim` was created just before I renamed my fork
(but after I had checked the web for name clashes (╯°□°)╯︵ ┻━┻).

## [2.1.1] - 2023-10-22

### Fixed
Expand All @@ -17,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add a `vim.g.ferris.server.auto_attach` option, which
- Add a `vim.g.rustaceanvim.server.auto_attach` option, which
can be a `boolean` or a `fun():boolean` that determines
whether or not to auto-attach the LSP client when opening
a Rust file.
Expand Down Expand Up @@ -49,12 +58,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.0] - 2023-10-21

### Added
- Initial release of `ferris.nvim`.
- Initial release of `rustaceanvim`.
- `:RustSyntaxTree` and `:RustFlyCheck` commands.
- `:RustAnalyzerStart` and `:RustAnalyzerStop` commands.
- Config validation.
- Health checks (`:checkhealth ferris`).
- Vimdocs (auto-generated from Lua docs - `:help ferris`).
- Health checks (`:checkhealth rustaceanvim`).
- Vimdocs (auto-generated from Lua docs - `:help rustaceanvim`).
- Nix flake.
- Allow `tools.executor` to be a string.
- LuaRocks releases.
Expand All @@ -75,7 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
to be less prone to type errors.
This plugin is a filetype plugin and works out of the box.
The default configuration should work for most people,
but it can be configured with a `vim.g.ferris` table.
but it can be configured with a `vim.g.rustaceanvim` table.
- Removed the `lspconfig` dependency.
This plugin now uses the built-in LSP client API.
You can use `:RustAnalyzerStart` and `:RustAnalyzerStop`
Expand Down
51 changes: 24 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!-- markdownlint-disable -->
<br />
<div align="center">
<a href="https://github.com/mrcjkb/ferris.nvim">
<img src="./nvim-ferris.svg" alt="ferris.nvim">
<a href="https://github.com/mrcjkb/rustaceanvim">
<img src="./rustaceanvim.svg" alt="rustaceanvim">
</a>
<p align="center">
<br />
<a href="./doc/ferris.txt"><strong>Explore the docs »</strong></a>
<a href="./doc/rustaceanvim.txt"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/mrcjkb/ferris.nvim/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a>
<a href="https://github.com/mrcjkb/rustaceanvim/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml">Report Bug</a>
·
<a href="https://github.com/mrcjkb/ferris.nvim/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a>
<a href="https://github.com/mrcjkb/rustaceanvim/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml">Request Feature</a>
·
<a href="https://github.com/mrcjkb/ferris.nvim/discussions/new?category=q-a">Ask Question</a>
<a href="https://github.com/mrcjkb/rustaceanvim/discussions/new?category=q-a">Ask Question</a>
</p>
<p>
<strong>
Expand Down Expand Up @@ -69,8 +69,8 @@ Example using [`lazy.nvim`](https://github.com/folke/lazy.nvim):

```lua
{
'mrcjkb/ferris.nvim',
version = '^2', -- Recommended
'mrcjkb/rustaceanvim',
version = '^3', -- Recommended
ft = { 'rust' },
}
```
Expand Down Expand Up @@ -276,12 +276,12 @@ for more configuration options.

## Advanced configuration

To modify the default configuration, set `vim.g.ferris`.
To modify the default configuration, set `vim.g.rustaceanvim`.

- See [`:help ferris.config`](./doc/ferris.txt) for a detailed
- See [`:help rustaceanvim.config`](./doc/rustaceanvim.txt) for a detailed
documentation of all available configuration options.
You may need to run `:helptags ALL` if the documentation has not been installed.
- The default configuration [can be found here (see `FerrisDefaultConfig`)](./lua/ferris/config/internal.lua).
- The default configuration [can be found here (see `RustaceanDefaultConfig`)](./lua/rustaceanvim/config/internal.lua).
- For detailed descriptions of the language server configs,
see the [`rust-analyzer` documentation](https://rust-analyzer.github.io/manual.html#configuration).

Expand All @@ -293,7 +293,7 @@ are applied for keys that are not provided.
Example config:

```lua
vim.g.ferris = {
vim.g.rustaceanvim = {
-- Plugin configuration
tools = {
},
Expand All @@ -314,14 +314,14 @@ vim.g.ferris = {

> **Note**
>
> `vim.g.ferris` can also be a function that returns
> `vim.g.rustaceanvim` can also be a function that returns
> a table.

## Troubleshooting

### Health checks

For a health check, run `:checkhealth ferris`
For a health check, run `:checkhealth rustaceanvim`

### Minimal config

Expand All @@ -344,14 +344,11 @@ until you can reproduce it.
This plugin is a heavily modified fork of `rust-tools.nvim`.
- [`Saecki/crates.nvim`](https://github.com/Saecki/crates.nvim)
- [`vxpm/ferris.nvim`](https://github.com/vxpm/ferris.nvim)
This project was created just before I renamed my fork
(but after I had checked the web for name clashes (╯°□°)╯︵ ┻━┻).
It is geared towards people who prefer manual LSP
client configuration.
Geared towards people who prefer manual LSP client configuration.

## Inspiration

This plugin draws inspiration from [`akinsho/flutter-tools.nvim`](https://github.com/akinsho/flutter-tools.nvim)
`rust-tools.nvim` draws inspiration from [`akinsho/flutter-tools.nvim`](https://github.com/akinsho/flutter-tools.nvim)

<!-- markdownlint-disable -->
<!-- prettier-ignore-end -->
Expand All @@ -365,11 +362,11 @@ This plugin draws inspiration from [`akinsho/flutter-tools.nvim`](https://github
[nix-url]: https://nixos.org/
[rust-shield]: https://img.shields.io/badge/Rust-000000?style=for-the-badge&logo=rust&logoColor=white
[rust-url]: https://www.rust-lang.org/
[issues-shield]: https://img.shields.io/github/issues/mrcjkb/ferris.nvim.svg?style=for-the-badge
[issues-url]: https://github.com/mrcjkb/ferris.nvim/issues
[license-shield]: https://img.shields.io/github/license/mrcjkb/ferris.nvim.svg?style=for-the-badge
[license-url]: https://github.com/mrcjkb/ferris.nvim/blob/master/LICENSE
[ci-shield]: https://img.shields.io/github/actions/workflow/status/mrcjkb/ferris.nvim/nix-build.yml?style=for-the-badge
[ci-url]: https://github.com/mrcjkb/ferris.nvim/actions/workflows/nix-build.yml
[luarocks-shield]: https://img.shields.io/luarocks/v/MrcJkb/ferris.nvim?logo=lua&color=purple&style=for-the-badge
[luarocks-url]: https://luarocks.org/modules/MrcJkb/ferris.nvim
[issues-shield]: https://img.shields.io/github/issues/mrcjkb/rustaceanvim.svg?style=for-the-badge
[issues-url]: https://github.com/mrcjkb/rustaceanvim/issues
[license-shield]: https://img.shields.io/github/license/mrcjkb/rustaceanvim.svg?style=for-the-badge
[license-url]: https://github.com/mrcjkb/rustaceanvim/blob/master/LICENSE
[ci-shield]: https://img.shields.io/github/actions/workflow/status/mrcjkb/rustaceanvim/nix-build.yml?style=for-the-badge
[ci-url]: https://github.com/mrcjkb/rustaceanvim/actions/workflows/nix-build.yml
[luarocks-shield]: https://img.shields.io/luarocks/v/MrcJkb/rustaceanvim?logo=lua&color=purple&style=for-the-badge
[luarocks-url]: https://luarocks.org/modules/MrcJkb/rustaceanvim
58 changes: 29 additions & 29 deletions doc/ferris.txt → doc/rustaceanvim.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
==============================================================================
Table of Contents *ferris.contents*
Table of Contents *rustaceanvim.contents*

Introduction ··························································· |intro|
······································································ |ferris|
plugin configuration ··········································· |ferris.config|
································································ |rustaceanvim|
plugin configuration ····································· |rustaceanvim.config|

==============================================================================
Introduction *intro*
Expand All @@ -12,7 +12,7 @@ This plugin automatically configures the `rust-analyzer` builtin LSP client
and integrates with other rust tools.

==============================================================================
*ferris*
*rustaceanvim*


Commands:
Expand Down Expand Up @@ -41,24 +41,24 @@ It accepts the following subcommands:
can be costly.

==============================================================================
plugin configuration *ferris.config*
plugin configuration *rustaceanvim.config*


ferris.nvim is a filetype plugin, and does not need
rustaceanvim is a filetype plugin, and does not need
a `setup` function to work.

To configure ferris.nvim, set the variable `vim.g.ferris`,
which is a `FerrisOpts` table, in your neovim configuration.
To configure rustaceanvim, set the variable `vim.g.rustaceanvim`,
which is a `RustaceanOpts` table, in your neovim configuration.

Example:
>
---@type FerrisOpts
vim.g.ferris = {
---@type FerrisToolsOpts
---@type RustaceanOpts
vim.g.rustaceanvim = {
---@type RustaceanToolsOpts
tools = {
-- ...
},
---@type FerrisLspClientOpts
---@type RustaceanLspClientOpts
server = {
on_attach = function(client, bufnr)
-- Set keybindings, etc. here.
Expand All @@ -68,35 +68,35 @@ vim.g.ferris = {
},
-- ...
},
---@type FerrisDapOpts
---@type RustaceanDapOpts
dap = {
-- ...
},
}
<

Note: `vim.g.ferris` can also be a function that returns a 'FerrisOpts' table.
Note: `vim.g.rustaceanvim` can also be a function that returns a 'RustaceanOpts' table.


FerrisOpts *FerrisOpts*
RustaceanOpts *RustaceanOpts*

Fields: ~
{tools?} (FerrisToolsOpts) Plugin options
{server?} (FerrisLspClientOpts) Language server client options
{dap?} (FerrisDapOpts) Debug adapter options
{tools?} (RustaceanToolsOpts) Plugin options
{server?} (RustaceanLspClientOpts) Language server client options
{dap?} (RustaceanDapOpts) Debug adapter options


FerrisToolsOpts *FerrisToolsOpts*
RustaceanToolsOpts *RustaceanToolsOpts*

Fields: ~
{executor?} (FerrisExecutor|executor_alias)
{executor?} (RustaceanExecutor|executor_alias)
{on_initialized?} (fun(health:lsp_server_health_status)) Function that is invoked when the LSP server has finished initializing
{reload_workspace_from_cargo_toml?} (boolean) Automatically call `RustReloadWorkspace` when writing to a Cargo.toml file
{hover_actions?} (FerrisHoverActionsOpts) Options for hover actions
{create_graph?} (FerrisCrateGraphConfig) Options for showing the crate graph based on graphviz and the dot
{hover_actions?} (RustaceanHoverActionsOpts) Options for hover actions
{create_graph?} (RustaceanCrateGraphConfig) Options for showing the crate graph based on graphviz and the dot


FerrisHoverActionsOpts *FerrisHoverActionsOpts*
RustaceanHoverActionsOpts *RustaceanHoverActionsOpts*

Fields: ~
{replace_builtin_hover?} (boolean) Whether to replace Neovim's built-in `vim.lsp.buf.hover`
Expand All @@ -112,7 +112,7 @@ lsp_server_health_status *lsp_server_health_status*
"ok"|"warning"|"error"


FerrisCrateGraphConfig *FerrisCrateGraphConfig*
RustaceanCrateGraphConfig *RustaceanCrateGraphConfig*

Fields: ~
{backend?} (string) Backend used for displaying the graph. See: https://graphviz.org/docs/outputs/ Defaults to `"x11"` if unset.
Expand All @@ -121,27 +121,27 @@ FerrisCrateGraphConfig *FerrisCrateGraphConfig*
{pipe?} (string) Overide the pipe symbol in the shell command. Useful if using a shell that is not supported by this plugin.


FerrisLspClientOpts *FerrisLspClientOpts*
RustaceanLspClientOpts *RustaceanLspClientOpts*

Fields: ~
{auto_attach?} (boolean|fun():boolean) Whether to automatically attach the LSP client. Defaults to `true` if the `rust-analyzer` executable is found.
{cmd?} (string[]|fun():string[]) Command and arguments for starting rust-analyzer
{standalone?} (boolean) Standalone file support (enabled by default). Disabling it may improve rust-analyzer's startup time.


FerrisDapOpts *FerrisDapOpts*
RustaceanDapOpts *RustaceanDapOpts*
@field rust-analyzer? table Options to send to rust-analyzer. See: https://rust-analyzer.github.io/manual.html#configuration

Fields: ~
{adapter?} (FerrisDapAdapterOpts) Options for the debug adapter
{adapter?} (RustaceanDapAdapterOpts) Options for the debug adapter


FerrisDapAdapterOpts *FerrisDapAdapterOpts*
RustaceanDapAdapterOpts *RustaceanDapAdapterOpts*

Fields: ~
{type?} (string) The type of debug adapter (default: `"executable"`)
{command?} (string) Default: `"lldb-vscode"`
{name?} (string) Default: `"ferris_lldb"`
{name?} (string) Default: `"rustaceanvim_lldb"`


vim:tw=78:ts=8:noet:ft=help:norl:
10 changes: 5 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
neodev-nvim,
...
}: let
name = "ferris.nvim";
name = "rustaceanvim";

plugin-overlay = import ./nix/plugin-overlay.nix {
inherit name self;
Expand Down Expand Up @@ -111,7 +111,7 @@
};

devShell = pkgs.mkShell {
name = "ferris.nvim devShell";
name = "rustaceanvim devShell";
inherit (pre-commit-check) shellHook;
buildInputs = with pre-commit-hooks.packages.${system}; [
alejandra
Expand All @@ -131,11 +131,11 @@
};

packages = let
ferris-nvim = pkgs.ferris-nvim;
rustaceanvim-nvim = pkgs.rustaceanvim-nvim;
in {
default = ferris-nvim;
default = rustaceanvim-nvim;
inherit
ferris-nvim
rustaceanvim-nvim
docgen
;
};
Expand Down
14 changes: 7 additions & 7 deletions ftplugin/rust.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---@type FerrisConfig
local config = require('ferris.config.internal')
local types = require('ferris.types.internal')
local lsp = require('ferris.lsp')
---@type RustaceanConfig
local config = require('rustaceanvim.config.internal')
local types = require('rustaceanvim.types.internal')
local lsp = require('rustaceanvim.lsp')

local auto_attach = types.evaluate(config.server.auto_attach)
if not auto_attach then
return
end

vim.lsp.commands['rust-analyzer.runSingle'] = function(command)
local runnables = require('ferris.runnables')
local runnables = require('rustaceanvim.runnables')
runnables.run_command(1, command.arguments)
end

Expand All @@ -25,9 +25,9 @@ vim.lsp.commands['rust-analyzer.showReferences'] = function(_)
end

vim.lsp.commands['rust-analyzer.debugSingle'] = function(command)
local overrides = require('ferris.overrides')
local overrides = require('rustaceanvim.overrides')
overrides.sanitize_command_for_debugging(command.arguments[1].args.cargoArgs)
local rt_dap = require('ferris.dap')
local rt_dap = require('rustaceanvim.dap')
rt_dap.start(command.arguments[1].args)
end

Expand Down
21 changes: 0 additions & 21 deletions lua/ferris/executors/init.lua

This file was deleted.

Loading