Commit Graph

458 Commits

Author SHA1 Message Date
XeroOl
7750afba4e change the CI to run the tests before doing linting 2025-07-02 22:41:11 -05:00
XeroOl
1e8784a55a rework hovering 2025-07-02 22:37:02 -05:00
XeroOl
0641b1b098 simplify completions 2025-07-02 19:11:10 -05:00
XeroOl
ad136b00ec use ? line numbers when position is unknown in --lint
I only did this for compile errors, not parse errors or lint errors.
2025-07-01 00:00:26 -05:00
XeroOl
e2e020e3ba slightly better hashfn support 2025-06-28 19:35:39 -05:00
XeroOl
67663d8271 simplify search api 2025-06-28 17:47:51 -05:00
XeroOl
6826c7584d maintenance of makefile and tools 2025-06-28 00:47:15 -05:00
XeroOl
264719047a bump bundled dkjson to latest 2.8 2025-06-27 23:47:16 -05:00
Phil Hagelberg
ac2ce4d8f2 Fix linting example. 2025-06-27 14:02:38 -07:00
XeroOl
dca991eb2f clean up formatter code
? only on optional fields, instead of randomly.
also, don't use the variable name `symbol` for things that aren't
fennel.sym?

remove message.array entirely: dkjson defaults to [] not {} on empty
tables.
2025-06-25 01:12:00 -05:00
XeroOl
01b03de17f error parameter hotfix, but better 2025-06-25 00:55:07 -05:00
XeroOl
fc57612fea clean up quickfix lint title system 2025-06-25 00:52:46 -05:00
XeroOl
623700e1a2 Revert "add an empty parameters list in case of error"
This reverts commit e2b26c5cff.
2025-06-24 12:11:03 -05:00
XeroOl
e2b26c5cff add an empty parameters list in case of error 2025-06-24 11:23:50 -05:00
XeroOl
6f946c76ea add lint that (let [] ...) should be (do ...) 2025-06-19 12:56:29 -05:00
XeroOl
e355534d8d Release 0.2.1
= 0.2.1 =

== Bug Fixes ==
* Fixed a path issue finding external docsets
* Fixed failing tests in 0.2.0
2025-06-06 12:44:08 -05:00
XeroOl
c644ce54ab fix path-join again, for old lua versions 2025-06-06 12:16:58 -05:00
XeroOl
cb9f09ba84 hotfix issue with path join
Not sure why I didn't test these changes, but the path-join function
didn't actually work fully as expected.
Now, various edge cases have been ironed out:
"/path" + "/foo/bar" -> "/foo/bar", instead of "/path/foo/bar"
"" + "code.fnl" -> "code.fnl", instead of "/code.fnl"
2025-06-06 11:43:49 -05:00
Phil Hagelberg
552b03b983 Release 0.2.0 2025-06-03 21:24:42 -07:00
XeroOl
456acb4e15 be less picky about XDG_DATA_HOME and HOME environment variable trailing slash
In fennel-ls.utils, there's a path-join function that has the logic
for joining paths and putting a slash in the middle if it's not already
there.
2025-06-02 22:49:01 -05:00
XeroOl
13415a97d3 minor edits to the lint descriptions
I hope these edits make the lint descriptions a bit clearer, but I'm not
sure
2025-06-02 22:41:53 -05:00
XeroOl
055f9f9811 rename completions to completion internally 2025-06-02 22:36:11 -05:00
XeroOl
04fec49059 lint explanations
These are here mainly for when I get around to mirroring these over
to my website. Then we could link a user to an explanation.

https://xerool.net/fennel-ls/docs/lints.html#lint-name

The descriptions of these are inspired by the Rust Language's Clippy
lint descriptions. Check their page out for ways to deal with a large
number of lints.

