Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:45 Go to next message
Daren Scot Wilson is currently offline Daren Scot WilsonFriend
Messages: 7
Registered: July 2011
Junior Member
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 06:48 Go to previous messageGo to next message
Harald    is currently offline Harald Friend
Messages: 37
Registered: July 2009
Member
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 16:48 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
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: Fri Apr 19 04:53:33 GMT 2024

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

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

Back to the top