Author Topic: Semantic highlight  (Read 60054 times)

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #60 on: June 21, 2012, 07:08:35 pm »
As for 'bool IsAppStartingUp()' function, shall I provide a patch?
Yes, just do it similar to the IsShuttingDown method. I'm off the next few days - so you have enough time for a patch... Otherwise I can do if I'm back ;-)
Ok, I'll try to do it myself.
@Morten: I'm affraid I've lost in C::B architecture. Please guide me how to do that or do it for me (I think it would take you 5 min or so :)).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: Semantic highlight
« Reply #61 on: June 28, 2012, 08:34:03 am »
@Morten: I'm affraid I've lost in C::B architecture. Please guide me how to do that or do it for me (I think it would take you 5 min or so :)).
OK - I've done it and will commit after a few tests... (as this changes the SDK version).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #62 on: June 29, 2012, 08:59:56 pm »
@Morten: I'm affraid I've lost in C::B architecture. Please guide me how to do that or do it for me (I think it would take you 5 min or so :)).
OK - I've done it and will commit after a few tests... (as this changes the SDK version).
Thanks!

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #63 on: July 08, 2012, 08:39:36 pm »
Hi there.

I observed that whenever I close configuration dialog of C::B all Scintilla's styles are set to those for the built-in syntactic highlighter.
Is there any way to turn off the built-in highlighter when SH is loaded?

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #64 on: August 17, 2012, 09:04:25 pm »
@Morten: I'm affraid I've lost in C::B architecture. Please guide me how to do that or do it for me (I think it would take you 5 min or so :)).
OK - I've done it and will commit after a few tests... (as this changes the SDK version).
How about these changes? When do you expect them to be commited?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: Semantic highlight
« Reply #65 on: August 22, 2012, 08:51:41 am »
How about these changes? When do you expect them to be commited?
They are in head now, with the limitations I mentioned. Tell me when thee is new stuff to test.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #66 on: February 19, 2013, 04:32:51 pm »
Hi guys!
It's a long time since my last post ;)
Sources of not-crashing plugin attached (maybe I'll find time to make some hg repository for future;))
Play with it and tell me what you think.
BUT!
 * no config dialog so far
 * if you go to editor settings and then back, the color scheme will revert to the C::B settings
    (how to turn this off???)
 * I don't handle changes in project/build target settings and active build target changes (work in progress)
 * due to some clang issues, there could be still places not colored properly ;) (I've filed bugs for this)
 * as usual, you need libclang installed (llvm and clang svn versions work fine for me; also remember to change
    linker options!)
 * tested with C::B (rev 8836) SDK v1.15.0.
 * [EDIT:] you need gcc >=4.6 with -std=c++0x or -std=c++11, or some other compiler supporting basic C++11 ('auto' and simple lambdas)

To handle options changes I need to know
 * when project options are changed (what if I modify only build target options? Do I get cbEVT_PROJECT_OPTIONS_MODIFIED also?)
 * when active build target is changed (that is set, not modified) -- what event should I use?

Enjoy!
« Last Edit: February 20, 2013, 10:28:00 am by mistar »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Semantic highlight
« Reply #67 on: February 19, 2013, 11:07:01 pm »
* no config dialog so far
I recently tested with providing semantic highlighting by hooking into the Scintilla lexer.  Pros: seamlessly integrates into the pre-existing highlighting settings.  Cons: the patch there is currently not usable (due to some sort of thread lock, I think, when you start typing).

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #68 on: February 20, 2013, 10:07:45 am »
Great!
But... how about the new C++11 standard? My plugin inherits C++11 support from clang,
which is quite decent. And what about errors in code? As you type, there are plenty of them...
Colors is a minor issue in my plugin; but clearly I need my own color config panel
because it has to be richer (semantic highlight has a lot more styles).
I think of using color scheme extending syntactic one, but I don't know whether it is possible
to control syntactic scheme in SDK.
« Last Edit: February 20, 2013, 10:10:12 am by mistar »

Offline daniloz

  • Regular
  • ***
  • Posts: 268
Re: Semantic highlight
« Reply #69 on: February 20, 2013, 10:11:21 am »
Yes, please, I want to see screenshots!  ;)

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #70 on: February 20, 2013, 10:26:18 am »
Oh... I forgot: you need gcc >=4.6 with -std=c++0x or -std=c++11 to compile the plugin (or other compiler supporting 'auto' and simple lambdas).
« Last Edit: February 20, 2013, 10:28:40 am by mistar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12195
    • Travis build status
Re: Semantic highlight
« Reply #71 on: February 20, 2013, 11:41:51 am »
Oh... I forgot: you need gcc >=4.6 with -std=c++0x or -std=c++11 to compile the plugin (or other compiler supporting 'auto' and simple lambdas).
Do you have any plans to remove all these c++11 things in the future, because some of us are stuck on older distros, which have only gcc-4.1 or gcc-4.4?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #72 on: February 20, 2013, 01:32:32 pm »
Oh... I forgot: you need gcc >=4.6 with -std=c++0x or -std=c++11 to compile the plugin (or other compiler supporting 'auto' and simple lambdas).
Do you have any plans to remove all these c++11 things in the future, because some of us are stuck on older distros, which have only gcc-4.1 or gcc-4.4?

Hmm... I probably could... and I'll try.

But... Do you have any plans to migrate to *newer* versions of gcc in the future? ;)
4.6 is already stable ;)
I recommend using C++11 features (e.g. rvalue references) that allow for cleaner and faster code.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12195
    • Travis build status
Re: Semantic highlight
« Reply #73 on: February 20, 2013, 02:07:09 pm »
But... Do you have any plans to migrate to *newer* versions of gcc in the future? ;)
Yes, gcc4.4.6 will be my next gcc. Unfortunately if you're doing commercial software you have to work on older distros.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mistar

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Semantic highlight
« Reply #74 on: February 20, 2013, 04:33:53 pm »
The code without c++0x features attached.
One more thing to config: in file CompileOptions.cpp change
#define GCC_VERSION_STR "4.6.3"
to your version (it is used in a workaround for clang using libstdc++).

And don't try to close editors while there are pending changes...
I'm working on it ;)

EDIT: fixed crashes on editor close.
« Last Edit: February 20, 2013, 04:55:29 pm by mistar »