-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Racket: ConjureEvalBuf / ConjureEvalFile failures #643
Comments
I can replicate the error message when running Here's my log output:
What's happening is when evaluating the buffer, the I was able to run the $ racket stacker-test.rkt
36$ So, while you can edit There may be hope for evaluating files or buffers with Conjure because there is a racket-mode for Emacs which appears to be able to deal with the peculiarities of |
See #456 for related issue. |
Thanks for providing additional context @russtoku, I can reproduce this issue and agree the solution probably isn't a straightforward fix in Conjure. From my investigation, my hunch was that the I got this module working and reloading by removing the automatic calls to So I'm thinking maybe we only use |
I've added an option which isn't perfect but might be good enough for you for now and gives us some good data on what a good solution looks like. Try setting Not perfect, but a lever you can pull. Then maybe we work out exactly which I was also trying to see if I could load xrepl into the |
@Olical, your fix works! With
A minor nit would be that the virutal text reads:
It should be noted that while you can |
BTW, I think that it's safe to not append
|
I think it's used for when users print without a newline? I've had people
complain about that in the past IIRC 🤔
…On Sun, 2 Feb 2025, 22:00 Russ Tokuyama, ***@***.***> wrote:
BTW, I think that it's safe to not append (flush-output) with the Racket
code being sent to the REPL.
diff --git a/fnl/conjure/client/racket/stdio.fnl b/fnl/conjure/client/racket/stdio.fnl
index 7bbabd22..52798cd8 100644
--- a/fnl/conjure/client/racket/stdio.fnl
+++ b/fnl/conjure/client/racket/stdio.fnl
@@ -61,7 +61,7 @@
(log.append [(.. comment-prefix "Dropping #lang, only supported in file evaluation.")])
(s:gsub lang-line-pat ""))
s)]
- (.. code "\n(flush-output)")))
+ (.. code "\n")))
(fn eval-str [opts]
(with-repl-or-warn
—
Reply to this email directly, view it on GitHub
<#643 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACM6XM3V24FO66RRFJHWLD2N2IRPAVCNFSM6AAAAABWHWYUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRZGU3TKNBYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ahhhh... |
Thank you both for your investigation and work on this issue! After some additional help from russtoku on Discord, I had some difficulty in getting there, but ultimately what worked for me was to:
Without the disabling, I still got what looked like the same (or similar?) errors as seen earlier: |
I can confirm that using The interesting thing is that |
I wonder if it's overriding the filetype based on the |
The
Something to be aware of. I'm sure how one would configure Neovim to stop that. |
Ah that'll do it! I have a feeling there's a way to do some sort of
filetype hierarchy? Maybe that's what this plugin is using so it goes
reader -> racket so it inherits other racket filetype stuff but has a
unique filetype of reader on the surface.
I wonder if there's a way we can query the filetype to get it's "root" of
racket rather than the superficial "reader" which currently doesn't map to
a client.
I don't want to have to teach Conjure all the possible filestypes that
could map to racket because that could be infinite. I have a feeling
there's a way to tell we're in racket still somehow. And ideally not just
by the extension of the file.
…On Tue, 4 Feb 2025, 19:45 Russ Tokuyama, ***@***.***> wrote:
The benknoble/vim-racket plugin has a filetype detection script that gets
run when *.rkt, *.rktl, and *.zuo files are loaded. It does look at the
#lang in the first line of the file and sets the filetype according to
its rules.
:se ft?
filetype=reader
Something to be aware of. I'm sure how one would configure Neovim to stop
that.
—
Reply to this email directly, view it on GitHub
<#643 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACM6XLZNTPA6RBN7MCRVPL2OEKGBAVCNFSM6AAAAABWHWYUBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZUHEYTCMZXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I've come up with a work-around for people who want to use
I created an after/ftplugin Lua script that is execute after Racket-related scripts are executed. Since it the last compared to scripts from In your if (vim.fn.exists("#filetypedetect#BufRead#*.rkt")) then
vim.cmd("au! filetypedetect BufRead *.rkt,*.rktl,*.zuo")
end I think that this is one of those things that belongs in the wiki instead of in the source code. |
I've given the So far it seems to be working :) Thanks @russtoku! |
So Neovim actually has support for multi part filetype strings, so does Conjure. If the vim-racket plugin set the filetype to |
Description
For certain
.rkt
files that work [1] upon opening in a buffer, using:ConjureEvalBuf
or:ConjureEvalFile
subsequently can lead to errors (at least for my setup [2] (^^; ).Examples of such errors include:
Note that I haven't yet experienced these errors for some other
.rkt
files. For the files I have examined, it appears that those that start with:are fine.
However, those that start with things that look like either:
seem to lead to the sorts of errors described above.
I haven't tested that many files though.
How to Reproduce
The code I tried with is from the online book "Beautiful Racket".
I followed the "full setup" instructions here which might be translated as:
raco pkg install --auto beautiful-racket
racket -l br/test
To obtain the code to reproduce the issue with, choose one of the following:
stacker.rkt
andstacker-test.rkt
), -OR-stacker.rkt
stacker-test.rkt
To experience the issue:
stacker-test.rkt
(the second of the two files above) in neovim36
appearing in the HUD (there may be a subsequent error message after as well -- not sure what that is about):ConjureEvalBuf
or:ConjureEvalFile
[1] By "work", I mean the HUD shows the expected evaluation result when the file is opened in the buffer initially.
[2] I'm using:
v0.11.0-dev-1623+g34d808b73c
v4.53.0
The text was updated successfully, but these errors were encountered: