Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 431769

Summary: Get C syntax coloring for .ino files
Product: [ECD] Orion Reporter: Mike Milinkovich <mike.milinkovich>
Component: EditorAssignee: Grant Gayed <grant_gayed>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: contact, ken_walker
Version: 5.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: All   
Whiteboard:

Description Mike Milinkovich CLA 2014-04-01 22:55:02 EDT
I would like to be able to edit my Arduino sketches with Orion, and would like to have syntax coloring in the editor. 

Arduino sketches typically have a ".ino" file extension. How could I go about configuring the CodeMirror plug-in to use C syntax coloring for files with a .ino file extension?
Comment 1 Ken Walker CLA 2014-04-01 23:09:10 EDT
Are those file actually "C" code or "C" like?  We can add it in by default to Orion with our own syntax colouring.
Comment 2 Mike Milinkovich CLA 2014-04-01 23:19:18 EDT
Yes, the contents of a .ino file is C. From the Arduino FAQ (http://arduino.cc/en/Main/FAQ)

Can I program the Arduino board in C?

In fact, you already are; the Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs supported by avr-g++ should work in Arduino. For more details, see the page on the Arduino build process.
Comment 3 Benjamin Cabé CLA 2014-04-02 10:35:13 EDT
I just submitted a PR to the orion-codemirror project to add .ino to the list of supported C-like extensions. 

Mike, just help yourself and install the patched plugin if you want :) http://benjamin-cabe.com/orion-codemirror/codeMirrorPlugin.html
Comment 4 Mike Milinkovich CLA 2014-04-02 11:13:06 EDT
Benjamin - works perfectly. Thanks!
Comment 5 Grant Gayed CLA 2014-04-03 17:01:26 EDT
Fixed > 20140403 with the Orion >= 5.0 syntax styling, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=79150b678bf65a103931dad780067a9ef451cd39 .
Comment 6 Grant Gayed CLA 2014-04-03 17:02:12 EDT
(also styles .c, .h and .cpp)