New official home for MaxIDE

BlitzMax Forums/BlitzMax Programming/New official home for MaxIDE

skidracer(Posted 2014) [#1]
I have started using MaxIDE at work and need to add a few small features so MaxIDE is "back in development".

It's extremely useful for running scripts and batch files from F5 key rather than poking around in a console.

Besides adding .sh type to project browser / filter I also plan to move a few small improvements I made to Monk in past few years.

https://github.com/nitrologic/maxide


*(Posted 2014) [#2]
Excellent would be nice to see max being improved and is certainly welcomed :)


Brucey(Posted 2014) [#3]
Yay. Time to get forked! :-D


jsp(Posted 2014) [#4]
Cool good news!


Derron(Posted 2014) [#5]
Yay. Time to get forked! :-D


And bringing in your scintilla-textarea-replacement?
And bringing in GTK for the linux variant?

It dramatically improves file handling (has own undo-handling, compared to the bugged one of MaxIDE - which eats some lines/characters when doing undo here on linux :D).


Good to see a "official" repo - hopefully not a - sooner or later - dead repo

bye
Ron


PhotonTom(Posted 2014) [#6]
Im really enjoying using the open source indevIDE here http://sourceforge.net/projects/indevide/?source=directory. I'm finding it much better than the MaxIDE but its all up to personal preference i guess :)


skidracer(Posted 2014) [#7]
It has taught me a certain amount of humility as I have never publicly needed to defend a piece of s**t before from valid criticism.

[edit] links to memorable threads removed

Admittedly MaxIDE source was never good enough to be included in official BlitzMax distribution so having it on the spyware infested source-forge was always a bit sad. The previous hosting at google code being a lesson in why not to use google code.

Who knows, MaxIDE may be responsible for why BRL never made any real money, it's been a popular theory.

However for personal use, I like it and I'm over giving a ff what people who haven't coded up an IDE atop their own tinpot UX toolkit think. :)


Derron(Posted 2014) [#8]
Of course it is a lot of things you had to do first (maxgui) to make it work but I think all of us know that MaxIDE would need a lot of work to be comparable to available IDEs for other languages.
Yes, it is an editor, it even has an debugger and includes some "language/product specific portions" but at the end people compare "comfort" (intellisense, refactoring, context help etc.). This is what MaxIDE lacks. And I cannot imagine that there are many users around interested in coding these features instead of just blaming/whining (myself included!).


Like said MaxIDE has some trouble with "undo" here on Linux (you write, press undo - and it sometimes deletes the wrong things, when then redo-ing things, other characters appear - so you end up with "broken" text).
Using "scintilla" of course adds another block of code one has to adjust (the lexers) but it is truly a matured piece of software, so it is just up to the wrapping/wrapper to make it work.

Benefit of scintilla (or another crossplatform-textarea) is the included ability to make autocompletition-boxes and other things. Yes, I know, these are features not everyone needs but I assume this is one of those "nice to have" thingies (like the "add icon to exe"-thing for windows binaries).

I myself use Geany (because of the really fast startup times - and because I also edit other source files in it, so only "one app" is open) but for "debugging" I have to use MaxIDE - which with FLTK - looks like running something old in an emulator (like said, on Linux :p).

@MaxIDEs responsibility:
When you present the IDE in screenshots advertising your programme ... hmm it really might have had some "impact" as id just does not look that serious as other IDEs look (hmm better call it "dated"). But I think it wasn't you (alone) who made the decision to include MaxIDE. As Ted is "basic" too, I assume it is just the way Mark likes the editors for his languages.
Maybe it would all have been way different if BlitzMax would have been more popular (which creates a custom economy around a product - like unity/.. and their asset stores) but time has gone by and there we are.

These are no thing you should worry bout, it is just a personal opinion about MaxIDE.


@GitHub
I think this is a good move, but you now need to push changes continuously to attract users to provide custom patches. Many (except Brucey) - myself included - are not the right ones to push really big chunks of new functionality into a product, we change something "here" and something "there". So my best bet for a first move would be to fetch Bruceys changes (GTK and Scintilla) and have a look at what "extras" the MaxIDE CE provided (if there are some).
I guess when doing all of these things you might find some things "odd" in MaxGUI - or cumbersome to achieve things. You know, things lead to other things and at the end you are coding something you didnt think of when starting hours earlier.


bye
Ron


Brucey(Posted 2014) [#9]
Well, it works on my Raspberry Pi :-)


Derron(Posted 2014) [#10]
You mean the undo?

It works... sometimes. I think the bigger my source files, the more often it happens - maybe it also has to do something with file encoding (utf). I cannot make that bug reproduceable (just happens from time to time), else I would try to fix it.


bye
Ron


GfK(Posted 2014) [#11]
My biggest gripe with MaxIDE has always been the lack of auto-complete. I would say it's absolutely essential for an object-oriented language - even more so with moderately large projects where code can get pretty complex. You just can't remember the exact name of every variable, class, method and function.

I think it would have been highly beneficial for BlitzMax (and Monkey-X) to hatch a deal with Manel Ibanez, so the two IDEs (BLIde and JungleIDE) form a part of their respective retail BRL packages at no further cost to the customer.

I'm not knocking BRL, not at all (come October I'll have passed the $150,000 mark, thanks to their stuff so I've a lot to be grateful for) - but I just couldn't tolerate working on a large project with MaxIDE. It never felt built for anything of that magnitude.


Derron(Posted 2014) [#12]
Problem with Blide/Jungle ... it uses ".net" and hmm sounds to me like it does not work that "native/well" with Mac and Linux. I do not know much about BLide but I think he started with a "text area component" which provided a big bunch of functionality (intellisense support) - this was not compatible with Mono so it went deeper and deeper into the win32-world. He later dropped that component (think it was to slow) but the win32-requirements then already there rooted deeply in the code.

PS: I do not need "asset" support in an IDE (managing images or so) as bigger projects will surely have their own way of managing it, the IDE just can't stand such things (except it is a really really full blown application with senseless high resource consumption :p). Things like "release builder" should all happen using plugins. These plugins should be done in scripts (Lua) instead of "dll/so"-files as this stops people from making small adjustments (altering the call command of a 3rd party tool eg. to include the icon file in the win32-exe).


bye
Ron


Henri(Posted 2014) [#13]
I have managed to get by with MaxIDE all these years, so it has served it's purpose.

Two features/fixes I would ask from a genie if I had a magic lamp;

1. Responsiveness seems to lower a bit when dealing with thousends of lines of code. Don't know if scintilla would be the answer ?

2. Smart Replace where you could replace sentences with wildcards in the middle (for example where if start and end match then replace and middle can be of unspecified size)


Just airing my thoughts or shooting the breeze :-)


-Henri


Derron(Posted 2014) [#14]
I think instead of "smart replace" you would need to use a RegEx-module (think brucey offers one) so you can search/replace in a way powerful manner.


bye
Ron


Yan(Posted 2014) [#15]
Just out of interest...Why not bigted?


Xerra(Posted 2014) [#16]
Blide. Could never go to another IDE after buying this. It's be like cheating on the wife....


Derron(Posted 2014) [#17]
@Xerra
But if your wife does not like your new mind/hobbies (other OS than Windows) it might be time to replace your wife with a more "compatible" one :p.

I know that it really is a nice piece of software but it really lacks on two things: "easy mode" when starting up (imagine you are a coding beginner and start a "complex ide"), it starts up slower than needed (defer some things to do "later"), it only runs on Windows, it is closed source (or does not have "language plugin"-ability) - so it is harder to add basic-support for other files (eg. monkey in a "blitzmax ide").


bye
Ron


Brucey(Posted 2014) [#18]
But Derron you forget, everyone uses Windows, so the fact that it (Blide) is Windows only, is inconsequential. :-p

You mean the undo?

I mean, MaxIDE :-)

Undo generally works without issue for me on Linux now (with Gtk + Scintilla). With FLTK it's a complete disaster, and as you say, it changes the wrong text and makes a mess of your code.
The only time I've had an issue with mine (Gtk) was because there was an invalid multi-byte character somewhere in the text that was confusing the offsets.
Ideally, one would probably use Scintilla's own undo/redo functionality rather than a generic one plugged on top of it.


Derron(Posted 2014) [#19]
one would probably use Scintilla's own undo/redo functionality


one should probably use Scintilla's own undo/redo functionality.

Why inventing the wheel over and over again. I know, there are "configurable" IDEs already (see your plugin for Eclipse) but I wont call it a "wheel" but something more advanced - a place where competition is wanted.

(Hmm, I could elaborate about MaxGUI and wxWidgets now - but MaxGUI really has the benefit of smaller filesizes - but it might lack of visual consistency between gtk/win32/cocoa-or-what-is-used-on-mac)


@your gtk/scintilla-thing: the only problem I had is the locale-one (I mailed you that) because 1.00 is in Germany nothing because we use "," (Germany 1,00 vs English 1.00). Maybe configuration should be done in an XML-manner - or if too much "overload", splitter chars should be escaped:

font = Helvetica, 12\,000, ...
and of course "\" is then "\\".

But this things can be tedious, maybe just trust your XML lib to escape perfectly already.


bye
Ron


skidracer(Posted 2014) [#20]
The software undo redo stressed the MaxGUI keyboard callbacks combined with underlying style changes and a bunch of other things. In this respect MaxIDE was the unit test tool for MaxGUI so at the time, if I could do it manually I did.

I think FLTK was stable for a couple of versions then lost it due to some custom mods being lost. From memory, their switch to unicode was hideous and unbecoming.

I will look at optional native undo buffering but auto capitalising I suspect will cause headaches.

I also want to support line numbering option in latest gtk/scintilla based builds so hope to grow the Options for this also.

There may be a good argument for MaxGUI to adopt scintilla and reflect a richer textedit API on Win32 and MacOS also.


Brucey(Posted 2014) [#21]
I've started looking at the OS X port for a Scintilla TextArea gadget, working along the same lines (as a drop-in replacement for the standard TextArea).


Ah... is it the auto-capitalising that sometimes causes a file to "change" when I switch tabs to it? (change as in it believes I've edited it). This occurs occasionally on both Linux and OS X (perhaps Windows too, but I don't use it so much).


Derron(Posted 2014) [#22]
If it is that auto-capitalising (which is tedious if forgetting to set such changes to "ignore" when using revision-control-systems), then auto-capitalising should only start on "input" to a text control, not on activation of the control/tab.


In other editors you can "undo" autocapitalising - so they do not handle "keyboard callbacks" but "changes to the text area". In Libre/OpenOffice eg. you write a weburl and it automagically gets converted to that blue, clickable link - pressing undo removes that conversion again. Same for automagical "correction" of words - sometimes you WANT that misspelled word.


As there are many things happening here and there - which might change the content of the text area, it should be the textarea watching for every change and making a protocol/undo-buffer, not the app. You just will miss something and in the worst scenario it breaks things.


@FLTK:
If it would style properly according to the installed theming, there wont be that much trouble. With GTK you only "buy time" - there might be a future for QT (because of the platforms it will support in the future) - so a "standalone" backend is nice to have. So FLTK will surely "work", but just looks a bit odd. Using wxWidgets (and wxMax) is another layer making things "bigger" - and you will loose your widget-child. Not the best idea.


@line-numbering
This is just an option in scintilla, activate and it is there. Same for folding-points, Calltips ("autosuggestion"-list) etc.


Thanks for not feeling attacked by my bunch of posts with a bit of a negative scent.


bye
Ron


skidracer(Posted 2014) [#23]
EOL handling...

I like NotePad++ menu and for work I have got to be able to work without \r slipping into scripts.

So, maybe in config

[ ] Unix line endings on all platforms

or a menu to strip Windows end of lines from any file you are working on....


JoshK(Posted 2014) [#24]
Scintilla integration makes a huge difference especially on Linux.

It also removes the need for any messing around with undo/redo, since it's already written in Scintilla and works well.


Derron(Posted 2014) [#25]
Hmm I try to use Windows-EOL \r\n on all my files. I know that many of my files are viewed on windows PCs by others - and if you open plain text files, it just looks "odd".

So instead of using a "system recognitioned EOL" :

?Win32
Global NATIVE_EOL:string="\r\n"
?Linux
...

You should (imho)
1) re-use the EOL of the loaded file
2) if user enforces specific EOL-style convert loaded files upon saving
3) on new files check if user enforces a specific eol - use this or if nothing is set, use "win32" EOL for compatibility issues.


bye
Ron


JoshK(Posted 2014) [#26]
Who knows, MaxIDE may be responsible for why BRL never made any real money, it's been a popular theory.

The product itself is a relatively minor factor in determining whether a technology catches on. Read "Crossing the Chasm" if you want a good explanation.


skidracer(Posted 2014) [#27]
I like it. Highlight a stupid comment, then sprout complete gibbersh (no offense).


skidracer(Posted 2014) [#28]
Ron, agree with you also.

I could not believe the end of line hell that git, shared file systems, applying subversion diffs with some notepad++ operations on top landed me in at work this week.


Derron(Posted 2014) [#29]
Shouldnt the diff tools have ignore-parameters for lineendings?
Same for "tabs vs spaces as intending markers".

Dunno what scintilla handles already concerning EOL. Brucey?


bye
Ron


JoshK(Posted 2014) [#30]
I'm just saying, the reason things catch on has very little to do with the quality of the product itself.


Scaremonger(Posted 2014) [#31]
I often use the MaxIDE and apart from the undo/redo issue which I've also seen on windows, my biggest bug-bear is ctrl-right or ctrl-left changing tab instead of moving the cursor to the next word. I think this is only on Windows.

I look forward to any improvements, especially if the gui is made to look more modern.


Brucey(Posted 2014) [#32]
my biggest bug-bear is ctrl-right or ctrl-left changing tab instead of moving the cursor to the next word

What happens when you enable "Use OS Specific Shortcut Keys" in the options?

I'm currently developing exclusively on OS X with my 64-bit build of MaxIDE. Haven't had any issues with it yet :-)


xlsior(Posted 2014) [#33]
my biggest bug-bear is ctrl-right or ctrl-left changing tab instead of moving the cursor to the next word


Yup, absolutely drove me up a wall when they first changed that behavior -- it's so ingrained in normal day-to-day text editing, that it becomes REALLY disruptive when that behavior changed...

After quite a few complaints the normal windows behavior was restored through the "Use OS Specific Shortcut Keys" option in the settings, though.


Henri(Posted 2014) [#34]
Just remembered one tiny bug in MaxIDE which hasn't been mentioned earlier as far as I know.
At some point when dealing with lots of lines, the IDE doesn't move the rest of the line when typing in the middle of the line resulting overwritten characters. The situation is corrected by restarting the IDE.
Somehow I suspect that this might have something to do with copy/paste operations sense I have a feeling that the problem manifests when doing large copy/paste ops.

Don't know if anybody finds this least bit interesting, but thought I'd post it anyway.

EDIT: Happens on Windows (don't know about others)

-Henri


skidracer(Posted 2014) [#35]
This bug would be more interesting if it was easier to reproduce :)


Henri(Posted 2014) [#36]
Hello skid,

yes I imagine it would be :-). Alas, it happens a bit randomly and in long intervals, but if I manage to reproduce it systematically I'll let you know.

-Henri


Henri(Posted 2014) [#37]
Okey, I found out that richedit control has a insert/overwrite switch. If you press Insert-key it toggles this switch.

Maybe I've accidently pressed insert key unknowingly. It is close to delete-key so it's possible.So it seems not a bug at all, but a feature :-)

-Henri


MikeHart(Posted 2014) [#38]
Simon,

by official... does that mean that it is still an official BRL supported product or does that mean that you officially take it back under your own banner?

Are you still part of BRL? Sometimes I got the notion from your posts that you guys split ways. And Marks announcement in April didn't help either.


Grisu(Posted 2014) [#39]
Updates are always welcome.

Can someone please host the latest exe file?
I can't compile the source code. :(


Henri(Posted 2014) [#40]
Out of curiosity I tried to compile it with vanilla Blitzmax 1.50 (on Windows platform) without any errors. Maybe you could download installer and install Blitzmax in temporary folder and try from there ? Just so that there aren't any distractions.

-Henri


Scaremonger(Posted 2014) [#41]
@Brucey: Use OS Specific Shortcut Keys does the job. Thank you. I might even start to use it more often. :)


zoqfotpik(Posted 2014) [#42]
Would love to see function header information in a tooltip when mousing over a function name.

But coming from decades of vi, the default editor feels like bloatware to me :). Part of what I loved about blitz and what attracted me to it was how bare you can make the editor window.


Scaremonger(Posted 2014) [#43]
Have you thought about including a form builder; something like GUIde?


Wiebo(Posted 2014) [#44]
I use sublime text personally for all my editing needs these days.

Oh GUIde, blast from the past. I open sourced it, so feel free to go for it! BlitzPlus code though: https://github.com/wiebow/guide


Wiebo(Posted 2014) [#45]
I read that .NET will be open sourced and available for Apple and Linux. So maybe some of the more sophisticaed IDE's can be ported to other platforms. Would be great.


Derron(Posted 2014) [#46]
It needs widgets... which is not included in the "OSS .net".

What you might get is lexer/parser/analysis (blide).

indev IDE is written in Blitz with wxWidgets... so already crossplatform - but lacks of advanced "analysis" logic ... or publish-functions. Think because nobody was interested to help, the development of indevide kind of "halted".

http://sourceforge.net/projects/indevide/ - if you do not know it.


bye
Ron


Henri(Posted 2014) [#47]
People tend to use what they are used to. I'm used to MaxIDE even though (with all the love) it's probably not the best out there.

-Henri


Derron(Posted 2014) [#48]
I tend to reuse what is open: Geany (text editor). Only starting up MaxIDE for debugging issues.
MaxIDE has serious flaws with "undo" on Linux. It is like a gambling game... luck or no luck. For me that is a "no-go".


bye
Ron


skidracer(Posted 2014) [#49]
@Scaremonger: a form builder is a nice idea but I never wanted to compete with logicGUI.

@Derron: the fltk module may need to be retired, it originally worked well but now seems too flakey. Official support for gtk may also help weed out any issues remaining with what from a far seems like a better solution.

I have added monk source to same location and I am doing some experimenting.

Monk is the same as MaxIDE but can handle .monkey builds and has it's own html server built in. I am now trying to fix it up a little so I can use it to produce / code / author a set of interactive html5 tutorials.

Just to be clear, I'm not advocating anyone use MaxIDE or Monk as they are now personal projects and I've done my 10 years of defending their worthlessness....


BlitzSupport(Posted 2014) [#50]

MaxIDE or Monk as they are now personal projects and I've done my 10 years of defending their worthlessness


Hey, these babies are just the job for some of us!


Derron(Posted 2014) [#51]
I already downloaded your latest releases ... but recognized that the default "MaxGUI" does not allow DropDown-Boxes in the toolbar (I wanted to add a "target" + "build" selector dropdown there for easy target changing).

Intention was to include support for "Bmx-NG" - which adds more targets and processor architectures:
bmk -g arm -l android
bmk -g arm -l linux
bmk -g x86
...

Of course it is possible to add them to the "menu" but as there are not that many icons in the toolbar, I thought we could add some things there too.


Brucey mentioned some time ago, that he replaced the textarea component with "scintilla" (which handles "undo" on its own) ... albeit it removes the "demo usage" of your text component - it might be better for the "editor part" of MaxIDE.

Did you think of having "MaxIDE" doing both together: monkey and blitzmax? Depending on the "active tab" you could change menu/toolbar (similar to opened ".c"-files).


@GTK
I understand the benefit of FLTK: dependencies are low compared to GTK and their continuously changing API. Also you will start the fight of "GTK vs QT" :p.


bye
Ron


Sonic(Posted 2014) [#52]
i'd love to see it stop disabling shutdown due to save requester on Mac, when no edits have been made (obviously i wouldn't mind it asking me if i have made changes...) it's one of only two programs i have which behave in this way, and frequently stops my mac from getting shutdown, leaving it on all night unnecessarily. the weird thing is it shutdown correctly via the quit button if no edits have been made (i.e. without a requester), so the functionality must be 'mostly there'?


markcw(Posted 2014) [#53]
I agree with BlitzSupport. In my experience MaxIDE is almost bug free and it has all the features I want. I'd be very happy to have paid $30 for it.

Well, the default syntax highlighting colors/fonts are horrible but that's a non-issue. More to the point, in Windows the textarea gadget is really not fun. The Mac textarea is acceptable but the Gtk Scintilla textarea is the best. This suits me as I only want to work mainly on Linux.


Derron(Posted 2015) [#54]
Just an odd thing:

the following (already stripped down) code stalls MaxIDE:

'if 1 = 1 then
'	print "hi"
'	'end-function
'endif

rem
local a:int=1, b:int =0

if a if b
	print "chained multi line"
endif

if a then print "single line then" else print "single line else"

if b then else print "single line skipped then"
endrem


(just copy-paste it into a new document of maxide and it does not get highlighted and maxide stops responding).


bye
Ron


skidracer(Posted 2015) [#55]
Thanks Derron!

I have fixed and committed change to line 4346 so the endrem at end of file condition should now be ok:

If ( p>=src.length-3 Or isntalphanumeric(src[p+3]) ) And IsFirstCharOnLine(src,p) Return p


markcw(Posted 2016) [#56]
Hi simon,

I have forked Maxide HERE with klepto's Scintilla module featuring auto complete, code folding, better undo/redo and cpp syntax highlighting.


Derron(Posted 2016) [#57]
Now just bring that up for the linux users (scintilla...).


bye
Ron


Henri(Posted 2016) [#58]
Hmm... I compiled maxide.bmx successfully, and it starts OK, but can't get any textarea to appear. When I press New button there is only white canvas with no text ? Using Windows 7.

-Henri


Chalky(Posted 2016) [#59]
I get the same - maxide.bmx (munch:scintilla) compiles fine, but no textarea appears when loading files or creating new documents. Win8.1.


Dabhand(Posted 2016) [#60]
Same here! :)

Dabz


markcw(Posted 2016) [#61]
I forgot the dll! Copy SciLexer.dll to BlitzMax folder.


Henri(Posted 2016) [#62]
Allright, seems ok :-)


Are you interested developing this a bit further or are you content as it is ?


Just in case, I mention couple of thoughts which spring to mind:

- Ability to return cursor to previous location in large code (back & forward button).

- Auto completion for function / method - names inside scope.



-Henri


markcw(Posted 2016) [#63]
Hi Henri,

yes I'm still adding things to it, so open to suggestions.

Like Derron suggested, I'd like to do a Linux version with Maxguitextarescintilla when I've add all the features in Win.

- Ability to return cursor to previous location in large code (back & forward button).

I don't really get how this would work, add new position after an edit inside a method/function? Not sure I see much point since I'm happy with the code view or find on large files.

- Auto completion for function / method - names inside scope.

This sounds like a good idea, do you mean adding functions/methods not documented but in project scope?


Fielder(Posted 2016) [#64]
MUNCH!, very very nice IDE!!!!!

just a question, where i can find the background color for LINE NUMBERS on LEFT? i use a black template .. and i need a DARK GREEN BACKGROUND FOR NUMBERS


Derron(Posted 2016) [#65]
munch:
This sounds like a good idea, do you mean adding functions/methods not documented but in project scope?


Think this is what he meant.
Of course this then means you would have to analyze the code (and imports, includes...) aka parsing the files for types, methods, functions, globals ... and their individual scope.

bye
Ron


GW(Posted 2016) [#66]
very nice! Thanks!


degac(Posted 2016) [#67]
Nice!
Something new to learn!
I would like to implement Scintilla in my own MaxIDE version... maybe one day!


Fielder(Posted 2016) [#68]
Degac can you understand where is located the LEFT BAR color?


Henri(Posted 2016) [#69]
@munch

I'll try to elaborate :-)

I don't really get how this would work, add new position after an edit inside a method/function? Not sure I see much point since I'm happy with the code view or find on large files.

What I mean is a cursor queue which stores something like 10 previous cursor positions based on a simple rule: If the cursor changes more than 1 line at a time then save the position (this would eliminate all the unnessacery positions).
This would be handy in my experience in a situation where you are typing your code and need jump to some other function just to check something and then want to come back. Very typical scenario.



This sounds like a good idea, do you mean adding functions/methods not documented but in project scope?

Like Derron said, yes.
This might be slightly more challenging, but definately doable and worthy.


I have always liked MaxIDE for it's simplicity, but some additional tools just make life a bit easier. Most important is of course a rock solid foundation.


-Henri

Ps. If you need any help just holla.


Dabhand(Posted 2016) [#70]
It is doable... As, I've did it once myself years ago, source is lost now, but I did have it working.

Basically, you'll need a lexer, this one here might help:-

http://www.blitzbasic.com/codearcs/codearcs.php?code=2664

Then, you'll need to parse the tokens accordingly, I used a branch and leaves approach to it, basically, something like (Note the classes more then anything else really):-



This was taken from a language I wrote a few years ago... But basically, I used the branch/leaf approach and when dropping in/out of scope I just pushed and popped the branches as of when I needed.

The whole project is here, which may help you find your footing on the subject: https://sourceforge.net/p/bamboobasic/code/ci/master/tree/

Now I'm not saying this is the right way, probably isnt, I'm a plasterer not a IT expert, but, it does what it says on the tin and works and as such, it just might give you a few ideas! :)

Dabz


Derron(Posted 2016) [#71]
The problem shouldn't be the lexer/parser but the obversing of dynamically added/removed portions:

While editing you add methods, remove functions, create new types ... and the editor should know about them, _without_ parsing the whole project over and over: it should be able to cut/add "branches" on the fly.

This is one of the real "crucial" parts of the work an intellisense/autocomplete has to do (next to checking grammar, scopes you are in).


Henri:

This would be handy in my experience in a situation where you are typing your code and need jump to some other function just to check something and then want to come back. Very typical scenario.



Isn't this normally done via "views" to a document: you have multiple windows showing the same document, often you split your editor view into these windows/canvases. Now you could keep your cursor in one editor view in the functionX and in the other view you do whatever you like.
This is more versatile than storing the last X positions of "cursor jumps".


bye
Ron


Henri(Posted 2016) [#72]
These are separate things in opinion and not mutually exclusive. Perhaps the idealogy of what I'm saying is analogius to how browser back & forward - buttons work. Instead of opening everything in it's own tab, you can press a link on a web page and safely assume that you can return to previous 'view'.

I have used IndevIDE which is also based on MaxIDE (through CE), that incorporates this functionality, and found it quite useful (the actual browser back-button in MaxIDE toolbar not so much, sorry ).

On another note, there is one thing common for most IDE's for programmers and that is way to open keyword declaration / definition in source code usually on a new tab for conveniantly viewing the actual source code of that declaration. Like for example pressing F2 key when cursor is on top of that word.

Anyhoo, I've made my case :-)

-Henri


markcw(Posted 2016) [#73]
just a question, where i can find the background color for LINE NUMBERS on LEFT? i use a black template .. and i need a DARK GREEN BACKGROUND FOR NUMBERS

Now there is a new version up, just go to ide options>tools tab>margin.

Henri, I've added the cursor history list via back/forward browser buttons, hopefully you'll like it. I haven't tried IndevIde - so I invented the rules but I like the way it works. It doesn't add a position until you move 2 pages and if you hit back and move somewhere else it will delete all forward/ahead positions, so you can start the list over.

I also added the checkbox option to save all files with LF or CF+LF. It just happens on save as I thought simple is best.

I'll have a look at your code for parsing Dabz thanks. Probably best not to reinvent the wheel again, although I was considering it. :)


Dabhand(Posted 2016) [#74]

I'll have a look at your code for parsing Dabz thanks. Probably best not to reinvent the wheel again, although I was considering it. :)



Here, you go berserk kidda and do your thing... I'm just chucking stuff up there! :)

Dabz


Derron(Posted 2016) [#75]
@cursor history
Do not forget "Ctrl+F" (search) or "search next" (dunno, F3 or "CTRL+G", depends on the implementation). These might have to get included (depends on the user wishes :-).


bye
Ron


Chalky(Posted 2016) [#76]
@munch - this is fantastic - thank you!

I am aware that code-folding is not the most important feature, but I use it extensively when editing larger projects - so I really appreciate the addition. The icing on the cake would be if fold-states were saved between sessions so that MaxIDE auto-folds code when reloading files. I think IDEal did this by adding comments containing fold data to the end of each source file - though it's been a long time since I used it, so I could be wrong. I realise that editing source files containing fold data outside of MaxIDE might invalidate that data - but if people choose to do that, they have only themselves to blame if the folding in MaxIDE is broken as a result!


Derron(Posted 2016) [#77]
Never store IDE/Editor data in the source files... Revision Control System Users (git, svn) will thank you keeping the modification dates as they were.


As the editor needs to save data about "opened files" already, you are free to extend that portion by saving (for each used fold spot):
- folded line content (plus previous and next line)
- (optional) folded line

That way you could:
- even try to find the fold-spot when the file was modified (except the 3 lines were modified meanwhile)


So conclusion is to save (for all opened files):
- foldspot data
- current cursor position
- other meta data of interest (eg. if you allow custom colors, fonts, ... for individual files)

You could either save this in one file, or individual "filename_uri-hash.conf"-files which get deleted as soon as the document is no longer open (and file was not used for X days - which allows to at least possibly hold old information up to a certain amount).

bye
Ron


Henri(Posted 2016) [#78]
Allright, at home and tried it out.

@Back / forth
It seems that for the first time those buttons have actually some use, well done :-)



One notification:

Bracket highlighting creates some extremely white blocks which make the cursor vanish if located next to it. Those blocks are not present in vanilla MaxIDE.


Possible solution(s):

Either be rid of the whole white block or allow user to adjust the color.


-Henri


markcw(Posted 2016) [#79]
way to open keyword declaration / definition in source code usually on a new tab for conveniantly viewing the actual source code

That's another good idea, thanks.

I fixed the white bg color for brackets/braces, I use a light bg color so didn't see that.

It now has cursor history selection, better at reminding you what you were doing. It works on find/goto and any Event_GadgetSelect.

Also there is autocomplete/intellisense for types/methods/functions but only in the current file, I've still to do import/include.

I also edited the scintilla mod so instead of textarea.GetScintilla.SendEditor it's just textarea.SendEditor.

I looked at saving code folding data but I'm not sure what to do there yet.


Cocopino(Posted 2016) [#80]

Also there is autocomplete/intellisense for types/methods/functions but only in the current file, I've still to do import/include.



Wow, way to go munch :)

Have you seen this thread:
http://www.blitzmax.com/Community/posts.php?topic=105943

Do you think you can make the IDE work with overloads, e.g.
Type TTest
	Method Foo(a:int)
		return a
	EndMethod
	
	Method Foo(a:int,b:int)
		return a * b
	EndMethod
EndType

Local test:TTest = New TTest
test.


will show a dropdown like in C# / Visual Studio showing both Methods?
Please tell me if I'm getting greedy ;)


Derron(Posted 2016) [#81]
@ autocomplete
You do it "once" for now? So after editing the code, the new code isn't known to the editor yet?

Dunno how dynamically updates are done at its best:
- after each modified char (scan the modified lines for type/function/method/global/local/field/const ...and comment)
- after a modification took place _and_ cursor line changed (so only after finishing most of the "edit")
- lazy: on a timer base

I would prefer the modification-ones (you will recognize when editor has to handle bigger source files). Therefor you need convenience helpers (add, remove, ... of lexer-tokens).


bye
Ron


grable(Posted 2016) [#82]
Thats what threads are for ;)

One way of doing it:

For each keystroke a timer is reset, when that timer reaches its maximum (something around 250-500ms for best response) it signals a thread to start parsing.
If a key is pressed while the thread is parsing, another signal is sent to stop it. Alternatively it can be allowed finish its work but throw away the result.

The thread should only parse a region around the edit point for this to be quick.
This would of course require an incremental parser, aided by the metadata it extracts from the source.


Derron(Posted 2016) [#83]

The thread should only parse a region around the edit point for this to be quick.
This would of course require an incremental parser, aided by the metadata it extracts from the source.


This is what I wanted to express...maybe I failed on this.


bye
Ron


markcw(Posted 2016) [#84]
Do you think you can make the IDE work with overloads, e.g.

Ah yes I do think you're getting greedy here. I only intend a simple keyword list.

You do it "once" for now? So after editing the code, the new code isn't known to the editor yet?

It updates on every save, there is no need for anything more complex.


Henri(Posted 2016) [#85]
Hi munch,

I just tried the newest version and must say that I like it :-)
Autocomplite / intellisense saves A LOT of typing. Also the recognition seems to be dynamic, meaning it picks function names right after I've typed them.

Good work, I'll report if I find anything shady.

-Henri


Dabhand(Posted 2016) [#86]
Excellent! :)

Now, lets have Type fields and methods and it'll be perfect! :)

Dabz


Derron(Posted 2016) [#87]
It updates on every save, there is no need for anything more complex.


Wouldn't it be easier to:
- On Keystroke add current line to "to update"-list and (re-)start a timer
- on timer (and if update-thread finished):
- - for each "to update"-list-entry:
- - - begins (trimmed) with "field/const/global/type/function/method/struct"
- - - mark "to update"
- - "to update"?: update autocomplete in a new thread

Next step is then to only update the modified lines (add or remove type/method/...)


bye
Ron


Fielder(Posted 2016) [#88]
wait .. and what about special RELEASE FLAGS? (the same of standard compiler)

?Test
print "test"
?

?Old
Print "old"
?

the IDE must be save the CORRECT SOURCES for the desired BUILD...

like.. Example.Old.BMX
and compile it...

maybe to not break compatibility to other ides... use something like a double REM ( ' + ' )

''Old
print "old"
''

or

''Old
print "old"
''end

or

''label: Old
print "old"
''

the compiler, reading the first time (on loading) the sources can add LABELS to a "FLAGGABLE" menu on "program" menu'

this mean that the COMPILER OPTIONS can't be placed on the code and USED immediately.. but the source needs to be RE-LOADED to add the labels...

on top of the SOURCES the developer can add REMARKS for warious compile flags (1 or more)

REM **** COMPILING INSTRUCTIONS: **** (require Munch IDE version)
REM To compile the app for 1024x768 flags the [] 1024
REM To compile the app for 1366x768 flags the [] 1366
REM to compile the app with extra DEBUG points flags the [] Extra Debug
REM To compile the app with NO Window Border on WINDOWS flasg the [] NoBorders


Derron(Posted 2016) [#89]
I do not get what you want to express.


If you want to have custom things happen in your app: use Bruceys BMK and some bmk-files for pre- and after-compilation steps.


bye
Ron


Cocopino(Posted 2016) [#90]

Ah yes I do think you're getting greedy here.



Sorry... I had to try :)
Thanks for your hard work - will try the new version asap.


Fielder(Posted 2016) [#91]
there is an ERROR "TABBING" a selection of 2+ lines

that create a lot of new "TABBED" duplicates


markcw(Posted 2016) [#92]
Also the recognition seems to be dynamic, meaning it picks function names right after I've typed them.

Yes, it does seem to, I thought it was on save. I just dropped my code into parsebmx(). I also improved my parsing code (GetTokenName) which was a bit buggy.

Now, lets have Type fields and methods and it'll be perfect! :)

It already does methods, fields would be nice, probably need globals, consts and locals too right?

wait .. and what about special RELEASE FLAGS? (the same of standard compiler)

Yes, I don't think the IDE handles compiler stuff, that's done in bcc and that's too advanced for me.

there is an ERROR "TABBING" a selection of 2+ lines

This should be fixed, indentcode and outdentcode were broken and also conflicted with tab and shift+tab.

would be if fold-states were saved between sessions so that MaxIDE auto-folds code when reloading

This is working, along with cursor position, it was harder than I thought due to fold levels being difficult to understand. It could probably do with a check to prevent the file list getting too big in fold.txt.


BinaryBurst(Posted 2016) [#93]
Uhm... Don't want to be bothering, but how about a sort of inline assembly? Kinda like this:
local a:int, b:int, c:int

asm(
f: pusha
   mov eax,[a]
   mov ebx,[b]
   add eax,ebx
   mov [c],eax
   popa
   ret
)


What the ide does is create an external file called "asm_functions.s" and write to it this:

;basically copying everything, but adding to every variable name _bb_ in the extern upper part 

   format MS COFF
   extern _bb_a as "a"
   extern _bb_b as "b"
   extern _bb_c as "c"

   section "code" code
   public f as "_f"
f: pusha
   mov eax,[a]
   mov ebx,[b]
   add eax,ebx
   mov [c],eax
   popa
   ret

and add to the blitz original file(on the fly without changing the file while it passes it to the compiler):

import "asm_functions.s"
extern 
   function f:int()="f"
endextern

local a:int, b:int, c:int

asm(
f: pusha
   mov eax,[a]
   mov ebx,[b]
   add eax,ebx
   mov [c],eax
   popa
   ret
)

This should be just for functions and just for this IDE with an option to enable or diasble it or to export the file in the full format XD. Nothing too fancy :)


Fielder(Posted 2016) [#94]
Thank you for fixing the TAB issue :)


Chalky(Posted 2016) [#95]
Many thanks for the "saved folding state" update. I think I might have a go at adding "Fold all", "Fold at definition level" and "Unfold all" menu items - once I have worked out how your folding code works (the concept of maps is new to me so it could take me a while to get my head round it!).

Your updates are a giant leap forward for MaxIDE - thank you.


Henri(Posted 2016) [#96]
Hi,

it seems that output window doesn't autoscroll anymore ?

EDIT: Also when you press tab a few times and the press enter, it autoindents the next line correctly, but if you want to return back up by pressing arrow up key the cursor goes to the beginning of the line instead of straight up.

-Henri


Chalky(Posted 2016) [#97]
@munch: While trying to understand how folding is implemented, I discovered an issue with it when a "Method" is defined without a corresponding "End Method". An example of this can be found in the MaxIDE sourcecode:
Type TEventHandler Extends TTool
	Method OnEvent() Abstract
End Type
If the above is folded, all source following the fold-handle disappears into the fold, whereas changing the above to:
Type TEventHandler Extends TTool
	Method OnEvent()
		Abstract
	End Method
End Type
causes the folding to behave as expected.

At one point (admittedly after a considerable amount of experimental clicking) the fold-handles got completely confused and either displayed as folded even though code wasn't (and vice-versa) or stopped responding to mouse-clicks altogether. The only way I was able to restore them was to manually delete all fold-data for that file within "fold.txt". If I can work out what it was that I did to make this happen I will let you know, but so far I have been unable to replicate the issue.


markcw(Posted 2016) [#98]
Uhm... Don't want to be bothering, but how about a sort of inline assembly? Kinda like this:

Nice idea but I don't want to add new language features and this would be quite hard. I will add syntax highlighting for asm, lua and glsl.

I think I might have a go at adding "Fold all", "Fold at definition level" and "Unfold all" menu items

There is a SCI_FOLDALL command so it just needs a flag in fold.txt. Fold at level would need a requester to enter the level number.

it seems that output window doesn't autoscroll anymore ?

...to return back up by pressing arrow up key the cursor goes to the beginning of the line instead of straight up.

Fixed, just needed to update the cursor ... and cursor x (with SCI_CHOOSECARETX after AutoIndent).

If the above is folded, all source following the fold-handle disappears into the fold, whereas changing the above to:

Fixed, it's actually a limitation of Scintilla's Bmx Lexer, they just ignore Abstract and also Extern Functions, there may be other cases. The fix scans the visible page and disables them with SCI_SETFOLDLEVEL, they reappear briefly on pressing Enter.


Dabhand(Posted 2016) [#99]
I must say, you've done a fantastic job! :)

*Dabz tips hat*

Dabz


Henri(Posted 2016) [#100]
Thanks for the fixes :-)

-Henri


Chalky(Posted 2016) [#101]
Great stuff - many thanks.


Chalky(Posted 2016) [#102]
At one point [snip] the fold-handles got completely confused [snip]. The only way I was able to restore them was to manually delete all fold-data for that file within "fold.txt".

Unfortunately I still haven't been able to work out the sequence of events which causes this, but it has happened again:



The above is what MaxIDE displayed today immediately after reloading a file which had appeared fine when saved yesterday. I am guessing that this is due to an issue with the data in "fold.txt", but as I cannot get my head round how the fold structure/processing works have been unable to investigate/prove this.


BlitzSupport(Posted 2016) [#103]
How are you guys building munch's MaxIDE? It fails to build for me, giving multiple errors in scintilla.bmx under bmx-ng, and although it builds fine in BlitzMax 1.50, it just gives me a blank tab with no edit control!

Anyone able to upload a built version? Does sound pretty cool!


Chalky(Posted 2016) [#104]
You need to download the latest version from munch (see post #56 above). The early zip file was missing scintilla.dll - hence no textarea.


BlitzSupport(Posted 2016) [#105]
Hmm, I've done that, via GitHub Desktop, but I'll try a straight download... weird stuff does seem to happen sometimes with GitHub Desktop-downloaded stuff!


markcw(Posted 2016) [#106]
Re: NG, yes the scintilla module is currently 32-bit only.

Re: cold fold bug, when you edit and the lines change this adds new fold points without removing the old. I may have to code my own fold points as I can only get access to the ones on-screen.


markcw(Posted 2016) [#107]
The above is what MaxIDE displayed today immediately after reloading a file which had appeared fine when saved yesterday.

Try it now, I think I have it working. This has custom code folding as I had too many workarounds using the built-in code folding. Mainly it was disabling extern function/abstract method, and only having access to the fold point state on the visible page.

It now folds only type/method/function/extern. I just made it ignore rem. I had most trouble with parsing but as I couldn't understand Nilium's lexer code I kept going until it worked. I also rewrote the parser to speed it up. I had a look at IDEal which is very nice, then I decided to copy its style and not bother folding select/while/repeat/for.

I also added fold/unfold all menu items, which work even when the code folding option is off.


Fielder(Posted 2016) [#108]
strange thing appens today... i searching for a variable name...

Example.. search for "zrightvariablename"

there is just 1 find in all code...

i replaced it with a PASTE of this string: "rightvariablename"

after that i rebuilded the code.. and i receive the same error before replacement..

Identifier 'zrightvariablename' not found...

i searched again for 'zrightvariablename' ... and i found 1 on the string 'rightvariablename' (what? these strings are different...)

to solve the issue ihave to delete "rightvariablename" and replace it again with "rightvariablename" but this time using KEYBOARD and not PASTE

this appens to me just 1 time.


Chalky(Posted 2016) [#109]
Try it now, I think I have it working.

Looks good to me so far - I will give it a good workout over the next few days. I did notice a teeny drawing bug though, shown here:



It occurs after an "Unfold All" operation, and only happens to nodes which have previously been folded/unfolded manually using the mouse.


Dabhand(Posted 2016) [#110]
Mmmmm, Just to confirm you havent implemented this...

Type TType
	Field blah:Int
EndType

Local newObject:TType = New TType

newObject.blah = 10
Print newObject.blah


Take the above, I declare a new object, jobs a good'un, but, when I start to type "newObject", nothing shows up, as in, if I started typing it, say "ne", I would expect a list as below:-

New
Next
NextFile
newObject

Also, to expand on that (Which is why I used the above example), when "newObject" is typed and I hit the . button, I would probably expect to see a list of members, here, it would only be "blah".

So, alls lovely so far, but, are you planning to implement such a thing?

Dabz


markcw(Posted 2016) [#111]
Looks good to me so far - I will give it a good workout over the next few days. I did notice a teeny drawing bug though, shown here:

I spoke too soon, I forgot about the problems with Enter and cut/paste which creates new fold points. It is fixed when you close and reopen though.

when I start to type "newObject", nothing shows up

No variables have been added to the autocomplete yet but I intend on adding at least fields and maybe globals but probably not locals and consts as I think they could clutter the list. This sounds like you're saying sometimes the list doesn't appear at all.


Dabhand(Posted 2016) [#112]

This sounds like you're saying sometimes the list doesn't appear at all.



No... No... The list does appear, but obviously, as I said, items are missing, which you've just confirmed isnt implemented... I thought it was! :) Me bad ;)


No variables have been added to the autocomplete yet but I intend on adding at least fields and maybe globals but probably not locals and consts as I think they could clutter the list.



I'll not bang on, but anything declared that's in scope should be added, if it's in scope, it's to be used, locals, consts, globals etc etc, which means, by not implementing certain stuff your hiding code away, which isnt a good thing really.

I may sound like I'm whinging, lol, but I'm not, honestly, I'm not... I think your doing a great job, but, like I said, with a system your building, ideally, you should let the system provide all the information available to the programmer... It helps, and if he/she has to go digging for this stuff, even just scrolling to the start of a function to check how a local variable is fully named... Then it does defeat the purpose of it.

Just my 2p, you have permission to tell me to bugger off if you see fit! ;) hehehe

Dabz


markcw(Posted 2016) [#113]
Just my 2p, you have permission to tell me to bugger off if you see fit! ;) hehehe

Thanks, I'll keep that in mind if I get into trouble!

No, I'm happy enough to add this if I can, shouldn't be too hard, I'm just struggling with the code folding stuff at the moment which is holding everything else up. I'm not sure I want a list of data members when I press . I usually type a few letters of the name then select something when it's in clear view. Checking for the . and its type/object name would make the list smarter though.


markcw(Posted 2016) [#114]
@Chalky, time to test! It seems to be working well now, maybe not perfect but I'm quite happy with it. It updates when you click an open fold, or cut/paste or undo/redo or close/open. No other todo features are in yet.


Chalky(Posted 2016) [#115]
Given this a go today - really appreciate your continued work on this.

Unfortunately there is a problem (sorry!) if edits are made between folds - whereby everything after the line edited becomes unfolded when the source is later reloaded. To see this behaviour in action, load the MaxIDE source and do a "Fold All", then delete (the same happens if lines are inserted) line 758 (i.e. the blank line above blank line 759), save and quit. When the source is next loaded, folding is only applied up to line 758 - everything after that remains unfolded.

P.S: I'm not sure if you have tried to fix it, but the drawing mini-bug is still there with the fold handles if a handle has been manually clicked before an "Unfold All".

[edit]
Hmm... Something odd happens with "Fold All" and "Unfold All" once editing described above has taken place. Sometimes they work, other times they don't (including between sessions)...
[/edit]


markcw(Posted 2016) [#116]
Hi Chalky, yes it's not something I would have worked on but since it's a standard feature I thought I should have a go. Didn't realize how tricky it can be though!

The problem was the fold points were lost when you changed the line values with enter/backspace/char or cut/paste or undo/redo. So my fix was to find the lines removed/added and subtract that from any fold point lines below the edit. It seems to work but I expect there will be another bug somewhere! I fixed the fold point>unfold all marker not deleted mini-bug, which also happened with unfold point>fold all.


markcw(Posted 2016) [#117]
Another update, this adds F2 source help for function and type keywords, it won't do methods since it relies on commands.txt to find the source file.

I also tried to modify Brucey's Linux module but it won't work for some reason and I have given up on trying to fix it.

Off to finish autocomplete.


Chalky(Posted 2016) [#118]
Thank you munch.

I discovered something related to syntax highlighting from the blitz basic days (pre-3D) whereby identifiers could be a different colour to other text. It's amazing what a difference if makes to the readability of code - how hard would it be to impliment in MaxIDE?

Also: folding is still badly broken. Often during a session of editing all folds get corrupted - other times they are borked on loading and can only be cured by deleting "fold.txt". Since you've already spent a lot of time working on it, and I seem to be the only person who wants it, I'd be very happy to have a go at fixing it - but would need you to give me a clue on how it currently works (and where in the code I need to look)...


markcw(Posted 2016) [#119]
Thanks Chalky!

I think I've got the code folding saving working now. I realized I missed updating fully on close and was instead trying to update as I went along with partial parses and recalculating line offsets. It still has partial parses but it's only to keep the fold points tidy (full parsing is slow on large files).

I've added the identifiers syntax highlighting color, it was quite simple but I missed it so went through a few dead ends before I found it - I tried to update the version of the dll from 1.79 to 3.50 but that turned out to be hard as Bmx isn't supported by Scintilla just BB, PB and FB. Maybe klepto wrote the Max lexer from the BB one.


Fielder(Posted 2016) [#120]
Just another thing (sorry!!!) the Open dialog... can automatically choice last used folder ? my sources are on a different hard drive and everytime i need to open an old source i need to search the path...

Just this, BTW AWESOME IDE!


markcw(Posted 2016) [#121]
Yes, just go to ide options and check "Open Last Folder" for default behaviour.


Fielder(Posted 2016) [#122]
OPS.. i've not seen the option :p