‹ BackHN Continuity

Thread

Why building a Rust LSP is hard

144 points · 77 comments · agluszak

  1. octoberfranklin · · focus · HN ↗
    Enter hell: LSP assumes that it's the source of truth, but you still need to access the filesystem yourself, and do it in a synchronized way

    LSP is an example of utterly horrid technical design.

    Stop letting Microsoft design protocols and APIs. They are so. bad. at. it.

    1. duttish · · focus · HN ↗
      I've never looked into LSP, how would you design it?
      1. lenkite · · focus · HN ↗
        Wouldn't a normalized protocol based on AST vocabulary and tree operations make more sense ?
        1. looperhacks · · focus · HN ↗
          That would require the editor to be able to build an AST - defeating the point of LSP, because now the editor needs to know every possible language again
          1. lenkite · · focus · HN ↗
            I meant the language server builds the normalized, lossless AST and gives it to the editor. Changes in the AST can be provided as events/diffs to the editor. The normalized, source-mapped AST is effectively the stable language protocol. (Possibly given in a columnar, database form via Apache Arrow, but thats impl specific). Was discussing alternative architectures with a collague since even the best language servers really suck on large projects.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.