Recognize deprecated functions that haven't been removed yet.

This commit is contained in:
Phil Hagelberg 2025-02-28 04:18:36 -08:00
parent 024083c7d2
commit 32350ec44b
3 changed files with 16 additions and 5 deletions

View File

@ -22,6 +22,10 @@ refactor brainstorm:
Here is my feature wishlist. I don't expect to ever get all of this
done, but these are the sort of enhancements I am thinking about.
- [ ] Improved global checks
- [ ] (or table.unpack _G.unpack) should be allowed on any Lua version
- [ ] generate man page
- [ ] load lints from external sources (sandboxed)
- [X] Able to connect to a client
- [X] Support for UTF-8 characters that aren't just plain ASCII. (especially `λ`) (perhaps just tell the IDE that I want to communicate with utf-8 offsets)
- [ ] People have tried fennel-ls in:
@ -30,10 +34,6 @@ done, but these are the sort of enhancements I am thinking about.
- [X] helix
- [X] vscode (publish an extension)
- [ ] vim+coc (publish a node thingy)
- [ ] Improved global checks
- [ ] (or table.unpack _G.unpack) should be allowed on any Lua version
- [ ] generate man page
- [ ] load lints from external sources (sandboxed)
- [x] Go-to-definition:
- [X] literal table constructor
- [X] table destructuring

View File

@ -37,6 +37,12 @@
(set lua-versions.lua51.package.fields.config
lua-versions.lua52.package.fields.config)
;; deprecated but not removed
(each [_ f (ipairs [:atan2 :cosh :sinh :tanh :pow :frexp :ldexp])]
(set (. lua-versions.lua53.math.fields f) (. lua-versions.lua52.math.fields f)))
(set lua-versions.lua53.bit32 lua-versions.lua52.bit32)
(each [_ version (pairs lua-versions)]
(each [k v (pairs version)]
(set (. lua-versions.union k) v)))

View File

@ -155,7 +155,12 @@
[]
[{:message "unknown identifier: unpack"}
{:message "unknown identifier: warn"}]
{:lua-version "union"}))
{:lua-version "union"})
;; deprecated functions still work
(check "(print (math.atan2 (tonumber (io.read))))"
[]
[{:message "unknown field: math.atan2"}]
{:lua-version "lua5.3"}))
{: test-lua-versions
: test-compile-error