@@ -194,32 +194,39 @@ require("mason").setup({
194194## Default configuration
195195
196196``` lua
197+ --- @class MasonSettings
197198local DEFAULT_SETTINGS = {
199+ --- @since 1.0.0
198200 -- The directory in which to install packages.
199201 install_root_dir = path .concat { vim .fn .stdpath " data" , " mason" },
200202
203+ --- @since 1.0.0
201204 -- Where Mason should put its bin location in your PATH. Can be one of:
202205 -- - "prepend" (default, Mason's bin location is put first in PATH)
203206 -- - "append" (Mason's bin location is put at the end of PATH)
204207 -- - "skip" (doesn't modify PATH)
205208 --- @type ' "prepend"' | ' "append"' | ' "skip"'
206209 PATH = " prepend" ,
207210
211+ --- @since 1.0.0
208212 -- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
209213 -- debugging issues with package installations.
210214 log_level = vim .log .levels .INFO ,
211215
216+ --- @since 1.0.0
212217 -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further
213218 -- packages that are requested to be installed will be put in a queue.
214219 max_concurrent_installers = 4 ,
215220
221+ --- @since 1.0.0
216222 -- [Advanced setting]
217223 -- The registries to source packages from. Accepts multiple entries. Should a package with the same name exist in
218224 -- multiple registries, the registry listed first will be used.
219225 registries = {
220226 " github:mason-org/mason-registry" ,
221227 },
222228
229+ --- @since 1.0.0
223230 -- The provider implementations to use for resolving supplementary package metadata (e.g., all available versions).
224231 -- Accepts multiple entries, where later entries will be used as fallback should prior providers fail.
225232 -- Builtin providers are:
@@ -231,6 +238,7 @@ local DEFAULT_SETTINGS = {
231238 },
232239
233240 github = {
241+ --- @since 1.0.0
234242 -- The template URL to use when downloading assets from GitHub.
235243 -- The placeholders are the following (in order):
236244 -- 1. The repository (e.g. "rust-lang/rust-analyzer")
@@ -240,9 +248,11 @@ local DEFAULT_SETTINGS = {
240248 },
241249
242250 pip = {
251+ --- @since 1.0.0
243252 -- Whether to upgrade pip to the latest version in the virtual environment before installing packages.
244253 upgrade_pip = false ,
245254
255+ --- @since 1.0.0
246256 -- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior
247257 -- and is not recommended.
248258 --
@@ -251,50 +261,72 @@ local DEFAULT_SETTINGS = {
251261 },
252262
253263 ui = {
264+ --- @since 1.0.0
254265 -- Whether to automatically check for new versions when opening the :Mason window.
255266 check_outdated_packages_on_open = true ,
256267
268+ --- @since 1.0.0
257269 -- The border to use for the UI window. Accepts same border values as |nvim_open_win()|.
258270 border = " none" ,
259271
272+ --- @since 1.0.0
260273 -- Width of the window. Accepts:
261274 -- - Integer greater than 1 for fixed width.
262275 -- - Float in the range of 0-1 for a percentage of screen width.
263276 width = 0.8 ,
264277
278+ --- @since 1.0.0
265279 -- Height of the window. Accepts:
266280 -- - Integer greater than 1 for fixed height.
267281 -- - Float in the range of 0-1 for a percentage of screen height.
268282 height = 0.9 ,
269283
270284 icons = {
285+ --- @since 1.0.0
271286 -- The list icon to use for installed packages.
272287 package_installed = " ◍" ,
288+ --- @since 1.0.0
273289 -- The list icon to use for packages that are installing, or queued for installation.
274290 package_pending = " ◍" ,
291+ --- @since 1.0.0
275292 -- The list icon to use for packages that are not installed.
276293 package_uninstalled = " ◍" ,
277294 },
278295
279296 keymaps = {
297+ --- @since 1.0.0
280298 -- Keymap to expand a package
281299 toggle_package_expand = " <CR>" ,
300+ --- @since 1.0.0
282301 -- Keymap to install the package under the current cursor position
283302 install_package = " i" ,
303+ --- @since 1.0.0
284304 -- Keymap to reinstall/update the package under the current cursor position
285305 update_package = " u" ,
306+ --- @since 1.0.0
286307 -- Keymap to check for new version for the package under the current cursor position
287308 check_package_version = " c" ,
309+ --- @since 1.0.0
288310 -- Keymap to update all installed packages
289311 update_all_packages = " U" ,
312+ --- @since 1.0.0
290313 -- Keymap to check which installed packages are outdated
291314 check_outdated_packages = " C" ,
315+ --- @since 1.0.0
292316 -- Keymap to uninstall a package
293317 uninstall_package = " X" ,
318+ --- @since 1.0.0
294319 -- Keymap to cancel a package installation
295320 cancel_installation = " <C-c>" ,
321+ --- @since 1.0.0
296322 -- Keymap to apply language filter
297323 apply_language_filter = " <C-f>" ,
324+ --- @since 1.1.0
325+ -- Keymap to toggle viewing package installation log
326+ toggle_package_install_log = " <CR>" ,
327+ --- @since 1.8.0
328+ -- Keymap to toggle the help view
329+ toggle_help = " g?" ,
298330 },
299331 },
300332}
0 commit comments