fennel-ls/test
Phil Hagelberg a27f42bfa4 Add match-should-case lint and fix action.
When a `match` call's patterns do not contain any symbols that reference
the outer scope, then there is no reason to use `match`; that call
should be replaced with `case`.

This allocates diagnostic code 308 to match-should-case.

In order to detect this, I had to add a loop over file.lexicals. This
is often a very large table, so it could adverse performance impact. I
believe it is necessary in order to distinguish between case vs match
since other means seem to only be applied after macroexpansion by
which time neither one exists.

I've updated docs/linting.md to mention the new loop and cleaned up a
few things in that file that were outdated.

I've added tests for the new lint to ensure it doesn't trigger when it
shouldn't.
2024-10-10 19:46:59 -05:00
..
utils Add tests for editing flsconfig 2024-07-30 22:30:56 -05:00
capabilities.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
check.fnl --check is now --lint 2024-06-23 15:44:35 -05:00
code-action.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
completion.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
diagnostic.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
goto-definition.fnl goto module definition tested 2024-07-09 20:37:11 -05:00
hover.fnl use fennel 1.5's native debug tracking 2024-09-03 12:17:53 -05:00
init.fnl use fennel 1.5's native debug tracking 2024-09-03 12:17:53 -05:00
json-rpc.fnl Switch from rxi/json to dkjson, switch folder structure 2024-06-09 17:36:19 -05:00
lint.fnl Add match-should-case lint and fix action. 2024-10-10 19:46:59 -05:00
misc.fnl refactoring 2024-07-07 14:31:22 -05:00
references.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
rename.fnl simplify tests. only one create-client function 2024-07-05 00:25:51 -05:00
settings.fnl Add tests for editing flsconfig 2024-07-30 22:30:56 -05:00
string-processing.fnl Change tests to faith 2024-03-01 14:43:26 -06:00