# Motoko: Why vscode?

**URL:** <https://forum.dfinity.org/t/motoko-why-vscode/5379>\
**Category:** Developers\
**Created:** [June 20, 2021, 4:28pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379 "2021-06-20T16:28:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@Chris](https://forum.dfinity.org/u/Chris)\
**Post date:** [June 20, 2021, 4:28pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/1 "2021-06-20T16:28:53Z")

</div>

For code highlighting and completion it seems the only native plugin to date is for Visual Studio Code. Is this the main IDE that the internal team is using currently, and if so why?

(sell me on it)

---

<div class="post-metadata">

**Author:** ![Chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@Chris](https://forum.dfinity.org/u/Chris)\
**Post date:** [June 20, 2021, 5:35pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/2 "2021-06-20T17:35:04Z")

</div>

I will say the interactive playground that it suggests on install has taught me things I didn’t even know I was missing (like Emmet Abbreviation)

I’m sure vscode isn’t the only IDE it’s in, but it’s the only IDE that made it a point to show me in an interactive way.

I think I can get used to it, just wondering if this is the primary IDE being used internally and by most Internet Computer / Motoko developers and if so, why.

… also just hit me that Microsoft also maintains TypeScript which has similar type checking syntax and functionality, so maybe it’s a good fit for Motoko as well on that note.

---

<div class="post-metadata">

**Author:** ![paulyoung](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/paulyoung/32/5251_2.png) [@paulyoung](https://forum.dfinity.org/u/paulyoung)\
**Post date:** [June 20, 2021, 5:55pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/3 "2021-06-20T17:55:26Z")

</div>

If I remember correctly, VS Code is the most popular editor so it makes sense to target that first.

I haven’t tried it myself recently but Motoko provides a language server that is compatible with editors that support the Language Server Protocol.

[https://langserver.org](https://langserver.org) isn’t the official site but I think it does a great job of explaining why LSP makes sense. It also lists language server implementations for different languages, and LSP clients for different editors.

It should be possible to find your editor near the bottom of that page and get it to talk to the Motoko language server.

---

<div class="post-metadata">

**Author:** ![nomeata](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nomeata/32/733_2.png) [@nomeata](https://forum.dfinity.org/u/nomeata)\
**Post date:** [June 20, 2021, 5:56pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/4 "2021-06-20T17:56:48Z")

</div>

@kritzcreek 's VS plugin is mostly a wrapper around the mo-ide tool he wrote, which is a Language Server Protocol (LSP) server for Motoko. This means that it should be relatively easy to add that support to other editors. That would make a great community project!

---

<div class="post-metadata">

**Author:** ![wang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/wang/32/446_2.png) [@wang](https://forum.dfinity.org/u/wang)\
**Post date:** [June 21, 2021, 12:16am UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/5 "2021-06-21T00:16:50Z")

</div>

Does anyone have candid syntax highlighting for vscode? I know the highlightjs definition exists.

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [July 22, 2021, 2:47pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/6 "2021-07-22T14:47:09Z")

</div>

For Webstorm/Jetbrains users, go for an upvote 👉 [https://youtrack.jetbrains.com/issue/IDEA-274257](https://youtrack.jetbrains.com/issue/IDEA-274257)

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [July 29, 2021, 6:26pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/7 "2021-07-29T18:26:22Z")

</div>

Any suggestions for kicking the language server to actually do error highlighting in VS Code. Sometimes i work and then sometimes the red lines just disappear. I’m using Motoko language support v 0.3.9 in vs code.

This working reliably would save a ton of time where I’m dfx build’ing and waiting for everything to build.

I’ve tried manually pointing to my test canister(which should at least ref every other canister) and disabling and enabling the extension.

Any tips would be appreciated.

---

<div class="post-metadata">

**Author:** ![Ori](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Ori](https://forum.dfinity.org/u/Ori)\
**Post date:** [July 29, 2021, 6:51pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/8 "2021-07-29T18:51:29Z")

</div>

There’s a restart Motoko language server command, pressing Ctrl Shift P and typing Motoko should find it.

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [July 29, 2021, 9:11pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/9 "2021-07-29T21:11:53Z")

</div>

When will be able to do “Go to Definition” and “Find References” in Motoko with VSCode? That would be a game changer.

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [July 29, 2021, 11:06pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/10 "2021-07-29T23:06:17Z")

</div>

This worked for a bit…but then sometimes it just stops…I tried turning on the trace in settings…any idea where to view that so I can see if it is erroring out somewhere?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [July 30, 2021, 3:55pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/11 "2021-07-30T15:55:06Z")

</div>

And now it seems to be really mad about my import myCanister “canister:myCanister”; statements when the canisters are clearly defined in my dfx.json file and dfx build works just fine.🤷🏻‍♂️

Happy to help debug, but I need to know where to look.

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [July 30, 2021, 4:15pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/12 "2021-07-30T16:15:40Z")

</div>

Unfortunately our LSP man has joined another team to predominantly work on Internet Identity.

> **[motoko/src/languageServer at master · dfinity/motoko](https://github.com/dfinity/motoko/tree/master/src/languageServer)**
>
> master/src/languageServer

> **[motoko/src/lsp at master · dfinity/motoko](https://github.com/dfinity/motoko/tree/master/src/lsp)**
>
> master/src/lsp

> <https://github.com/dfinity/motoko/blob/master/src/exes/mo_ide.ml>

is probably the place to look.

IIRC, Go To Definition (but not References) should actually work on references to library members (but not on local definitions).

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [July 30, 2021, 4:20pm UTC](https://forum.dfinity.org/t/motoko-why-vscode/5379/13 "2021-07-30T16:20:18Z")

</div>

For me, Go To Definition works going from main to a library, but not across libraries.
