Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » No Syntax Highlighting or Coding Help
No Syntax Highlighting or Coding Help [message #725763] Thu, 15 September 2011 13:45 Go to next message
Eclipse UserFriend
Using Eclipe Inidgo with CDT for a small C++ project. I have many years of C++ experience, but new to Eclipse, having only done a few dainty Java and RCP tutorials. Seems slick so far, and I like the cross-platform nature of it. Now I just need to get past some beginner problems...

In my first (and so far only) C++ project, with only one source file, there's no syntax highlighting. All black text on plain white background. When I type { following an 'if' statement, I expected the } to appear automatically just like in Java, but nothing happened. All the helpful coding actions in Java are absent. Eclipse is just a flat boring plain text editor!

The source file's properties shows that Eclipse knows it's a C++ source. I looked in many places for a checkbox to turn on syntax highlighting and other features, but no luck.

Then I created a new source file. It showed up with syntax highlighting. Automatic parenthesis and all that. Hooray!

Short term solution: I deleted my original source after pasting its contents into a new file. All is well.

The question remains: why did that first source file not have syntax highlighting? Bug, or did I unwittingly do something odd with it?
Re: No Syntax Highlighting or Coding Help [message #725903 is a reply to message #725763] Fri, 16 September 2011 02:48 Go to previous messageGo to next message
Eclipse UserFriend
Is the file recognized as file type C++ Source File?

Check this in the properties of the file Properties->Resource.

In Eclipse file names are case sensitive.

--Harald
Re: No Syntax Highlighting or Coding Help [message #726150 is a reply to message #725903] Fri, 16 September 2011 12:48 Go to previous message
Eclipse UserFriend
Also make sure you are opening it with the C++ editor. Depending on how you created/opened the file initially, you may have had the file opened in the text editor. This editor doesn't provide syntax highlighting, code completion, etc. You can select the editor to open a file by right clicking on the file and selecting Open with. The current editor associated with the file will be marked with a dot. Eclipse remembers the last editor used on a file, so once you change it, it should remember it the next time.
Previous Topic:Using $(shell) in makefile
Next Topic:Eclipse "Platform" download for Indigo
Goto Forum:
  


Current Time: Tue Jul 01 16:21:27 EDT 2025

Powered by FUDForum. Page generated in 0.03622 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top