-
Notifications
You must be signed in to change notification settings - Fork 0
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
Inline evaluation result never disappears. #23
Comments
Thanks again for your report. Without irony, I really appreciate that somebody is using my program and it doesn't matter that this is a bug report. First, the main idea of my evaluated values is that they are persistent, so they don't disappear when changing windows or evaluating more than one expression. Why there are more than one such evaluated value after each newline: that's because I have used the range from the start of the expression up to, and including, the cursor position as the range of the result - so they all differ by the end of the range and are treated as different. I've just changed that: comparing the start line is enough and it works as expected now. Why the evaluation result is shoved into the next line is a bit of a mystery to me, if you select another window and go back to the original tab the text decoration is on the right line again. So regenerating all such text decorations would work, but I'd rather evade doing that on each keypress. So I'm searching for a better solution. |
Thinking through the possibilities, I actually do have to remove at least all eval results after the location of the newline, as all these are one line to high after redrawing them. |
Actually the nested expressions - the last image - had been intentionally, but with the latest change (which isn't checked in) this doesn't happen any more, there is always only one eval result per line. |
I've just published a new version - 0.7.0. Please check if this is working as you would expect. |
Yes, these are 2 different REPLs. The problem is that I can't get the output of the terminal the interactive REPL is running in.
Oh, yes. I should have documented that, both REPLs (inline vs. interactive) behave totally different.
Oh, yes. Sadly these indention rules use regexps, so there is no way to let VS Code know that the define expression is already finished. But I thought most of the time definitions use more than one line, so not adding additional indentation would do more harm that adding it. These are the |
I'll add some kind of popup asking the user to save the changes, if the file hasn't been saved before evaluating some expression inline. |
I've just published a new version, this added the popup on unsaved changed when inline evaluating. |
It works perfectly now! Thank you so much. |
|
You're welcome! You have been a great help in fixing these bugs and making the extension better. Most open source projects (well, these projects are most often made by a single person) like having bug reports even if they not respond quickly. Because almost anybody likes seeing their work used and people care enough to go through the hassle of reporting bugs and helping with their resolution. What Calva does is not using a REPL directly, but connecting via TCP. This started with Emacs and Common Lisp, where the REPL is wrapped in a TCP server (a "swank" server, which Slime and Sly use), so the communication is way "better" than by using pipes to communicate with a running REPL. The LSP servers of VS Code use the same principle, but another protocol. Btw. this had been the reason I started with this extension, as the scheme-lsp-server has a working VS Code plugin, but does not support Chez. And scheme-langserver, which does support Chez, doesn't have a VS Code plugin and I couldn't even compile the LSP to write the VS Code LSP client for it. |
This popup shows up not only on eval, but also when just writing code. Would it be possible to pop up only on inline evaluation without saving? |
Oh, of course, autocompletion is also evaluating code. I should ignore that. |
The newest version, 0.7.2, fixes that. Sorry I didn't catch that error 😢 |
No problem! It's very useful for me now :) |
It seems to work as intended initially:
However, when you insert a newline afterwards, this happens:
Then when you insert a new expression like such:
and evaluate it, it works as normal like such:
However, it's possible to do something like this:
I'm genuinely confused as to why this one happens, this happened when I evaluated a different s-expression below:
This makes the inline evaluation a bit difficult to use. In Calva, a similar extension for clojure, I believe it has these behaviors:
I believe this could be a good way to implement inline evaluation for this extension as well!
The text was updated successfully, but these errors were encountered: