# Run full code on VSCode

**URL:** <https://discourse.julialang.org/t/run-full-code-on-vscode/56566>\
**Category:** General Usage\
**Tags:** vscode\
**Created:** [March 5, 2021, 3:29pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566 "2021-03-05T15:29:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beta\_Raddish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beta_raddish/32/22508_2.png) [@Beta\_Raddish](https://discourse.julialang.org/u/Beta_Raddish)\
**Post date:** [March 5, 2021, 3:29pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566/1 "2021-03-05T15:29:35Z")

</div>

I am still new to the community so if I got this in the wrong section I do apologise.

I am using VS Code to edit my Julia programs but from what I can tell I can either run individual lines or code blocks. While these blocks do help me to visualise what my program is doing I cannot seem to work out how to run the entire program from beginning to end.

–Edit  
I should point out that I normally edit Python stuff in Sublime Text so Studio Code is a bit of a new bit of software for me. While I have grasped it main use this seems to elude me. 🥺

Do I treat it all as one “block” and then use something like Jupyter when I want to present my explorations or is there a key command that I have not found?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![fbanning](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fbanning/32/14972_2.png) [@fbanning](https://discourse.julialang.org/u/fbanning)\
**Post date:** [March 5, 2021, 4:47pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566/2 "2021-03-05T16:47:52Z")

</div>

You already seem to have figured out how to send code from a file within VS Code to the integrated REPL via `Ctrl + Enter` (for single lines or selected lines) or `Shift + Enter` (for code blocks divided by `##`).

> [@Beta\_Raddish](#):
>
> how to run the entire program from beginning to end.

You can either do `Ctrl + A Ctrl + Enter` to send the whole content of a file to the Julia REPL. (Quick and simple solution without changing your workflow much.)

Or you could follow these two steps that also do what you want:

1. Open the Julia REPL in VS Code via `Alt+J Alt+O`.
2. Execute `include("myfile.jl")` inside the REPL.

Make sure your current working directory is correct. Exchange “myfile.jl” with whatever your file is called. You can also pass a full file path (e.g. `"../../path/to/file/myfile.jl"`) to the include function. This is useful if you want to access files in another directory than your current working directory but without changing it via `cd()` first.

Done. 🙂 Does this do what you want?

---

<div class="post-metadata">

**Author:** ![Beta\_Raddish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beta_raddish/32/22508_2.png) [@Beta\_Raddish](https://discourse.julialang.org/u/Beta_Raddish)\
**Post date:** [March 5, 2021, 5:31pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566/3 "2021-03-05T17:31:59Z")

</div>

Thank you for the reply. This has solved my issue 🙂 I am still learning a lot with this language (like been able to use the unicode version of Pi in my calculations has seriously blown my mind). Thank you for been patient with a newbie.

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [March 5, 2021, 5:40pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566/4 "2021-03-05T17:40:21Z")

</div>

Another method to send the entire edit buffer to the Julia REPL: Note that in the upper right-hand corner of the VSCode window there are a few icons, including \triangleright. Hovering your cursor over this symbol reveals its function: “Julia: Execute File”. Clicking it sends the entire file being displayed to the REPL.

---

<div class="post-metadata">

**Author:** ![Beta\_Raddish](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beta_raddish/32/22508_2.png) [@Beta\_Raddish](https://discourse.julialang.org/u/Beta_Raddish)\
**Post date:** [March 5, 2021, 5:51pm UTC](https://discourse.julialang.org/t/run-full-code-on-vscode/56566/5 "2021-03-05T17:51:34Z")

</div>

Thank you. I never noticed that button 😖 and it is now added to my mental notes.

(Honestly I like this community. Everyone I have interacted with so far has been kind)
