Olical / conjure

Interactive evaluation for Neovim (Clojure, Fennel, Janet, Racket, Hy, MIT Scheme, Guile, Python and more!)
https://conjure.oli.me.uk
The Unlicense
1.76k stars 109 forks source link

[Racket] Conjure attempts to `,enter` log files #249

Closed hi-im-buggy closed 2 years ago

hi-im-buggy commented 3 years ago

Environment

Distro: Arch Linux x86_64 Kernel: 5.14.6-arch1-1 Running in a systemd-nspawn container. Output of uname -a: Linux container 5.14.6-arch1-1 #1 SMP PREEMPT Sat, 18 Sep 2021 16:19:35 +0000 x86_64 GNU/Linux NVIM release: v0.5.0 Conjure release: Compiled from source, master branch as of commit 20f5a76, following the instructions in CONTRIBUTING.adoc.

Expected Behaviour

Upon entering a racket file, Conjure should initialize and ,enter only into the current file.

Current Behaviour

Conjure attempts to ,enter the log file in addition to the current racket file. This is seen in the logs here:

,enter: unknown module: /root/conjure-log-51.rkt                                                                                                                                              
"Hello, world!"                                                                                                                                                                               
,enter: unknown module: /root/conjure-log-51.rkt             

Steps to reproduce

  1. Open a racket file, in this case I used a simple hello world program.
    
    #lang racket

(print "Hello, world!")


# Initial investigation
While poking around in the source file for the racket client, I saw that the file is checked for whether it is a log file before entering using `(log.log-buf? path)`. It is likely that this function is failing for some reason.
I checked it against the filename of the current log file and it seems to return `nil` in every case.

While trying for the racket log file, evaluating while in `fnl/conjure/client/racket/stdio.fnl`

; eval (current-form): (log.log-buf? "/root/conjure-log-51.rkt")
nil


While trying for both the racket log file, and the fennel file while in `fnl/conjure/log.fnl`

; --------------------------------------------------------------------------------
; eval (root-form): (log-buf? "conjure-log-51.rkt") nil ; -------------------------------------------------------------------------------- ; eval (root-form): (log-buf? "conjure-log-51.fnl")
nil

The function also returns nil for the full filepaths instead of the relative ones.

In log.fnl, interestingly I also observed this result:

; eval (root-form): (log-buf? (log-buf-name))
nil

Olical commented 3 years ago

Probably fixed on develop! Thanks so much @hi-im-buggy!