Say you have a language compiler you would like to build an IDE for.
How is auto completion, instant error reporting while writing code and debuggers commonly implemented?
|show 2 more comments|
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
In general, it's done:
The IDE builds a semantic model of the program. Which is essentially the same thing a compiler does, minus the actual code generation part.
In many modern language implementations, the same code is reused for both tasks, this makes it easier to keep IDE features in sync with language features. For example, the Scala compiler is specifically designed in such a way that it can be easily plugged into an IDE. It even has a special mode, called the presentation compiler, which presents a semantic model to the IDE.
The other way around, JetBrains is currently designing and implementing a new programming language, because they already have the required compiler know-how from building their IDE.
And, of course, in the space where IDEs were invented, i.e. Lisp and Smalltalk, there is no difference between runtime, compile time and design time, programming and debugging, compiler and IDE, debugger and editor. They are all more or less the same thing.