Hi everybody.
I just turned to code::blocks runnning it on Windows XP. But now i have a problem regarding syntax highlighting and code completion for C++ code. Please have a look on the attached image. There you can see that "ofstream" and "cout" e.g. are not highlighted.
When i type "dataus." there is no popup of the completion list. What is going wrong here?
Btw: I don't have any similar problems with pure C code.
c::b version? 10.05?
if so, and you want better CC use some of the latest nightlies...
btw the syntax highlight looks ok, c::b doesn't support context/semantic highlight...
Yes it is 10.05. After reopening the project the completion list appears when typing "dataus.". Then i get the whole bunch of what is in the ofstream class. Hmm ok...i also figured out, that there ist also no highlighting when using structs.
I just thougt it should always look like as if you declare "int i;" e.g with the "int" getting blue. Wouldn't it be nice if also class-names and struct-names are highlighted when declaring an instance of them? Just like with the basic data types (int, char, float....).
int is a keyword, so it is highlighted as such.
For the others you're talking about semantic highlight which is hard.
Quote from: oBFusCATed on January 19, 2011, 04:38:03 PM
int is a keyword, so it is highlighted as such.
For the others you're talking about semantic highlight which is hard.
hopefully libclang can help us to do this :D
ollydbg: The question is: does scintilla support such thing...
Quote from: oBFusCATed on January 19, 2011, 05:34:40 PM
ollydbg: The question is: does scintilla support such thing...
to highlight some text in scintilla,
1, scintilla has some(many) keyword groups, each groups can have different text styles(color, bold, italic....)
2, We just add/remove these groups dynamically when we switch translation unit. the clang can supply a full AST, and also we can create a AST interator, and walk through the AST, and build these groups.
3, once the groups are built, it's the scintilla's duty to high light the text.
BTW:
Codelite IDE has this kind of feature, and I have even post some code snippet of Codelite to show how it correct/build the groups in C::B's forum several days ago.
Hey guys. I am back. I think i found a bug in c::b 10.05. I am not sure this still exists in the latest nightly build but i post it anyway.
OK...i have the following code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream hhh;
hhh.
return 0;
}
When typing "hhh." there should appear the code completion list. But it does not...until i close the project and reopen it. Then it works.
Can you guys confirm this?
Quote from: lordnoxx on January 20, 2011, 06:19:47 PM
Can you guys confirm this?
What happens if you save after you declared the type (
fstream hhh;) and then CC the next line "
hhh."?
Saving the file after declaring the type changes nothing. What does "CC the next line" mean?
Quote from: lordnoxx on January 20, 2011, 07:10:19 PM
Saving the file after declaring the type changes nothing. What does "CC the next line" mean?
Do the code complete operation (STRG+SPACE).
(STRG+SPACE). also only works after reopening the project.