~xerool

Trackers

~xerool/fennel-ls

Last active 18 days ago

#56 Compile errors with unknown lines get reported as line 1 in --lint 18 days ago

Comment by ~xerool on ~xerool/fennel-ls

I think when operating as a server, its better for unknown location errors to be on line one, instead of suppressed or crashing the server. However, when operating as --lint, we really should report "?" as the line number, like how fennel does.

#52 accumulate and faccumulate prioritize warning over error 19 days ago

Comment by ~xerool on ~xerool/fennel-ls

Fennel-ls is the one arbitrarily choosing the position (1, 1). https://git.sr.ht/~xerool/fennel-ls/tree/456acb4e150ee005d50d2e5df02d2fa44f765c07/item/src/fennel-ls/compiler.fnl#L303 when you compile with fennel, it reports the position as unknown:?:?

#262 Missing error line in faccumulate 19 days ago

Comment by ~xerool on ~technomancy/fennel

The expected sequence of events is:

  1. faccumulate expands. (do (var foo {}) (for [50 60 100] (set foo (print foo))) foo)
  2. as part of macroexpand, walk the tree with propagate-trace-info. Specifically, we should set the source info of the [50 60 100] table.
  3. when the body is compiled, specials.fnl:727 should see that 50 is not a sym. it runs compiler.assert, reporting that the table [50 60 100] is the cause.
  4. since the information was propagated, the compiler reports that the entire faccumulate macro call is the location of the error.

#262 Missing error line in faccumulate 19 days ago

Ticket created by ~xerool on ~technomancy/fennel

from ~xerool/fennel-ls#52:

(faccumulate [foo {} 50 60 100]
  (print foo))

outputs the following

unknown:?:?: Compile error: unable to bind number 50

I expected a filename and line and column, but got unknown:?:?:

#49 Store runtime and macro modules separately a month ago

Comment by ~xerool on ~xerool/fennel-ls

REPORTED RESOLVED CLOSED

#30 macros from the same file as functions are not recognized 2 months ago

bug added by ~xerool on ~xerool/fennel-ls

#49 Store runtime and macro modules separately 2 months ago

enchancement added by ~xerool on ~xerool/fennel-ls

#30 macros from the same file as functions are not recognized 2 months ago

Comment by ~xerool on ~xerool/fennel-ls

We would be able to support this by implementing #49.

#50 Support pull diagnostics 2 months ago

enchancement added by ~xerool on ~xerool/fennel-ls

#50 Support pull diagnostics 2 months ago

Ticket created by ~xerool on ~xerool/fennel-ls

You can see the following code in many functions in handlers.fnl

(lint.add-lint-diagnostics server file)
(send (message.diagnostics file))

This code eagerly computes and pushes diagnostics to the client. However, (lint.add-lint-diagnostics) is expensive and ideally we could reduce the number of times we compute lints.

We should do this by supporting pull diagnostics if possible: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics Clients will have better debounce logic and won't request diagnostics repeatedly in between each edit unless a user pauses.

One concern is that I'm not sure if Neovim supports these pull diagnostics.