# VSCode handling of unicode automatic completion

**URL:** <https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610>\
**Category:** VS Code\
**Created:** [January 6, 2023, 4:55pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610 "2023-01-06T16:55:48Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 6, 2023, 4:55pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/1 "2023-01-06T16:55:49Z")

</div>

Hey,

I find that the behavior in VSCode for the handling of unicode completion surprising. In the folloiwng examples, I will denote the position of the cursor when i hit the tab key (for autocompletion) `<TAB>` :

- `myfunction(\alpha<TAB>` works as expected.
- `myfunction(\alpha<TAB>)` also works.
- `myfunction(\alpha<TAB>hat)` does not.
- `myfunction(\alpha<TAB> hat)` does work (notice the space after the cursor).

Although, in the REPL, the three work as expected and write a `α`. This is frustrating as it happens a lot with my naming conventions. Is this expected, or am I missing some configuration options ?

It seems like if there is a letter after the cursor, it does not work, while if there is something else (a space, a closing parenthesis, a `+` sign…) it does, although the REPL works whatever you have after the cursor (which is in my oppinon a better choice).

---

<div class="post-metadata">

**Author:** ![tobydriscoll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobydriscoll/32/1843_2.png) [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Post date:** [January 6, 2023, 5:11pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/2 "2023-01-06T17:11:04Z")

</div>

You should use

```julia
myfunction(\alpha<TAB>\hat<TAB>

```

Better still is to get a utility such as Ukelele (mac) that allows you to assign Unicode characters to keystrokes and chords. For your example, I’m able to do `<ALT>-a<ALT>-,`

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 6, 2023, 5:19pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/3 "2023-01-06T17:19:33Z")

</div>

No you missed my point, I do not want ` α̂`, but rather `αhat`, indeed the text `hat` is no well-chosen for the example.

Say i have two variables `αtheoretical` and `αobserved`

---

<div class="post-metadata">

**Author:** ![tobydriscoll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobydriscoll/32/1843_2.png) [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Post date:** [January 6, 2023, 8:00pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/4 "2023-01-06T20:00:04Z")

</div>

If you are just referring to typing part of the name with a leading ⍺ and getting tab completion, then I can’t reproduce your problem at the REPL inside or outside of VS Code.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [January 6, 2023, 8:12pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/5 "2023-01-06T20:12:52Z")

</div>

On a related note, I wish the VSCode extension had some sort of “Greek mode” where we could switch to the Greek alphabet in the keyboard temporarily. That is, typing `a`, `b`, `d`, … would be automatically converted into the unicode alpha, beta, delta, …

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 6, 2023, 8:15pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/6 "2023-01-06T20:15:51Z")

</div>

I am referring to exactly what I described :

- type `somecharacters`
- move your cursor in the middle of it at `some<CURSOR>character`
- type `\alpha`
- hit Tab.

Works in the REPL, not in a .jl file in vscode. Do you confirm that it works on your system ?

---

<div class="post-metadata">

**Author:** ![tobydriscoll](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tobydriscoll/32/1843_2.png) [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Post date:** [January 6, 2023, 8:41pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/7 "2023-01-06T20:41:45Z")

</div>

It works the same in jl files as in the REPL for me.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [January 6, 2023, 8:49pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/8 "2023-01-06T20:49:49Z")

</div>

Yeah I can see it does not work in vs code, the end result of that for me is: `some\alpha characters`

---

<div class="post-metadata">

**Author:** ![jondea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jondea/32/39086_2.png) [@jondea](https://discourse.julialang.org/u/jondea)\
**Post date:** [January 6, 2023, 11:33pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/9 "2023-01-06T23:33:22Z")

</div>

I have this problem too, and it’s infuriating (although not infuriating enough for me to have done anything about it). Thanks for bringing it up!

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 7, 2023, 10:24am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/10 "2023-01-07T10:24:37Z")

</div>

Okay at least i am not the only one having this issue. Maybe we could turn this into an issue on the vs-code julia repo ?

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 7, 2023, 2:01pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/11 "2023-01-07T14:01:27Z")

</div>

I do not seem to experience this problem, but have a `Fast Unicode Math Characters` VSCode extension installed.

---

<div class="post-metadata">

**Author:** ![braamvandyk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/braamvandyk/32/5086_2.png) [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Post date:** [January 7, 2023, 3:38pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/12 "2023-01-07T15:38:24Z")

</div>

This is what I get and it seems OK, assuming I understood what you wanted:

myfunction(\alpha → myfunction(α)

myfunction(\alpha) → myfunction(α)

myfunction(\alphahat) → myfunction(αhat)

myfunction(\alpha hat) → myfunction(α hat)

VS Code v1.74.2  
Julia add-in v1.38.2  
Windows 10

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 7, 2023, 8:16pm UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/13 "2023-01-07T20:16:23Z")

</div>

> [@braamvandyk](#):
>
> myfunction(\alphahat) → myfunction(αhat)

Yes i think you understood what i wanted, and this is exactly the behavior i am NOT getting. For me, when hitting TAB with the cursor right after `\alpha` in this example, nothing happens.

So it looks like YMMV…

---

<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:** [January 9, 2023, 5:26am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/14 "2023-01-09T05:26:30Z")

</div>

I also can’t repro this:  
 ![Peek 2023-01-09 10-53](https://global.discourse-cdn.com/julialang/original/3X/7/5/756a8f7873277af9d173db0f03c57666721706c1.gif)

It’s possible you have changed a setting that breaks this – does anything stand out under Editor \> Suggestions?

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 9, 2023, 8:39am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/15 "2023-01-09T08:39:28Z")

</div>

@pfitzseb I have the same behavior as you, but you are not trying the interesting case:

- Type `\alphahat`
- Go back you cursor 3 times so that you have it between `\alpha` and `hat`
- hit Tab.

This is not what you are showing. I’m trying to screen-capture but i have to find the right tool to do 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:** [January 9, 2023, 8:40am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/16 "2023-01-09T08:40:16Z")

</div>

Ah, yeah, that’s a known issue (I think someone opened it already).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 9, 2023, 8:48am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/17 "2023-01-09T08:48:11Z")

</div>

Ok it is known already, fine. Thanks for taking the time, hope it’ll be fixed someday.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 9, 2023, 9:02am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/18 "2023-01-09T09:02:34Z")

</div>

> [@lrnv](#):
>
> - Type `\alphahat`
> - Go back you cursor 3 times so that you have it between `\alpha` and `hat`
> - hit Tab

Did you try the `Fast Unicode Math Characters` VSCode extension? I do not have any problem with your example.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [January 9, 2023, 9:08am UTC](https://discourse.julialang.org/t/vscode-handling-of-unicode-automatic-completion/92610/19 "2023-01-09T09:08:16Z")

</div>

> [@rafael.guerra](#):
>
> Fast Unicode Math Characters

Yep, does not help, sadly. But it also looks like the proposed shortcuts from this extensions are not showing up at all in the autocompletion menu : for example, while `\forall` is there (added by the Julia extension), `\all` is not (while the README of `Fast Unicode Math Characters` mentions it explicitly as a shortcut for the same Unicode character). Therefore, I might have an issue with the installation of said extension, I might have to take another look.
