Some example projects I open come in with a number of code and header files open in the editor, but if I try to open a source file that is referenced by the project, I get an error message.
How to open sources in the Arduino editor instead of an external editor?
Alexmouse:
Some example projects I open come in with a number of code and header files open in the editor, but if I try to open a source file that is referenced by the project, I get an error message.
How to open sources in the Arduino editor instead of an external editor?
Arduino only opens .ino (and .pde I think) files. You need to edit .h, .c, and .cpp, etc. files in an external editor. Arduino will read and compile them, but not present them for editing.
It is possible to use the Arduino IDE to open and edit libraries:
Add a dummy .ino file to the folder containing the library files you want to edit with the Arduino IDE. The .ino filename must match the folder name. This allows the Arduino IDE to open the library source files as if they were a sketch. This file will not actually be compiled as part of the library. I use it as a place to store my "to do" list. You could also use it for a test sketch for the library, in this way you can actually compile the library right from the same IDE window where you are editing it instead of having a sketch open in a separate IDE window.
Add a file named .development to the root of the library folder. This is necessary because otherwise the Arduino IDE treats the contents of the library as read-only (to prevent people from accidentally modifying example sketches).
If it doesn't have one already, add a file named library.properties in the root of the library folder. You can find the specification of the format here: Arduino IDE 1.5: Library specification · arduino/Arduino Wiki · GitHub. This is required for the .development feature to work.
ChrisTenone:
Arduino only opens .ino (and .pde I think) files. You need to edit .h, .c, and .cpp, etc. files in an external editor. Arduino will read and compile them, but not present them for editing.
That statement might be misleading. The Arduino IDE will only open sketches which contain at least one .ino or .pde file, but it will also open all .h, .c, .cpp, .S files in that folder as tabs, where they can be edited.