As of Fennel 1.6.0, parens in destructuring is deprecated, and we want
to make it easy for people to convert to using table destructuring
instead since it's optimized to compile to the same thing.
Operator with no arguments check failed when the first argument to the
operator was falsy. We might want to have a new lint to check for
"always false/true" expressions but this report was incorrect and the
quickfix replaced incorrect code.
The spec says diagnostic.codeDescription should be an object with an URI
linking to information about the error, we were using it as a string
identifier for the diagnostic.
This was making Helix ignore all diagnostics from fennel-ls.
Changed diagnostic.code to be the string identifier, removed numeric
identifiers and codeDescription field.
The unnecessary tset lint was assuming a single key, but it was
triggering for calls with multiple nested keys, causing the quickfix
action to drop all elements after the fourth argument, which was assumed
to be the value.
Now it's been updated to handle nested calls of any depth.
"Redundant" means that it's a `do` in a context where there's already
an implicit `do`, as defined by fennel.syntax indicating body-form? is
true. Unnecessary means it only has one argument.
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.
This is probably not a good commit message, but basically, if you
require a module foo, and then look for foo.bar.baz, it won't trigger,
but foo.bar will trigger it.
This is getting messy, but now the same sym can reference multiple
places. (. file references mysym) only holds the last one, but
(. file definitions <x> :referenced-by) could still hold older
references.