← Back to context

Comment by matklad

6 years ago

I am not the author, but work in the same domain. Empirically, existing compilers are impossible to turn into good IDEs, unless the language has header files and forward declarations. Otherwise, you get a decent IDE by doing one of the following:

* writing two compilers (C#, Dart, Java(and, in some sense, every major language, supported in JetBrains tooling)

* starting with IDE compiler from the start (Kotlin & TypeScript)

The two examples where I’ve heard a batch compiler was successfully used to build a language server are C++ and OCaml (haven’t tried these language servers myself though). Curiously, they both use header files, which means that it’s the user who does fine grained caching.

I don‘t see how caching in LLVM is relevant to the task of building LSP servers.

In terms of prior art, I would suggest studying how IntelliJ works, specifically looking at the stubs:

https://www.jetbrains.org/intellij/sdk/docs/basics/indexing_...