# Language server broken?

**URL:** <https://discourse.julialang.org/t/language-server-broken/104071>\
**Category:** VS Code\
**Created:** [September 20, 2023, 4:18pm UTC](https://discourse.julialang.org/t/language-server-broken/104071 "2023-09-20T16:18:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 20, 2023, 4:18pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/1 "2023-09-20T16:18:11Z")

</div>

Hi everyone,  
since today the language server seems to be broken for me. After running julia for a short time it becomes unresponsive. In the output of the Julia language server there are a stack overflow errors:

```julia
[ Info: Starting LS at 1695226578
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffa6cbd4006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffa6cbd4006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffa6cbd4006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()

```

Does anyone have an idea how to repair it?  
I tried downgrading the julia extension (there was an update 7 hours ago), but that didnt fix it.  
Ive had this problem occur on two windows and one linux machine

---

<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:** [September 20, 2023, 4:43pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/2 "2023-09-20T16:43:12Z")

</div>

Try deleting `~/.config/Code - OSS/User/globalStorage/julialang.language-julia/` (or similar) and restarting VS Code.

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 20, 2023, 5:10pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/3 "2023-09-20T17:10:19Z")

</div>

I hope I did it correctly, I am currently on the windows machine and deleted `julialang.language-julia` in the extensions folder. That deleted the julia extension.  
After installing again, I get the same error message.  
One curious thing I found is that it somehow depends on which project I open. It looks like the problem is only for a specific project I am working on.  
I have tried deleting the manifest and project.toml there (no success)  
I am experimenting a bit with a completely new folder and copy my files there. So far it looks to be working.  
I will give an update here if I find out more

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 20, 2023, 5:15pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/4 "2023-09-20T17:15:19Z")

</div>

I Think I have found the culprit:  
I experimented a bit with code generation and saved some lowered Code into a file “xxx.jl”. The julia extension tries to analyze that and fails because it is not actually proper julia code.

---

<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:** [September 20, 2023, 5:48pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/5 "2023-09-20T17:48:17Z")

</div>

Would be useful if you could share that file somewhere so we can take a look at fixing the underlying issue – the language server process shouldn’t crash even in the presence of invalid Julia files.

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 20, 2023, 6:01pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/6 "2023-09-20T18:01:29Z")

</div>

Can do,  
I will try to create an MWE, the file I had was somewhat big

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 21, 2023, 6:32am UTC](https://discourse.julialang.org/t/language-server-broken/104071/7 "2023-09-21T06:32:38Z")

</div>

Ok looks like one cannot make the MWE very minimal, the problem seems to be when the file is too large.  
I attach two examples, the smaller file does not crash the language server.  
Looks like the lowered code makes many references to local variables, and the linter tries to track them recursively blowing the stack.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/6/9675760aff3848022b76ec58a17612ebda48fed6.png)

[CrashLanguageServer.jl](https://discourse.julialang.org/uploads/short-url/fZ8RWIQVgZa6346A5XjWwuKge1d.jl) (481.2 KB)  
[doesntcrashLanguageServer.jl](https://discourse.julialang.org/uploads/short-url/fwLBZIKVEx7JWLUOHhaNbxpDvSy.jl) (6.4 KB)

---

<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:** [September 21, 2023, 1:12pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/8 "2023-09-21T13:12:27Z")

</div>

Thanks! Yup, this is a pretty straightforward case – we’re trying to parse that file as a series of binary operators (or something like that) recursively.

It’s unlikely that I’ll fix this properly (long term we want to move to JuliaSyntax for parsing anyways), but it would be nice to catch parsing errors and notify the user about which file caused the issue.

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 21, 2023, 3:32pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/9 "2023-09-21T15:32:01Z")

</div>

Yes I don’t think it’s a super urgent fix as it’s not very likely to occur to anyone else.  
I think in general it would be nice if the main functionality (I.e) sending code to the REPL could be kept even if the language server is having difficulties digesting some files. But probably this has been brought up before and is not easy to provide.

---

<div class="post-metadata">

**Author:** ![fyzycyst](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fyzycyst](https://discourse.julialang.org/u/fyzycyst)\
**Post date:** [September 28, 2023, 8:30pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/10 "2023-09-28T20:30:49Z")

</div>

Ahem! It’s occurred for me as well and I went so far as to completely (or so I thought) delete both Julia and VSCode, then reinstall from scratch. Still happened. So if it is a rogue file, I’m not sure where it is.

---

<div class="post-metadata">

**Author:** ![fyzycyst](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fyzycyst](https://discourse.julialang.org/u/fyzycyst)\
**Post date:** [September 28, 2023, 9:12pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/11 "2023-09-28T21:12:23Z")

</div>

Following up… I uninstalled both Julia and the extension AND my .julia folder. After reinstalling, Language Server loads without a hitch.

(Now, if I can only figure out why I can no longer select a line of code and Alt-Enter execute it…)

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 29, 2023, 5:23am UTC](https://discourse.julialang.org/t/language-server-broken/104071/12 "2023-09-29T05:23:51Z")

</div>

Can it just be that the keyboard shortcuts got remapped?  
(Shift+P and enter keyboard shortcuts in the search, then look for Julia execute code)

---

<div class="post-metadata">

**Author:** ![fyzycyst](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@fyzycyst](https://discourse.julialang.org/u/fyzycyst)\
**Post date:** [September 29, 2023, 2:48pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/13 "2023-09-29T14:48:39Z")

</div>

Yeah, that was one of the first things I checked.

(I’ll play a bit more, then start a new topic if need be.)

---

<div class="post-metadata">

**Author:** ![Salmon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/salmon/32/22968_2.png) [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Post date:** [September 29, 2023, 3:12pm UTC](https://discourse.julialang.org/t/language-server-broken/104071/14 "2023-09-29T15:12:43Z")

</div>

Try to switch it to a different key combination. I remember once having the issue that vscode didn’t recognize a specific key combination for some reason this is how you could find out if it’s the same problem
