News for hackers. Stuff that matters.
Re:How I Built Zig-SQLite by xmorse on Friday May 27, 2022 @06:04AM (#31527807)
ZLS currently does not run any comptime code as far as i know

It would be cool to have an official Zig language server that can do it

Re:How I Built Zig-SQLite by Tiberium on Friday May 27, 2022 @06:07AM (#31527824)
I think the only real way you can run make a language server understand comptime code is using the compiler as a library, similar to how Nim does it - nimsuggest (the tool for autocompletion, definitions, etc) is basically the compiler itself with some nimsuggest-specific stuff, so it understand macros, templates, compile time code evaluation, etc.
Re:How I Built Zig-SQLite by gpderetta on Friday May 27, 2022 @06:30AM (#31527957)
Isn't that's how most LSP servers are implemented? I'm only vaguely familiar with clangd.
Re:How I Built Zig-SQLite by ranfdev on Friday May 27, 2022 @07:20PM (#31536045)
Yes. An LSP has to work along with the compiler, or it has to become an alternative compiler.

For example, from the article "Why LSP?" [1]

"It is known that compilers are complicated, and a language server is a compiler and then some."

[1]: https://matklad.github.io//2022/04/25/why-lsp.html

Re:How I Built Zig-SQLite by carlhjerpe on Friday May 27, 2022 @08:37AM (#31528845)
It's moving in that direction, but far from all are based on their compiler still.
Re:How I Built Zig-SQLite by Shadonototra on Friday May 27, 2022 @06:38AM (#31527986)
from what i understood, that is what they are planning to do, have an official built in language server