When I’ve edited a source code file that I’ve opened via the Unity editor, the editor knows when it changes and re-compiles it for me automatically. This is for files that I’ve opened via Unity (i.e., double click on the file, opens your text editor, passes in the file).
What if I haven’t opened the file via Unity? If I have a project file and just go in and update some file via, say, a terminal, will Unity still pick up on that change and re-compile the file?