Skip to content

Commit 65dd0e5

Browse files
committed
Bug fix: New eval-envs should set *out* to stderr
- This issue was causing certain libraries, such as `spork/cjanet`, to cause incorrect RPC responses. When the library code involves printing to stdout, that data was being included in the stdout output sent to the LSP client. Putting stderr into `root-env`'s `*out*` means that evaluated imports wil print to stderr instead of stdout, avoiding the issue.
1 parent fad0f1e commit 65dd0e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.janet

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@
462462
(setdyn :opts opts)
463463
(when debug (setdyn :debug true)) #(setdyn :debug true)
464464
(setdyn :log-level log-level) #(setdyn :log-level 2)
465-
(setdyn :log-categories @[:core ;(map keyword log-category)]) #(setdyn :log-categories [:core :priority :settrace])
465+
(setdyn :log-categories @[:core ;(map keyword log-category)]) #(setdyn :log-categories [:core :priority :diagnostics])
466466
(setdyn :out stderr)
467+
(put root-env :out stderr)
467468

468469
(if console
469470
(start-debug-console)

0 commit comments

Comments
 (0)