Brainstorm: Script Editor

This forum is a working group for community contributors to the LiveCode IDE included in the main LiveCode distribution.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Brainstorm: Script Editor

Postby Mikey » Mon Jun 09, 2014 1:34 am

I'm just going to go out on a limb and call this a Project right up front.

Here is a list of things that I have on my to-do list once we get green-lighted to fix things:
  • Nested comment blocks - /* /* blah blah */ something */ renders like the entire block is commented out, but it doesn't behave that way. The behavior is not documented, and IMHO nested comments should be supported FULLY so that if I have a piece of code commented out and later I want to comment out a larger piece that encloses it, I'm not left with a pile of statements at the bottom that now orphans and active.
  • navigate back and forward through the path that I’ve followed when I do a Goto Definition
  • undo/redo changes
  • bookmarks
  • Code Folding
  • show/hide lines for debugging
  • List of where something appears like in the find/replace for the main project for easier navigation between them while in the script.
  • Hilight all instances found in a script instead of one at a time
  • Should be able to follow private commands when editing scripts (right click, goto definition)
  • Comments should not be bold, IMHO, EVER - at least should have an option
  • Hide Comments
  • Revert, versions (like GLX2 - actually, while I'm thinking about it, I've mentioned several GLX2 things, so let's make it part of the script editor)
  • It would be neat if I could see changes…
  • XREF - list of all vars, objects, handlers, commands, functions, etc. and where and how used.
  • When do a find, and the script editor opens, the find text should show up in the find box.
  • when do a find, either exclude comments or only search in comments (advanced) - so commented-out commands don’t show.
  • Macros, especially for inserting blocks
  • Multiple columns b/c monitors are wider, now
  • Split script editor horizontally
  • Move tabs around
  • When debugging, option to put variables/containers in a separate window
  • Preferences for syntax colorization
  • Hide $ variables when debugging
  • Option to disable antialiasing
Last edited by Mikey on Mon Jun 09, 2014 1:40 am, edited 1 time in total.
Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 484
Joined: Fri Jun 27, 2008 9:00 pm

Re: Project: Script Editor

Postby FourthWorld » Mon Jun 09, 2014 1:36 am

Sounds like an ambitious project. Who is the team leader, and who are the other team members needed to make this happen?

Can the summary outline be given more specifics so that they can become actionable?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5087
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Project: Script Editor

Postby mwieder » Fri Jul 11, 2014 6:49 am

Urk! I thought I had updated GLX2 a long time ago.
I just posted another update to the website, so glx2 3.0.16 is now available.
My apologies for waiting so long, and feel free to use it as a starting point for more editors, or grab whatever pieces are useful.
Or, of course, just do what I do and use it as your default editor.

https://bitbucket.org/mwieder/glx2/downloads
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby FourthWorld » Fri Jul 11, 2014 9:15 pm

I've taken the liberty of changing the thread title from "Project" to "Brainstorm" to better reflect it's status. While it's an interesting wish list of features, the proposed scope of work does not currently have a project owner, a team, or a work plan.

Hopefully those details can be resolved in the future, perhaps by identifying a subset of tasks that may be more easily actionable. I'll happily restore the "Project" designation once it reaches an in-process stage.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5087
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Brainstorm: Script Editor

Postby Mikey » Mon Jul 14, 2014 4:15 pm

That's fine. I'm actively working on this, but since I seem to be the only one, I don't really care what we call it, and my other [FIX] hasn't even gotten a reply, yet.

Making it more formal with plans, and outlines, and org charts doesn't seem to be useful in this context. I was hoping that more folks would be interested and come forward, but that hasn't happened, unless Mark decides to take everything he's learned about GLX2 and push it over the wall, since some of what I want to do in the script editor are things that Jerry and Mark did in GLX2
Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 484
Joined: Fri Jun 27, 2008 9:00 pm

Re: Brainstorm: Script Editor

Postby mwieder » Tue Jul 15, 2014 3:59 am

Mike-

What kind of stuff are you looking for? glx2 is all open source - dig in and grab what's useful to you.
And if you want to take over maintaining the code, please do. I don't have much interest in writing Another Script Editor - I'd be more inclined to poke around in the source to see how to hook in external editors. I've been maintaining glx2 because it does what I want it to do, and somebody's gotta keep refactoring the code, but writing script editors isn't really my thing.
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby Mikey » Tue Jul 15, 2014 4:36 am

Mark,

See the list, above. What I want is to stop screaming at the script editor, so I have a running list of things I think would make that easier.

I've been (carefully) working on the script editor while I wait for some guidance from Edinburgh, but the thought of merging the best of GLX2 and the LC script editor is intriguing.
Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 484
Joined: Fri Jun 27, 2008 9:00 pm

Re: Brainstorm: Script Editor

Postby mwieder » Wed Nov 04, 2015 7:02 am

So here's something I just pulled into glx2... for a long time I've been trying to ignore the comments on the use-list about the "pirate red dots" for temporary breakpoints. The problem is that breakpoints are stored and used by the engine as as a tuple of

Code: Select all
long id of object, line number


so if you edit a script and push lines of code down, the line numbers stored in the breakpoints no longer match up. Thus you get breakpoints that happen at weird times and what you see on the screen doesn't necessarily match what the code is doing.

So I thought about this a bit more and realized that the time to sync things up again is when the script is compiled. On compiling the script I get rid of the real engine breakpoints for the object whose script is being edited

Code: Select all
put the breakpoints into tBreaks
filter tBreaks without tLongIdOfObject & "*"
set the breakpoints to tBreaks


Then I go through the text in the script editor and every time I hit one of the red dots I set a breakpoint for that line number. The repeat loop is pretty fast. And that way when you compile the script there are no more pirate red dots - they all correspond to the line of code they should.

Now... I have no idea how to shoehorn this into the IDE's script editor. From looking at the code briefly, it looks like it's trying to adjust the breakpoints every time someone moves a line of code. To me that seems slow, inefficient, and error-prone. Also, the script editor has a concept of active vs inactive breakpoints, which complicates the matter a bit.

But I'm throwing the idea out there as a suggestion of a way to move forward on this.
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby LCMark » Wed Nov 04, 2015 9:37 am

Just a comment about nested block comments - they have never nested - it was an error in the colorizer for the script editor which made people think they did and this was fixed in 6.7.4 / 7.0.4 (http://quality.runrev.com/show_bug.cgi?id=8924).

There is no way to go from having non-nested block comments to nested block comments with the same tokens (i.e. /* ... */) without breaking existing scripts (the two forms are entirely incompatible) - this ship sailed a long time ago.
LCMark
Livecode Staff Member
Livecode Staff Member
 
Posts: 917
Joined: Thu Apr 11, 2013 11:27 am

Re: Brainstorm: Script Editor

Postby mwieder » Wed Nov 04, 2015 6:01 pm

Interesting. I hadn't thought much about nested block comments, and it isn't a form I've tried to use in LiveCode, but wouldn't reference counting solve that problem?
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby LCMark » Wed Nov 04, 2015 7:25 pm

@mwieder: There is no problem with implementing nested block comments - that is (relatively) straightforward. The problem is that you cannot change from non-nested block comments to nested block comments without breaking scripts. They are entirely incompatible. (Indeed, one of the bug reports about this in the DB has some code from Trevor which demonstrates this). i.e. There is no way to go from non-nested to nested without requiring people to potentially have to change their code. Also, C-style block comments (/* ... */) do no nest in any language so it would be 'surprising' for anyone coming to LiveCode if they did.
LCMark
Livecode Staff Member
Livecode Staff Member
 
Posts: 917
Joined: Thu Apr 11, 2013 11:27 am

Re: Brainstorm: Script Editor

Postby mwieder » Wed Nov 04, 2015 7:59 pm

OK - good points. Regarding nesting block comments in other languages, though, I seem to recall a preference setting in one of the C compilers (Metrowerks?) that would allow this. However, K&R does explicitly specify that comments don't nest. (Not that I'm suggesting that LiveCode should be following K&R as a standard)
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby LCMark » Fri Nov 06, 2015 9:24 am

@mwieder: I noticed a reference in a stackoverflow post about C-style block comments which mentioned some C compilers a long time ago would give an option - of course this was entirely non-standard then, and is today. One option we do have is to add another comment form which does nest - for example Pascal uses (* ... *) and { ... }. The former is certainly a potential option - it depends on how many flavours of comment we need (we currently have - '--', '#', '//' and '/* ... */') and whether it would be too onerous to expect retooling of anything which processes LiveCode scripts (this isn't just a change in syntax, it is a change in lexical structure which means any script processing tools would need to be aware and updated for the change).
LCMark
Livecode Staff Member
Livecode Staff Member
 
Posts: 917
Joined: Thu Apr 11, 2013 11:27 am

Re: Brainstorm: Script Editor

Postby mwieder » Fri Nov 06, 2015 7:01 pm

Mark- I realize that Mikey put nesting comments at the top of his to-do list, but I'm not convinced we need yet another form of commenting. In C code I just throw "#if 0" constructs in the code and they do the trick nicely. And they nest. I believe Jacque just comments the declaration line of a handler and that renders the whole handler inactive.
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2515
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Brainstorm: Script Editor

Postby Mikey » Fri Nov 06, 2015 8:09 pm

The list is not in any particular order of priority. It's just a list of things I would like to have. I don't think another FORM of comment is necessary, and in fact, I think it's a bad idea, but for block comments, of which we currently only have one structure, the inability to nest them is frustrating, especially when debugging. The parser, instead of using a boolean, can use an integer to determine where it's at as it walks a script. If the comment level is 0 it's in executable code, and if it's greater than zero, then it's in a comment.
Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 484
Joined: Fri Jun 27, 2008 9:00 pm

Next

Return to IDE Contributors

Who is online

Users browsing this forum: No registered users and 2 guests