Skip to content
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

Sent to repl with multiple forms evaluates only a single form #132

Open
usaccounts opened this issue Jan 8, 2023 · 3 comments
Open

Sent to repl with multiple forms evaluates only a single form #132

usaccounts opened this issue Jan 8, 2023 · 3 comments

Comments

@usaccounts
Copy link

Write the lines below and select both to send to repl (alt-shift-enter):

(defparameter x 1)
(defparameter y 2)

One the first one is sent, x is defined, but y is undefined.

@madkins23
Copy link
Contributor

I've debugged Alive and it looks like the text sent to the LSP includes both lines separated by a line terminator. When it comes back there's just the one result.

I haven't figured out how to debug the LSP yet so I can't confirm from both ends but it kind of looks like this is an LSP bug.

@nobody-famous
Copy link
Owner

The LSP side is doing the right thing. If you send multiple forms to SBCL, it only evaluates the first one.

I'm leaning towards the right fix for this being to not allow multiple forms to be submitted. Otherwise, it opens a list of other problems, like how to deal with some of them starting debuggers and what to do in the case of inline eval. The debuggers might not be a problem if the client sends the forms one at a time. I'm not sure if inline eval could display more than one result, though. I'd have to try it and see.

@nobody-famous
Copy link
Owner

Looking into it a little more, switching inline eval to use inlay hints would allow multiple results to be displayed. Then it's just a question of whether there's a promise that resolves when a form completely finishes. I think there is, but it might not be reliable. I'll need to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants