These programs often have no relation to each other. Information from the compiler might not be able to help the editor.
In the 90s, you began to see IDEs (short for integrated development environments), which combined compiler, editor, debugger, and runtime environment into one program. By putting them together, an editor could use information from a compiler to spot errors sooner.
These days, IDEs are widely used. A few programmers still swear by the text editor, compiler, debugger in separate programs, but many more like an IDE.
IDEs tend to be very large programs, and often require a powerful computer to run well. Fortunately, many computers are already quite powerful, and can handle IDEs.
Eclipse is open source and is freely available. Go to eclipse.org if you wish to download the program.