AstroNvim / AstroNvim

AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
https://AstroNvim.com
GNU General Public License v3.0
12.82k stars 930 forks source link

Mason Update errors with tralling charachters #1705

Closed BoolPurist closed 1 year ago

BoolPurist commented 1 year ago

Checklist

Operating system/version

Fedora Linux 37 (Cinnamon) x86_64 with linux kernel 6.2.7-200.fc37.x86_64

Terminal/GUI

Terminal: Alacritty and Multiplexer: Tmux

AstroNvim Health

AstroNvim

Describe the bug

I want to update rust analyzer in mason selectively. When I however type in the command " MasonUpdate rust_analyzer " then I get the error message which does not make any sense to me.

:MasonUpdate rust_analyzer
E488: Trailing characters: rust_analyzer
Press ENTER or type command to continue

I use "rust_analyzer" because that is shown by the command "LspInfo" if I am in a rust file.

I made sure there are no white spaces after the command. Trailling character sounds wrong to me here.

Steps to Reproduce

  1. Go to command mode
  2. type in MasonUpdate rust_analyzer

Expected behavior

Either

Screenshots

No response

Additional Context

No response

mehalter commented 1 year ago

Oh man! That's really bad! I'll investigate this :O

mehalter commented 1 year ago

Oh, I see, MasonUpdate is now a command provided by Mason.... shooot...

mehalter commented 1 year ago

Ok, just to put my thoughts here from my investigation. Mason with their new external registry model has added the command :MasonUpdate which updates the registries and it takes no parameters. This means we need to ideally change our user command here to not conflict which would enforce a breaking change. We will punt this adjustment to AstroNvim v4. In the mean time given the nature of how our command works anyway is that we also update the registries before doing these updates anyway. So I have restructured this command to simply extend the default Mason behavior. If you just call :MasonUpdate with no arguments it will simply do the default Mason behavior of just updating the registries. If you supply an argument then it will also update that specific package. In the meantime I have also extended this further to allow multiple arguments to be passed as well so you can now specify multiple packages that you want to update in particular. This should be a pretty alright override of the default Mason behavior for now.

Things to do with AstroNvim v4 (comments provided in the code as reminders): Change these auto command names so we do not have to worry about overriding this default behavior.

BoolPurist commented 1 year ago

Can confirm this fixes my problem in the meantime. Thanks