News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Semantic highlight

Started by mistar, April 25, 2012, 07:34:09 PM

Previous topic - Next topic

mistar

Quote from: mistar on June 18, 2012, 08:27:05 PM
Quote from: MortenMacFly on June 18, 2012, 08:03:12 PM
Quote from: mistar on June 18, 2012, 12:42:38 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 :)).

MortenMacFly

Quote from: mistar on June 21, 2012, 07:08:35 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).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mistar

Quote from: MortenMacFly on June 28, 2012, 08:34:03 AM
Quote from: mistar on June 21, 2012, 07:08:35 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!

mistar

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?

mistar

Quote from: MortenMacFly on June 28, 2012, 08:34:03 AM
Quote from: mistar on June 21, 2012, 07:08:35 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?

MortenMacFly

Quote from: mistar on August 17, 2012, 09:04:25 PM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mistar

#66
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!

Alpha

Quote from: mistar on February 19, 2013, 04:32:51 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).

mistar

#68
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.

daniloz

Yes, please, I want to see screenshots!  ;)

mistar

#70
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).

oBFusCATed

Quote from: mistar 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).
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!]

mistar

Quote from: oBFusCATed on February 20, 2013, 11:41:51 AM
Quote from: mistar 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).
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.

oBFusCATed

Quote from: mistar on February 20, 2013, 01:32:32 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!]

mistar

#74
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.