Support completions of x: symbols

This commit is contained in:
XeroOl 2023-05-27 21:10:49 -05:00
parent 61899dd6c5
commit 7f8942fde6
3 changed files with 4 additions and 4 deletions

2
fennel
View File

@ -5117,7 +5117,7 @@ package.preload["fennel.utils"] = package.preload["fennel.utils"] or function(..
end
return ((0 < #parts) and parts)
end
return ((str:match("%.") or str:match(":")) and not str:match("%.%.") and (str:byte() ~= string.byte(".")) and (str:byte(( - 1)) ~= string.byte(".")) and _154_())
return ((str:match("%.") or str:match(":")) and not str:match("%.%.") and (str:byte() ~= string.byte(".")) and (str:byte(-1) ~= string.byte(".")) and (str:byte() ~= string.byte(":")) and (str:byte(-1) ~= string.byte(":")) and _154_())
end
end
local function quoted_3f(symbol)

View File

@ -4919,7 +4919,7 @@ package.preload["fennel.utils"] = package.preload["fennel.utils"] or function(..
end
return ((0 < #parts) and parts)
end
return ((str:match("%.") or str:match(":")) and not str:match("%.%.") and (str:byte() ~= string.byte(".")) and (str:byte(( - 1)) ~= string.byte(".")) and _154_())
return ((str:match("%.") or str:match(":")) and not str:match("%.%.") and (str:byte() ~= string.byte(".")) and (str:byte(-1) ~= string.byte(".")) and (str:byte() ~= string.byte(":")) and (str:byte(-1) ~= string.byte(":")) and _154_())
end
end
local function quoted_3f(symbol)

View File

@ -70,8 +70,8 @@
(it "still completes items from the previous definitions in the same `let`"
(check-completion "(let [a 10\n b 20\n " 1 6 [:a :b]))
;; (it "completes fields with a partially typed multisym that ends in :"
;; (check-completion "(local x {:field (fn [])})\n(x:" 1 3 [:field]))
(it "completes fields with a partially typed multisym that ends in :"
(check-completion "(local x {:field (fn [])})\n(x:" 1 3 [:field]))
(it "doesn't crash with a partially typed multisym contains ::"
(check-no-completion "(local x {:field (fn [])})\n(x::f" 1 3 [:field])))