# VScode Julia server fails precompilation

**URL:** <https://discourse.julialang.org/t/vscode-julia-server-fails-precompilation/98865>\
**Category:** VS Code\
**Tags:** vscode\
**Created:** [May 15, 2023, 8:07am UTC](https://discourse.julialang.org/t/vscode-julia-server-fails-precompilation/98865 "2023-05-15T08:07:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 15, 2023, 8:44am UTC](https://discourse.julialang.org/t/vscode-julia-server-fails-precompilation/98865/2 "2023-05-15T08:44:04Z")

</div>

This is a result of my attempts to add precompilation to the LanguageServer.

> <https://github.com/julia-vscode/LanguageServer.jl/pull/1218>
>
> Add PrecompileTools to and precompile \`runserver\`.
> 
> For every PR, please check… the following:
> \- \[x\] End-user documentation check. If this PR requires end-user documentation in the Julia VS Code extension docs, please add that at https://github.com/julia-vscode/docs.
> \- \[\] Changelog mention. If this PR should be mentioned in the CHANGELOG for the Julia VS Code extension, please open a PR against https://github.com/julia-vscode/julia-vscode/blob/master/CHANGELOG.md with those changes.

To add precompilation to the LanguageServer, I ran the server during package initialization. However, this attempts to download some symbol caches. In your case, the LanguageServer could not reach the server hosting the symbol caches for some reason. That step failed which in turn caused precompilation to fail.

I detailed my initial attempt to do so here:

> [@Precompiling LanguageServer.runserver() with PrecompileTools.jl](https://discourse.julialang.org/t/precompiling-languageserver-runserver-with-precompiletools-jl/97926):
>
> After a [conversation on Slack](https://julialang.slack.com/archives/C013J5F9USH/p1682472242561679), with [Tom McLaughlin](https://discourse.julialang.org/u/thomasjm), I decided to try adding some precompilation to LanguageServer.jl. Tom had noticed about 10 second lag in the execution of LanguageServer.runserver(). This is part of julia-vscode, so a speed up here would be quite beneficial. Before the change, runserver() would take about 14 seconds to compile on my computer after each time the package is loaded. julia\> @time runserver() ... 30.517983 seconds (6.45 M allocations: 370.912 MiB, 1.60% gc time…

I was hoping someone would help me figure out how to make that initial attempt more robust, but we ended up merging it in directly.

To resolve this, first resolve the network issues.

Then in a Julia REPL, probably outside of VS Code, I would run the following.

```julia
using Pkg
Pkg.activate(; temp = true)
Pkg.add("LanguageServer")

```

That should force the language server to redo precompilation, this time hopefully with a functional connection to the server. Meanwhile, I will try to figure out how to make precompilation more robust.

---

_[View the full topic](https://discourse.julialang.org/t/vscode-julia-server-fails-precompilation/98865)._
