Re:Autocomplete as an Interface (2015)
by thedirt0115 on Thursday January 16, 2020 @12:15PM
(#22066559)
Ok, I'm curious! What might such a tool look like or do? Did you have something specific in mind?
[ Parent
| on HN ]
I could imagine two tools:
1. A tool that parses the text and draws red underlines on all the errors, this exists but (at least for C++ in VS 2017) it is quite slow.
2. A tool that automatically populates and updates types of variables and functions.
Both of these could be achieved by somehow decoupling the front-end (as in before semantic analysis) of compilers and making them output the AST in some standardized tree-structured format like XML.
Doesn’t the Language Server Protocol already do this, just via JSON instead of XML? I believe at least some LSP backends (e.g. clangd) just reuse a compiler AST and feed the data to your editor?