Minimize/Expand Code

Development forum for the Ecere IDE.
Post Reply
D.Bane
Posts: 78
Joined: Thu Jul 29, 2010 2:51 pm

Minimize/Expand Code

Post by D.Bane »

Hi,

This post is related/continuation of this topic.

OK. Now my first question would be where is the code that is responsible for looking if the written words are class/do/for/if... I guess it is ecere.dll\src\gui\controls\EditBox.ec -> line618 (static char * keyWords1[] ={}).

Also would simple addition of the { and } make it colored or not (I guess it would) and that that is the place where it would be possible to detect everything.

Now I believe that I had read somewhere on the forum that you would like to have IDE as an application that will many like to use no matter what their programming language or type of file is, so there will be a lot more scope definitions then just { and } so what would it be your approach in making it look on the keywords based on the file type? Would something like this be possible (even if using parent) keyWords{keyWords1, keyWords2, keyWords(file)}... or just KeyWords(file) which would also use the keyWords1, or something like that.

OK. That is for now.. :)

Thanks,
D.Bane.
No army is to big, if the heart is beating strong.
There's no bad luck, it's just easier to blame someone else.
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Minimize/Expand Code

Post by jerome »

D.Bane,

Yes, at the moment the syntax highlighting is in EditBox.ec.
There are plans to make it much more powerful and customizable, and to support other languages as well.

Detecting { and } for your purpose, however, is a completely different story.

The syntax highlighting is being detected during rendering (OnRedraw), whereas the organization of the code with expand/collapse button would be done on loading and on code modification...

Really, it's a big challenge :) Perhaps you could report a 'feature' issue on Mantis for now (I looked, we don't have one yet!), and maybe at the same time you could find another one of the issues marked 'Priority:Immediate' that you could take a look at instead? To get familiar with the ecere and IDE source code before attacking such a huge challenge! hehe

Regards,

Jerome
D.Bane
Posts: 78
Joined: Thu Jul 29, 2010 2:51 pm

Re: Minimize/Expand Code

Post by D.Bane »

Hi Jerome.

I will post the request at the Mantis for now and when I will start looking at the things I might know to resolve in the Mantis.

All the best,
D.Bane.
No army is to big, if the heart is beating strong.
There's no bad luck, it's just easier to blame someone else.
jerome
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Minimize/Expand Code

Post by jerome »

Hi D.Bane!

I'm glad you like Ecere and I will also be happy if you can contribute :D

I'm quite picky about how things should work and get fixed hehe

But the best way to go about it is you choose one of the issues which you would like to work on, you can let me know about it and I can give you some additional info or suggest a particular way. Also you should make your own fork of the Ecere SDK on github, and when you have a fix or contribution you can commit it there in your own fork of Ecere, then let me know about it (You could issue a 'Pull Request'), and I will look at what you did and see if there's anything I want to improve, and when it's ready I will integrate it into the master branch of Ecere! I'm assuming you're already familiar with git, right? You've been using it to get the the latest code?

As for profiling, to be honest I don't use gprof much. I've tried to use it before on Windows but it's quirky at best (some versions of gcc and/or gprof didn't work at all though, you have to use the right one to get proper results), it would probably work better on Ubuntu. However, I don't think a profiler is useful to solve any of the current issues on Mantis. I don't think there are many performance issues on Mantis, and those that may be there I already have an idea how to solve them, e.g. the compiler performance which I hope I will work on soon.

As for MemoryGuard, it is a very useful tool, e.g. to solve memory corruption issues when things are getting wacky and you don't know what the heck is going on, or for finding memory leaks. To get the output in Windows, you'll have to select 'Console Application' in the Project Settings/Linking Tab, and the output will show up in the application's console. On Linux, it shows in the 'Debug' tab of the IDE. I'm not sure if you're familiar with running application with MemoryGuard on Linux already... But what we do is we add ecere.epj to the workspace of the application being debugged (e.g. ide.epj), and make the "memoryguard' config active for both of them (use space on the topnode of the the project view to toggle the current config). The MemoryGuard-enabled library will automatically be on when running this way (there is no need to copy the ecere.dll file around).

Looking forward to your contributions! :D

All the best,

Jerome
D.Bane
Posts: 78
Joined: Thu Jul 29, 2010 2:51 pm

Re: Minimize/Expand Code

Post by D.Bane »

Thank you Jerome :)

I guess that I have to register at git for that, so I will do that.

So Fork->Pull Request->integration and celebration :)

So for now there is one issue that I think would be nice for warm up.. Is it just entering keywords or is there more to do, as I see that Redj posted it as implementation in IDE::codeEditor.

The console application is something I found to liking in eC already, it is great that I will be able to use it for additional things as well. :)

I look forward to get even more familiar to inner workings of Ecere.

See you around, all the best and enjoy the holidays :)

Oh and yes, thank you for the valuable information.

D.Bane.
No army is to big, if the heart is beating strong.
There's no bad luck, it's just easier to blame someone else.
Post Reply