# Configure vscode to automatically complete code blocks with 'end' as appropriate

**URL:** <https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430>\
**Category:** VS Code\
**Created:** [March 3, 2021, 6:12pm UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430 "2021-03-03T18:12:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marty0801](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marty0801/32/12715_2.png) [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Post date:** [March 3, 2021, 6:12pm UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/1 "2021-03-03T18:12:52Z")

</div>

I find myself manually typing ‘end’ several lines down from a function header, then moving the cursor back into the function body to create the function. Is it possible to configure VSCode to do this automatically whenever I write ‘function’, ‘begin’, etc…?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 3, 2021, 7:01pm UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/2 "2021-03-03T19:01:51Z")

</div>

Snippet completions should do exactly that. Can you check whether you’ve disabled them by accident?

---

<div class="post-metadata">

**Author:** ![marty0801](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marty0801/32/12715_2.png) [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Post date:** [March 3, 2021, 7:46pm UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/3 "2021-03-03T19:46:47Z")

</div>

Thanks. How would I go about that exactly?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 3, 2021, 8:27pm UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/4 "2021-03-03T20:27:34Z")

</div>

![grafik](https://global.discourse-cdn.com/julialang/original/3X/a/7/a748d0868a2e27b5a27021dd0a356f276cd48ccd.png)

---

<div class="post-metadata">

**Author:** ![hexolio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hexolio/32/30064_2.png) [@hexolio](https://discourse.julialang.org/u/hexolio)\
**Post date:** [October 19, 2021, 11:26am UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/5 "2021-10-19T11:26:03Z")

</div>

Hi. My settings are configured exactly as shown in your screenshot, but the auto completion doesn’t seem to be working for me. I do have the Julia extension for VSCode.

To be clear, I’m expecting the editor to add “end” and put my cursor indented before that, whenever I type something like `for a in b` and press return. Is that what snippet completion should do, or am I misunderstanding it?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [October 19, 2021, 11:43am UTC](https://discourse.julialang.org/t/configure-vscode-to-automatically-complete-code-blocks-with-end-as-appropriate/56430/6 "2021-10-19T11:43:30Z")

</div>

Snippet completion will trigger when typing `for` and give you three cursor positions you can tab between:

![Peek 2021-10-19 13-41](https://global.discourse-cdn.com/julialang/original/3X/8/e/8e2d39add8357a1bfa756538982f5e8479b74064.gif)
