SRL Archive - Commits

Functionlist


mastaraymond

2009-12-26 11:00:10

Bullz and I implemented the Functionlist. It uses my old script analyzer to parse methods/vars from scripts. This might not be perfect, but I think it's a perfect solution until Niels has time to finish his one (which is gathers a lot more information).

Currently the functionlist only displays Methods (functions/procedures). I can add Vars/Const/Params to it, but I'm not quite sure howto do it..
Maybe like:
-Method
– Params
— Param1 : type
— Param2 : type
– Vars
— LocalVar1 : type
— Localvar2 : type
And then for the globals something like
-Script
–Consts
—Const1 = Value
—Const2 = value
–Vars
—Var1 : Type
—Var2 : Type

Back to my post ->

Right now the functionlist has several functions:
  • It serves as functionlist (lol), stores all the methods in a nice tree.
  • You can search the tree, when you type it will create a 'new' temporary tree with the filtered results. When not found it will make the searchbox red.
  • You can drag a method into the editor, where it will be pasted.
  • It serves as Code-completion (ctrl + space) -> Press ctr + space; find the method you want to insert and then press Space, Comma, Dot, BracketOpen or BracketClose to insert it.
  • Thanks to bullzeye the functionlist is also completely dock-able. Click somewhere on a non-node in the tree and drag it out of tha mainscript!
  • Parses your script and displays it's methods under the Script-node (Note: This only gets updated when you actively do something with the functionlist)
  • Shows the full declaration of the currently selected method in the status bar (see picture below).

Oh I'm looking for this thing that scar has, a nice border with the name "Function list" on it, and that close button.. It would make the dragging way easier, since now you have to collapse the tree before you can freely drag it..


One final note: The code is quite unorganized and messy. I will clean it up later when I've got some time; for now I'm happy it kinda works.

And there might be a shitload of bugs in this thing (on linux); Just report them please :)

nielsie95

2009-12-26 12:01:54

From: mastaraymond

Oh I'm looking for this thing that scar has, a nice border with the name "Function list" on it, and that close button.. It would make the dragging way easier, since now you have to collapse the tree before you can freely drag it..


You could try to put the TreeView in a GroupBox and make the Box dockable instead of the Tree?

Also, I like the information (vars, params) the way you suggested :)

Cazax

2009-12-29 17:56:10

Make it so when you double click a function it'll automatically write it and open parenthesis:

Nava2

2009-12-29 18:18:36

You know you can drag them in?

Sir R. M8gic1an

2009-12-30 07:56:20

From: Nava2
You know you can drag them in?


Clicking is cool and easier :p

~RM