logoalt Hacker News

juancnlast Thursday at 8:04 PM0 repliesview on HN

One thing that helps a lot is somewhat isolated compilation units.

That means that most of the rest of the project is largely irrelevant besides some basic type information.

If your parsing context is small enough, you may be able to run a mostly complete parsing pipeline on the current unit, and inject a "code completion" token, where you make predictions of what can come next at that point (any token behind it is usually irrelevant).

That way you could still do a mostly vanilla compiler with auto complete, but supporting larger operations require much more state for the project.