We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd7835b commit 87eb3acCopy full SHA for 87eb3ac
lua/mason-registry/sources/init.lua
@@ -2,10 +2,21 @@ local _ = require "mason-core.functional"
2
3
local M = {}
4
5
+---@param str string
6
+local function split_once_left(str, char)
7
+ for i = 1, #str do
8
+ if str:sub(i, i) == char then
9
+ local segment = str:sub(1, i - 1)
10
+ return segment, str:sub(i + 1)
11
+ end
12
13
+ return str
14
+end
15
+
16
---@param registry_id string
17
---@return fun(): RegistrySource # Thunk to instantiate provider.
18
local function parse(registry_id)
- local type, id = registry_id:match "^(.+):(.+)$"
19
+ local type, id = split_once_left(registry_id, ":")
20
if type == "github" then
21
local namespace, name = id:match "^(.+)/(.+)$"
22
if not namespace or not name then
0 commit comments