2 pointsby derstruct9 hours ago2 comments
  • derstruct6 hours ago
    Actually with tree-sitter it's much less moving parts inside parser-generator core (5-10x LOC less then templ, but it's difficult to compare because structure differences).

    My theory that I don't have to care a lot about gopls changes, because I rely on LSP protocol itself when doing conversion. I basically scan exchange JSONs for locations (sometimes recursively) that are related to `.gox` or generated `.x.go` and perform targeted patches.

    About string literals completions.. I can't imagine how I could achieve even a 1/10 of feature set with this approach. Or at the end, it will turn out as something very similar to what I have, but achieved from a different starting point.

  • emanuele-em7 hours ago
    Interesting that you went the full custom-language route instead of just better gopls completion inside string literals. The tree-sitter grammar plus language server proxying to gopls is a lot of moving parts to maintain. Curious how you handle gopls version drift, since it changes behavior pretty often.
    • derstruct2 hours ago
      Accidentally replied in a different comment, first time.