Why do I have to restart VS Code every time I want to run my code with the latest (saved) changes? - visual-studio-code

I just started having this problem a few hours ago, and before that I never had this issue.
I am writing a code in Julia using VS Code also using Julia Repl and Revise. Since a few hours every time I make a change in the code I have to restart VS Code to be able to run my recently saved code. Otherwise, if I do not restart the code, terminal just tells that it is finished and the code ran already, which actually did not happen.
Does anyone have an idea how to solve this, or what the problem could be?
Thanks in advance!
I tried to save it different ways, and searched for similar problem online, but did not really find anything useful.

What if you restart the REPL inside the VSCode instead of restarting the whole program?
For this, you can use this key shortcut: Ctrl + J Ctrl + R. Also, you can find it using Ctrl + Shift + P and the search for Restart REPL.
For me, however, this didn't happen unless I wrote the code so it couldn't be mutated after the first run. For example, I can't redefine a composite type in Julia, and I do need to restart the Julia session to do it.

Related

How to get rid of the commands bringed by VS code terminal over and over

I have no idea why, but my VS code terminal keeps bringing in the history the same commands that I have used one day. So, every time I open the VS code, instead of bringing me the last used commands in that specific directory/project, it brings me the commands that I used once. It's the same commands, over and over.
That happens even if in the terminal is printed
**Session contents restored from 5/17/2022 at 3:29:45 PM**
They are actually not
Can someone help?

Vscode: Hypersnips excention sometimes duplicates cursor

I have the following snippet in the hypersnips extension (in vscode)
snippet txt "text in math" imA
\text{$1}
endsnippet
Usually, it works fine with me typing txt and it automatically sends me to
However, sometimes when using a snippet I get the following
After this occurs, if I delete that and try again, I get
This "bug" (?) occurs 10-20 per cent of the time and it is very annoying. Moreover, it is not unique to a specific snippet.
I have tried changing the version of vscode and of the extension but nothing has seemed to work.
Any help will be greatly appreciated.
EDIT: Screenshot to address rioV8's comment
I think that it is the bug of VSCode. When you overlap placeholders more than (about) 18 times, it occurs.
Just because HyperSnips adds too many placeholders, you noticed the bug.
Test: use VSCode keybindings to add snippet (without extensions).
ctrl+M inserts $|$ | .
Click here to view the result
However I don't know why it occurs and how to solve the problem. Sorry for that.

How to exit the command but not the interpreter?

I wrote some code in stk like this :
STk> (+ 2 3 ]
]]
||))
However, this is wrong. I'm not able to either correct this by going to the previous line or get out of this command. The only way seems to be Ctrl+Z but that takes me out of STk and everything I've done in it is gone.
Is there a way I can be inside the interpreter and continue programming without having to exit the interpreter if I've made an error like the one above. My terminal is Xfce4 Terminal 0.6.3.
Try pressing Ctrl + D. This worked for an earlier version that I am using.

How do you cope with emacs halting on receiving big input?

I am developing project in clojure using emacs cider under windows. And sometimes I have a problem that after accidently forgotten println function or on printing contents of big file Emacs stops responding (cursor and all key combinations doesn't work) and retire into oneself for processing that information to show it in repl. The only way to continue I know is to close program and open project files from scratch. And it is so simple to get in this trap.
Are there any other better solutions or configuration restrictions?
Though this suggestion will not solve your problem completely, it can help you a little.
First, set *print-length* to some value to limit the number of items of each collection to be printed.
(set! *print-length* 10)
And use cider-connect instead of cider-jack-in. You should run lein repl in a separate console window, then run cider-connect to connect to the repl. Then you can evaluate some expressions in the console window.
It would be good if there's an option to limit the contents to be printed by number of characters, however, I couldn't find it.

Is there a way for Emacs to autocorrect R commands

I'm a relatively new user to R and Emacs and was wondering if Emacs could automatically correct any R commands that i've typed wrong. I know about the alt-/, but I was more thinking along the lines of if i type read.tale, it corrects it to read.table.
Also, I was using emacs the other day and whenever i typed read.table, it showed the usage options (that bit from the help file) in the bottom bit of the window-the minibuffer?. anyway, its not there now, and i don't know what i did to make it go away.
Thanks for your help
Independently of emacs, you can examine your code with the checkUsage function in the codetools package. For example:
> foo <- function(data){
+ read.tale(data,file='temp.txt')
+ }
> checkUsage(foo)
<anonymous>: no visible global function definition for ´read.tale´
Also, you can emacs autocompletion functions (e.g. hippie-expand or dabbrev-expand) to fill in the rest of recently used function and variable names.
If you aint married to emacs, you should give Komodo edit with sciviews-R / sciviews-K a try.
So far it´s the best auto-completion coding I found for R. At least to me the configuration was much easier than emacs, particularly because of binding problems with my exotic (swiss) keyboard. sciviews-R / Komodo
EDIT: I realize this thread is still being read. So in meantinem I got to give it up for RStudio. It has really become THE editor for everyday use for most people. Nice autocompletion, available on all major OS and a really nice context help. Plus some easy export of pdf graphics and much much more. On top R Studio is easy to install – no need to worry how to fire up R from the editor.