# Language server in emacs: can it work any better than in VS Code?

**URL:** <https://discourse.julialang.org/t/language-server-in-emacs-can-it-work-any-better-than-in-vs-code/123727>\
**Category:** Tooling\
**Tags:** emacs, languageserver\
**Created:** [December 11, 2024, 8:35pm UTC](https://discourse.julialang.org/t/language-server-in-emacs-can-it-work-any-better-than-in-vs-code/123727 "2024-12-11T20:35:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [December 11, 2024, 8:35pm UTC](https://discourse.julialang.org/t/language-server-in-emacs-can-it-work-any-better-than-in-vs-code/123727/1 "2024-12-11T20:35:31Z")

</div>

Is there any reason to expect the language server to work better in emacs? In other words, can it avoid the problem with the invisible source code?

If I understand how it works, it seems to me that Emacs is exposed to the same language server failings as vs code?

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [December 11, 2024, 11:26pm UTC](https://discourse.julialang.org/t/language-server-in-emacs-can-it-work-any-better-than-in-vs-code/123727/2 "2024-12-11T23:26:07Z")

</div>

I’ve observed false warnings, which can be traced to StaticLint.jl, showing up in both VSCode and emacs LSP.

```julia
julia> import StaticLint

julia> code = "function f(a::T, invert=false)::T where {T <: Integer}; invert ? -a : a; end";

julia> StaticLint.lint_string(code, StaticLint.FileServer(), gethints=true)

```

The output ends with “Possible method call error”. This shows up as warnings in both VSCode and emacs, for the perfectly valid code:

```julia
function f(a::T, invert=false)::T where {T <: Integer}; invert ? -a : a; end

```

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [December 12, 2024, 6:04pm UTC](https://discourse.julialang.org/t/language-server-in-emacs-can-it-work-any-better-than-in-vs-code/123727/3 "2024-12-12T18:04:59Z")

</div>

I can’t speak to Emacs, but I found the LSP to work infinitely better when I set it up in Neovim, compared to VSCode. I suspect the underlying reason is that it gives me [_exact_ control](https://github.com/goerz/neovimrc/blob/master/helpers/julia_languageserver.jl) over what the “project folder” should be. For my typical workflows, I want to be using the environment in my `test` subfolder. The logging is also much better, so if something goes wrong, I can figure out what exactly it is. With that, when everything works, I’m not really getting any false positives from the LSP, and I’m finding it extremely useful (unlike my limited experience in VSCode)