https://rust-lang.github.io/rust-clippy/rust-1.86.0/index.html
2025-06-02 22:36:11 -05:00
XeroOl
87439744b8 rename "check" test to "cli"
technically the corresponding item in the real code was renamed to
--lint, but that's the file we should use to write future tests.
2025-06-02 22:36:11 -05:00
XeroOl
1ac5d72a8e short flags: -h for help, -v for version 2025-06-02 22:36:11 -05:00
Jason Shipman
87d01b8ba9 Avoid double forward slash in docsets data dir when XDG_DATA_HOME is undefined
fennel-ls was reporting this error:
Could not find docset for library love2d at /Users/jship/.local/share//fennel-ls/docsets/love2d.lua
2025-05-28 21:51:35 -07:00
Yuta Sakurai
9b28815dd8 Resolved JSON-RPC issue on Windows. 2025-05-25 16:43:56 -07:00
XeroOl
39fdd0c282 Better completions! lazy documentation, deduplicated editRange. I have no tests for these completions >:^) 2025-04-26 17:06:28 -05:00
XeroOl
75839a2f13 finish naming the completion functions 2025-04-26 14:45:56 -05:00
XeroOl
6771feb6b5 remove unused import 2025-04-23 23:42:29 -05:00
XeroOl
5bb3f76050 fix documentation for macros, and fix completion item kind 2025-04-23 23:42:29 -05:00
XeroOl
3f1c2ea361 clean up some tests, restore (fn M.method []) completion handling 2025-04-23 23:42:29 -05:00
XeroOl
2800038005 Make sure we're not suggesting a "_G" version of everything 2025-04-23 23:42:29 -05:00
XeroOl
163ea1fd80 parse lua reference manual more accurately
the files and io are now properly treated like two different things
2025-04-23 23:42:29 -05:00
XeroOl
8a1aa53505 fix string methods, and some tests 2025-04-23 23:42:29 -05:00
XeroOl
1e3edf800d replace completions with a completely new completions.fnl implementation
the tests are failing now, because it's generating completions
differently, with no documentation or completion types, but it seems
like its working well.
2025-04-23 23:42:29 -05:00
XeroOl
5017177b44 horrible messy code that does deeper completions 2025-04-23 23:42:29 -05:00
Michele Campeotto
61defc86c4 Treat .fnlm files as macro files.
Now that .fnlm files are in the macro path we should also treat those as
macro files without needing the special comment.
2025-04-13 10:54:34 -07:00
XeroOl
3fbad644a9 prepare for warnings with column numbers
Fennel doesn't yet support column numbers in its warnings, but I'm going
to attempt to add them in 1.5.4+. This code will take advantage of those
numbers if/when that happens.
2025-04-11 22:24:59 -05:00
XeroOl
f129605630 future proofing against fennel 1.5.4's arglist nesting
In fennel 90732f3, some arglists are added that have tables, not just strings.
2025-04-11 22:24:42 -05:00
XeroOl
a4d99be235 macro modules and regular modules in separate namespaces
implements #49
2025-04-10 14:28:21 -05:00
Michele Campeotto
945eb86b4c SignatureHelp returns parameters ranges instead just the name.
This fixes an issue where a parameter name that is a substring of the
function name causes the client to highlight the function name substring
instead of the argument. Using ranges of the signature string avoids the
problem.
2025-04-07 20:56:19 -07:00
XeroOl
f68d8ba6fc compiler warnings 2025-04-06 16:14:42 -05:00
Phil Hagelberg
b7984ca51b Put .fnlm on the macro path. 2025-04-02 08:58:16 -07:00
Michele Campeotto
f3d5984091 Improved signature help and active argument detection.
This now uses a more correct algorithm to find the function call the
user is typing and also adds active argument detection.
2025-04-02 08:50:12 -07:00
Michele Campeotto
96aef99728 Update compiler diagnostics to follow the spec. 2025-03-24 08:32:47 -07:00
Michele Campeotto
f396450293 Don't send invalid signatureHelp activeParameter values.
Leaving the arguments in place for when we implement the rest of the
feature.
2025-03-24 08:32:32 -07:00
Michele Campeotto
6325b9c6ff Fix operator with no arguments lint incorrect report.
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.
2025-03-24 08:31:23 -07:00
Michele Campeotto
b0ba117232 Add instructions to use fennel-ls with Helix. 2025-03-22 12:11:04 -07:00
Michele Campeotto
7345d1bcd6 Update diagnostics to be spec compliant.
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.
2025-03-22 12:10:54 -07:00