Long ago, I worked on a Java IDE that effectively worked this way. Our captive compiler did some basic error correction on the source (so it kept working even while typing), then generated an annotated https://en.wikipedia.org/wiki/Abstract_syntax_tree, which the visual elements could read to generate their displays. The cool aspect of code generation is that our tools could also update the tree, and the code generator would insert/delete/refactor the code to match.
Long ago, I worked on a Java IDE that effectively worked this way. Our captive compiler did some basic error correction on the source (so it kept working even while typing), then generated an annotated https://en.wikipedia.org/wiki/Abstract_syntax_tree, which the visual elements could read to generate their displays. The cool aspect of code generation is that our tools could also update the tree, and the code generator would insert/delete/refactor the code to match.