add a fix to pcall docs in 5.1

This commit is contained in:
XeroOl 2025-07-14 22:53:50 -05:00
parent c5f36ac813
commit 20b9381eda
5 changed files with 9 additions and 5 deletions

2
.gitignore vendored
View File

@ -3,6 +3,6 @@
/lua*.html /lua*.html
/build /build
/src/fennel-ls/docs/generated/love2d.fnl /src/fennel-ls/docs/generated/love2d.fnl
/doc/lints.md /docs/lints.md
/scratch.fnl /scratch.fnl
/scratch-macros.fnl /scratch-macros.fnl

View File

@ -66,8 +66,7 @@ deps:
$(FENNEL) $(FENNELFLAGS) tools/get-deps.fnl $(FENNEL) $(FENNELFLAGS) tools/get-deps.fnl
selflint: selflint:
$(FENNEL) $(FENNELFLAGS) src/fennel-ls.fnl --lint $(SRC) $(FENNEL) $(FENNELFLAGS) src/fennel-ls.fnl --lint $(SRC) $(shell find test -name "*.fnl")
$(FENNEL) $(FENNELFLAGS) src/fennel-ls.fnl --lint $(shell find test -name "*.fnl")
count: count:
cloc $(shell find src -name "*.fnl" | grep -v "generated") cloc $(shell find src -name "*.fnl" | grep -v "generated")

View File

@ -1045,7 +1045,7 @@ See function `next` for the caveats of modifying
the table during its traversal."}} the table during its traversal."}}
:pcall {:binding "pcall" :pcall {:binding "pcall"
:metadata {:fls/itemKind "Function" :metadata {:fls/itemKind "Function"
:fnl/arglist ["f" "arg1" "..."] :fnl/arglist ["f" "?arg1" "..."]
:fnl/docstring "Calls function `f` with :fnl/docstring "Calls function `f` with
the given arguments in *protected mode*. the given arguments in *protected mode*.
This means that any error inside `f` is not propagated; This means that any error inside `f` is not propagated;

View File

@ -1,6 +1,6 @@
;; auto-generated by `make docs` from fennel-ls. Contents come from ;; auto-generated by `make docs` from fennel-ls. Contents come from
;; https://www.lua.org/manual/5.4/manual.html ;; https://www.lua.org/manual/5.4/manual.html
;; Lua Lua 5.4 Reference Manual last updated Thu Jun 13 22:15:52 UTC 2024 ;; Lua Lua 5.4 Reference Manual last updated Wed May 21 21:09:59 UTC 2025
(local docs {:_G {:binding "_G" (local docs {:_G {:binding "_G"
:metadata {:fls/itemKind "Variable" :metadata {:fls/itemKind "Variable"
:fnl/docstring "A global variable (not a function) that :fnl/docstring "A global variable (not a function) that

View File

@ -128,6 +128,11 @@
signature (if (signature:find "table%.insert") signature (if (signature:find "table%.insert")
(signature:gsub "%[pos -%]" "") (signature:gsub "%[pos -%]" "")
signature) signature)
signature (if (signature:find "pcall .* arg1")
(do
(table.insert optional-args "arg1")
(signature:gsub "arg1" "?arg1"))
signature)
;; For some reason, they use an html middot, but we want to use periods. ;; For some reason, they use an html middot, but we want to use periods.
signature (signature:gsub "···" "...") signature (signature:gsub "···" "...")
;; fix parens ;; fix parens