From e507af7b996dae90404345abb2bc88540f931589 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 28 Jun 2023 19:32:50 +0200 Subject: feat(command): add completion for option flags for :MasonInstall (#1379) --- lua/mason/api/command.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/mason/api/command.lua b/lua/mason/api/command.lua index 75c101a4..0c2e3e9b 100644 --- a/lua/mason/api/command.lua +++ b/lua/mason/api/command.lua @@ -92,6 +92,7 @@ local function MasonInstall(package_specifiers, opts) version = version, debug = opts.debug, force = opts.force, + strict = opts.strict, target = opts.target, } end) @@ -149,7 +150,14 @@ end, { complete = function(arg_lead) local registry = require "mason-registry" - if _.matches("^.+@", arg_lead) then + if _.starts_with("--", arg_lead) then + return _.filter(_.starts_with(arg_lead), { + "--debug", + "--force", + "--strict", + "--target=", + }) + elseif _.matches("^.+@", arg_lead) then local pkg_name, version = unpack(_.match("^(.+)@(.*)", arg_lead)) local ok, pkg = pcall(registry.get_package, pkg_name) if not ok then -- cgit v1.2.3-70-g09d2