The OA, and your comment, made me very excited at the prospect of building a kickass AI-assisted language-learning suite. I think interactive writing is a great foundational abstraction, and your description -- of reading a bunch of examples in the native language saying similar things -- would be a beautiful way to realize it: a write, read, write, read, write REPL. Mix in spaced rep and conversation with a partner (conversations would be much less tedious as part of this loop) and you have a language learning hyper-accelerator.
I'm what people in the Midwest [1] call "good with languages" in that I have learned a host of them to intermediate level, and then run aground on getting to advanced, which I think of as the ability to express yourself colloquially and elegantly on any random topic. An IDE like we're talking about would be a godsend, not least because it would speed things up between ten and a hundred-fold.
Argh, I'm tempted to quit my fucking job and try to make this exist, though I'm not qualified to build it. Maybe someone else will do something comparable -- definitely a "take my money" example :)
[1] I mention being from the Midwest bc, when I was growing up, average small-town people lacked any real access or exposure to (or motivation to acquire) other languages. When I got old enough to travel (also not a thing generally done in my social setting), running into people fluent in 4 languages just by accident of birth, would always make me so jealous :/