Jump to content

SciTE - tips for variables and funtions, get them everywhere in script


BugFix
 Share

Recommended Posts

Hi,

if you have large scripts, it is often usefull to make a description for some variables ( i.e. you have an array and make comments for types of data in rows and columns ).

But if you need this information, you must scroll back to this comment and read it.

Now i've made a script, that searchs this comment for the current variable (on which the cursor is) and write this to console output.

Edit 2012-03-04: Now you can show it also as CallTip. Switch between calltip or console output by settings in properties (see instructions in header)

current version: v0.2

Edit 2012-03-05: Added: Multiline Tips with "n" as line break

current version: v0.3

Edit 2012-03-08: Added: Refers to created variable in line before with:

Local $GuiMain = GuiCreate(...)
;-1 tip for variable "$GuiMain"

current version: v0.4

Edit 2012-03-12: Script now totally rebuild.

It can also be variables of the same name used on several occasions (in different functions). The creation of the tips have to be done within the same range of validity (in the same function or global). The script is looking for tips for the current variable in the current scope.

It will always output the variable name and scope

$VarBefore [ Global ]

This is the tip for $VarBefore

or

$iSelf [ Local: Func _Testfunc() ]

This is the tip for $iSelf

Now it is also possible to use all kinds of tip creation (tip in [multiple] region, tip with "at", tip with "-1") at the same time. Because that, the properties entrie "Variables.Tip.Region.*.au3" is needless.

current version: v0.5

Edit 2012-04-17:

Added: Installer.au3

- all required changes in SciTEUser.properties made by installer

- detects automatically free command number

- GUI to configure settings

- you can add an entry to context menu too

Put both files (VarGetTip.lua and Install_VarGetTip.au3) together in an directory, than run au3-script.

Edit 2012-04-20:

There was a little bug in the installer.au3. So it hasn't take effect to check "show tip as call tip".

Fixed.

Edit 2012-05-06: NEW

Now you can also use tip for functions, that you've created inside your script.

Use it so:

Func _SomeFunc()
    ;-f Tip for this functionnSecond line of this tip

current version: v0.6

----------------------------------------------------------------------------------------------------------------------------------
-- VarGetTip
--    For variables in a separate area of the script deposited tips:
--        #region - Variables-Tip
--        ; $Variable1 This is the tip for variable 1
--        ; $Variable2 This is the tip for variable 2
--        ; $Variable3 This is the tip for variable 3
--        #endregion
--    or they are in a comment line with a tag (the "at" sign) somewhere in the script created:
--        ;@ $Variable1 This is the tip for variable 1
--    or direct after creation of a variable in the next line with '-1' refers to this:
--        $Variable
--        ;-1 here my tip for $Variable
--
--    or tip for functions:
--        In following line after function-headline write your tip:
--           Func _SomeFunc()
--               ;-f Tip for this functionnSecond line of this tip
--        Output:
--           _SomeFunc( )
--           Tip for this function
--           Second line of this tip
--
--    It can also be variables of the same name used on several occasions (in different functions).
--    The creation of the tips have to be done within the same range of validity (in the same function or global).
--    The script is looking for tips for the current variable in the current scope.
--    It will always output the variable name and scope (if tip exists)
--        $VarBefore  [ Global ]
--        This is the tip for $VarBefore
--    or
--        $iSelf  [ Local: Func _Testfunc() ]
--        This is the tip for $iSelf
--
--    You can create multiline tips by using "n" to mark the line break
--    i.e.
--        ;@ $VariableXY comment1ncomment2ncomment3
--    output:
--        $VariableXY
--        comment1
--        comment2
--        comment3
--
--    Save the script as "..SciTELUAVarGetTip.lua"
--
--    In "SciTEUser.properties" will create a hotkey to invoke the function
--        command.name.37.*.au3=Variables Tip
--        command.37.*.au3=dofile $(SciteDefaultHome)/Lua/VarGetTip.lua
--        command.mode.37.*.au3=subsystem:lua,savebefore:no
--        command.shortcut.37.*.au3=Ctrl+Alt+V
--
--    In addition, create a properties value that determines whether output to console or Calltip
--        Variables.Tip.CallTip.*.au3=1       (1=as CallTip, 0=output to console)
--
--    Usage
--    - Place the cursor on the variable/function-call (or touching them)
--    - Call the Hotkey
--    - If existing a tip, it will shown as calltip or written to console
----------------------------------------------------------------------------------------------------------------------------------

DL before: 54

Install_VarGetTip.au3

VarGetTip_0.6.zip

Edited by BugFix

Best Regards BugFix  

Link to comment
Share on other sites

nice idea!

Is it possible to display a multiline description?

maybe with the \n symbol or add lines with the same variable together in the calltip?

Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Link to comment
Share on other sites

I really really like this tool! But it doesn't work Posted Image

By editing the header in v0.2 I've overwritten the install description, sorry. You must save the file as "..SciTELUAVarGetTip.lua". Than it should work.

Now I've posted the version v0.3 with multiline tips.

Best Regards BugFix  

Link to comment
Share on other sites

Yeah! i know that i should save it with modified file name! But i don't know why, it doesn't work

Also, i must say that my installation of SciTE is really scrappy, should save my calltips, and reinstall a fresh SciTE

Thanks for that tool, gonna see it tomorow (after my exam! :oops: )

Link to comment
Share on other sites

  • Moderators

BugFix,

Very nice! :oops:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 5 months later...

A short reply:

I've tried to use mouse gestures. But it is not stable to use. I can get mouse position only as combination column-row, not with pixel. So it is not easy to match the current variable and additional a predefined movement.

At the moment its faster to use context menu instead of this. But I'll see, if i can use functions from other libraries to reach it. Will post it here, if successful.

Best Regards BugFix  

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...