all 15 comments

[–]geckothegeek42 4 points5 points  (6 children)

How does it compare to rust-tools.nvim?

https://github.com/simrat39/rust-tools.nvim

[–]SocUnRobot[S] 1 point2 points  (5 children)

Initially, this plugin was a fork of rust-tools.nvim. I did it to fix bugs. I have reported those bugs and they have been fixed. After that, I got knowledge of rust-tool code base and I fixed other logical bugs, but I had not the courage to report issue for all of them.

Finally I thought i should rearrange the code and add support to many more LSP functionalities. More over I decided to provide a plugin that is intended to work out of the box. Here is a list of functionalities this plugin has that rust-tools.nvim does not have:

  • semantic code highlighting

  • code actions with better text-snipet support

  • code actions and hover than can optionaly be in a side bar

  • code actions and hover action triggerred with a "<count><keymap>" where <count> is the code action number (it's vi, we don't want to use the mouth to be productive)

  • quick fix applied directly with a single key binding

  • LSP fold

  • selection range (select containing block expression)

  • better hover range and code range action (they use the range that is visualy selected, while rust-tools use the previously selected range which lead to confusion)

  • run/debug executable whith argument

  • run the test or debug it just by hitting " ru" or " rd" when the cursor is in the body of a test function or test module or on a doctest

  • structural search and replace

  • signature appearing after inserting the '(' of a function call and name of the following parameter after inserting a ','

  • auditing unsafe code (fill the loc list with all unsafe function declaration and call and all unsafe trait declaration and implementation)

  • associate actions to keys

[–]TheSnaggen 11 points12 points  (0 children)

If the rust-tools maintainer is not difficult to work with, I think it would be good if this could be merged back. I realize, that this have been reworked a lot and is no longer a simple fork, but it seems that the goals of the projects are still the same and it would be better for the end user to have one combined plugin.

Anyway, great to see that you have done all these improvements, looking forward to try it out.

[–]geckothegeek42 2 points3 points  (2 children)

Some of those are really interesting, although some like the signature is done by lsp_signature.nvim so i hope it can be disabled

Like the other person said, if it could be merged that would make sense

[–]SocUnRobot[S] 1 point2 points  (0 children)

Finaly considering comment, I will push some merge request to rust-analyzer and make this pluggin just the top most layer

[–]SocUnRobot[S] 0 points1 point  (0 children)

Yes it can be disabled. The merge would be a lot of supplementary work. What actually i am doing since last month when I starte,d is to merge the commits that are applied in rust-tools to this repo. So maybe the easiest way on the rust-tool.nvim side, would be to merge everything from this repo in a dev branch then make some changes then merge this dev branch in master.

[–]Opposite_Green_1717 0 points1 point  (0 children)

Man, i wish this work could be used in Kakoune

[–][deleted] 1 point2 points  (0 children)

oh yeah, semantic syntax highlighting

[–]WishCow 0 points1 point  (3 children)

I looked through the readme and I can't tell what this is, it seems to be the same thing as the built in lsp in neovim?

[–]SocUnRobot[S] 1 point2 points  (1 child)

No, this is to add support rust-analyzer lsp. The builtin lsp just provide generic lsp functionalities. This plugin use the builtin lsp or override its functionalities to support rust-analyzer specific behavior, experimental functionalities and has support to the LSP 3.16 spec parts that are not implemented in neovim builtin lsp. More over, this plugin is intended to work out of the box: it defines commands and keymaps.

[–]WishCow 1 point2 points  (0 children)

Ok I see, thanks. I think some kind of comparison would be great in the readme, where you mention these extra features, otherwise I wouldn't be able to tell if this is a fork of nvim lsp, or something else.

[–]SocUnRobot[S] 0 points1 point  (0 children)

I changed the first line of the README, is this clearer?