About Monkey 2 › Forums › Monkey 2 Projects › Ted2Go IDE
This topic contains 596 replies, has 46 voices, and was last updated by nerobot 3 months ago.
-
AuthorPosts
-
October 3, 2016 at 6:57 am #4232
Hi to all.
Let me introduce new improved version.
It based on latest official ted2 sources (1.0.7).
See screenshots below.
What do we have now:
- improved parser
– it can extract variable type from expressions like this:
Monkey1Local img := Image.Load(...) 'so img is Image type– parse lambdas, enums, method’s params
– parse ‘native’ types like @String
- improved autocompletion
– it checks current scope and access mode (public/private)
– added icons and sorting
- improved codetree
– it shows types and params
– added icons
—————–
As in previous version – parser do re-parse on load and on save document.
So if you type variable and don’t see autocompletion – just save the file and try again.
Parser is ‘in progress’, it can parse not all cases. You can notify me here about ‘problem places’.
And problems with autocompletion too.
—————–
If you don’t try Ted2Go yet – do it right now!
And maybe donate me if it’s useful for you.
Sources on github | Compiled windows version (dropbox) | Donate
Have a nice coding!
Attachments:
October 3, 2016 at 9:57 am #4238Great, looking good.
October 7, 2016 at 8:19 am #4306Just commited new release!
- Parser work with Extends and Implements, so you can see inherited members in autocompletion;
- Improved scope checking for autocompletion:
- show all members inside it’s own classes,
- show protected members inside derived classes,
- show public for other cases,
- inheritance checking is recursive, so show members for multiple inheritance. probably, only public for this time.
October 9, 2016 at 6:35 am #4361Some improvements are here.
- Icons – new icons for CodeTree and Autocompletion, almost all taken from Netbeans IDE (see attached screenshot). Also icons reflect member’s access modifiers now.
- Parser:
- added support for ‘Alias’;
- added simple checking for case: “b := ok ? xx else yy” and “b := Not …”;
- improved checking of numbers (now checks minus sign);
- fixed type extraction for ‘operator’.
- Autocompletion – now it shows aliases and generic types members. It’s very simple variant – strip generic type, so not replace generic type with user’s declared type. But to see geteric type <T>,<V> is better than to see nothing.
Icons mapping to members is in attach too.
Monkey1234Notes:field_static => Globalmethod_static => FunctionAttachments:
October 9, 2016 at 10:19 am #4365October 9, 2016 at 2:30 pm #4366Implemented the latest sources from original repository – v1.0.8.
It brings us themes support and zoom in/out for whole UI.
October 10, 2016 at 6:52 am #4383@everyone
Question about “Check for errors” action. I did it this way:
- Find “Compiling…” in console
- Print “Done.” and call console.Terminate()
Is it good solution?
@adamstrange uses “checkapp” parameter for mx2cc. It looks like a better solution.
Hm?
October 10, 2016 at 11:16 am #4385My TODO is here: https://trello.com/c/aFUo5SgH/1-new-version
October 10, 2016 at 3:18 pm #4387the mx2cc is clearly a better solution because when compiling starts it starts to write things on disk and that’s bad.
Tested your fork:
It would be nice if the Classes/Methods/Fields/Vars in the left column where sorted in some kind. Here I have some mixed Methods and Fields withing my class.
And sorted by alpha or with the same order than in the File.I’m looking forward to see code folding and full pass indent. Hope it’s in your plan.
nice work!
October 10, 2016 at 6:15 pm #4394mx2cc has actually had a ‘-semant’ option for a few versions now, in fact it now has -parse, -semant, -translate, -build and -run. Specifying any of these automatically include the previous ones, eg: -semant means -parse, -semant, while -run includes all of ’em.
Probably easier easiest if I add this myself as it’s in the middle of the/my buildactions file.
October 11, 2016 at 2:13 am #4395October 11, 2016 at 6:16 am #4398By full pass indent I mean an auto intend button that indents all your file: clearing all spaces and tabs at the beginning of each line then intend by fold+if/elseif/case…
The ifs are probably a bit difficult because it needs some analysis to know wether it’s a one line or not.I’ve had some problems with the text cursor. Sometimes it desapears completely after coming back to ted.
I personaly prefer when the cursor doesn’t “flash” (for a more zen workspace.)October 11, 2016 at 6:30 am #4399Thanks for description.
Hm, I’ll try do it, but a bit later. Yes, ‘If’ keyword is not simple.
To fix cursor, go to [ted2go]/views/textviewext.monkey2 and comment 2 lines inside TextViewExt.New() method like this:
Monkey123456789Method New()Super.New()CursorColor=New Color( 1,1,1, 0.6 )SelectionColor=New Color( .4,.4,.4 )'CursorBlinkRate = 2.5'BlockCursor = FalseEndAnd you got default ted2 cursor.
Further, there will be Preferences dialog, allowed to simple change IDE params.
October 11, 2016 at 11:30 am #4402October 16, 2016 at 3:45 pm #4451In new (current) version:
- Try to add error checking “on the fly”, do background parsing after 3 secs from latest code changes. Modified file saved to ‘ted2go/tmp/tmp’ file and parsing via mx2cc.
- Added errors hints – mouse over on line with error shows us error message. And errors now marked with curved underline (see sreenshot).
My logic for background parsing is (pseudocode):
- Add callback to TextChanged signal (TextChanges += OnTextChanged)
- Inside of OnTextChanged attaching to App.Idle signal (App.Idle += OnParseBg)
- Inside of OnParseBg checking time – are we ready to parse, 3 secs is over.
- if YES – do parsing and reset changed time (DoParse)
- if NO – re-attaching to App.Idle
- Inside of DoParse create new Fiber and read mx2cc output inside of it
- Goto 1, so wait other textchanged event.
I tried to use Timer with 1 hz interval, but timer stops to work after some time, so I decide to use App.Idle.
What is not good – saving to tmp file, need to improve.
Attachments:
-
AuthorPosts
You must be logged in to reply to this topic.