Open cloudlena opened 1 year ago
Would you consider a lockfile (similar to lazy.nvim's lockfile mechanism) to be the source of truth, or are you looking for a programmatic, Lua-based, interface for managing desired package state?
I think, the lockfile approach is great for reproducibility. However, personally, I've never interacted directly with the Mason lockfile, so I'm not sure how it works underneath. I just run :Lazy sync
and would prefer something similar for Mason.
What does :Lazy sync
do?
It runs install, clean and update for the Lazy package manager: https://github.com/folke/lazy.nvim#-usage
I was looking for a sync
command and I was pointed to this issue by the oracle. Sync execution would also help with programmatic updates. For example, I use something like this:
nvim --headless -c "Lazy! sync" -c "Lazy! log" +qa
nvim --headless -c 'MasonUpdate' -c 'sleep 10' +qa
nvim --headless -c 'TSUpdateSync' +qa
As of now, I have to sleep to get Mason to complete its task, and hope the number of seconds is enough.
@anjos #1347 should fix :MasonUpdate
to behave similarly to :MasonInstall
in headless mode (i.e. synchronously blocking until completion).
I have tried:
nvim -c "MasonUpdate" -c quitall
but it exists immediately.
nvim -c "MasonUpdate
completes the update but it does not exit.
Any suggestions?
Thanks.
Which commit are you on?
I have done a "+Lazy! sync" before writing that post and now, and I got the same behavior. How can I see which commit?
Thanks
where have you looked so far?
so :Mason
then g?
returns "registry version": "2023-06-13-loyal-east.
But I am not sure where is the git folder downloaded by "Lazy".
I think this would be an awesome idea. I just migrated to Neovim and Mason is fantastic. I love its ease of use for installing things.
One thing that I was conflicted on is the ease of use in installing anything/everything LSP wise, but then the conflicted nature of wanting to have everything 'solidified' in my config, explicitly.
I ended up deciding on explicitly defining everything, but a lockfile would be perfect, or uninstalling servers that are not specified. It's not super important I suppose, but keeping installation in sync with the config means there would be only one source of truth, while i could still use the interface to experiment with installing any kinds of new ones that I want
I've searched open issues for similar requests
Yes
Is your feature request related to a problem? Please describe.
I would like to manage my tools declaratively in a Lua config file. To do so, I'd like Mason to check, whether there are tools currently installed, that aren't in the config file.
Describe the solution you'd like
I would propose to add a
:MasonClean
command, that removes all tools that aren't specified inensure_installed
lists of the different config helpers like https://github.com/williamboman/mason-lspconfig.nvim, https://github.com/jay-babu/mason-null-ls.nvim or https://github.com/jay-babu/mason-nvim-dap.nvim.For convenience, I would also propose a
:MasonSync
command which includes:MasonClean
,:MasonInstall
and eventually, after https://github.com/williamboman/mason.nvim/issues/445 is closed, something like the there proposed:MasonUpdateAll
command.This would provide a user experience like what we have for package managers like https://github.com/wbthomason/packer.nvim or https://github.com/folke/lazy.nvim.
Describe potential alternatives you've considered
No response
Additional context
No response