Building a ShopifyQL Code Editor - Shopify
Sep 11, 2023

Summary
This post details the technical implementation of integrating the ShopifyQL Language Server with the CodeMirror editor. Key contributions include: developing a custom adapter to bridge LSP and Lezer, handling ANTLR's relative token offsets by creating a `TokenIterator` class, and connecting the language server's features (validation, completion, hover) to CodeMirror's plugins. The post also explains the challenges of ANTLR's token offset system and how it was adapted for CodeMirror's document-relative offsets.