Jump to content



Photo

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


  • Please log in to reply
17 replies to this topic

#1 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 04 March 2012 - 01:08 AM

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

Plain Text         
---------------------------------------------------------------------------------------------------------------------------------- -- 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

Attached Files


Edited by BugFix, 06 May 2012 - 07:10 PM.

  • qsek likes this
Best Regards BugFixPosted Image





#2 qsek

qsek

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 256 posts

Posted 05 March 2012 - 07:25 PM

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

#3 matwachich

matwachich

    Polymath

  • Active Members
  • PipPipPipPip
  • 215 posts

Posted 05 March 2012 - 08:07 PM

I really really like this tool! But it doesn't work :oops:
Think i did every thing mentionned in the header, but, nothin.

PS: you have a typo here command.shortcut.3z.*.au3=Ctrl+Alt+V

#4 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 05 March 2012 - 08:51 PM

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 BugFixPosted Image

#5 qsek

qsek

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 256 posts

Posted 05 March 2012 - 09:25 PM

works like a charm, thanks. I will use this from now on. :oops:
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

#6 matwachich

matwachich

    Polymath

  • Active Members
  • PipPipPipPip
  • 215 posts

Posted 05 March 2012 - 09:28 PM

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: )

#7 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 08 March 2012 - 07:08 AM

new version:
Added: Refers to created variable in line before with: ";-1 tip for this variable"
see post #1
Best Regards BugFixPosted Image

#8 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 12 March 2012 - 04:33 PM

new version (v0.5)
It can also be variables of the same name used on several occasions (in different functions).
It will always output the variable name and scope
see post #1
Best Regards BugFixPosted Image

#9 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,318 posts

Posted 12 March 2012 - 06:16 PM

BugFix,

Very nice! :oops:

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#10 matwachich

matwachich

    Polymath

  • Active Members
  • PipPipPipPip
  • 215 posts

Posted 13 March 2012 - 11:13 AM

I love this tool!

PS: Chromium told me that "This file appears to be malicious" ! lol

#11 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 17 April 2012 - 06:03 PM

Added: Installer.au3
Easy to install and to configure now.
You can configure a context menu entry too.

see post #1
Best Regards BugFixPosted Image

#12 matwachich

matwachich

    Polymath

  • Active Members
  • PipPipPipPip
  • 215 posts

Posted 18 April 2012 - 09:51 PM

I think there is a small error:
Even if i check the first Checkbox (display in Tip), Vars description are printed in console

I Had to add to SciteUser properties the line Variables.Tip.CallTip.*.au3=1

#13 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 20 April 2012 - 11:22 AM

Thanks for you reply. Was a copy&paste error - lost one char. ;)
Now i'v fixed it.
Best Regards BugFixPosted Image

#14 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 06 May 2012 - 07:05 PM

New version v0.6
Added: Tip for functions, that have created in your script.
Best Regards BugFixPosted Image

#15 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,187 posts

Posted 06 May 2012 - 07:33 PM

Can you make the tip appear on mouse gesture? For example if I shake the cursor over a variable.

eMyvnE


#16 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 06 May 2012 - 08:10 PM

Can you make the tip appear on mouse gesture? For example if I shake the cursor over a variable.

Nice idea - i'll try it.
Best Regards BugFixPosted Image

#17 Venix

Venix

    Adventurer

  • Active Members
  • PipPip
  • 131 posts

Posted 07 May 2012 - 09:17 AM

This could be useful for me, thanks ;).
Posted Image

#18 BugFix

BugFix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 300 posts

Posted 20 October 2012 - 09:13 AM

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 BugFixPosted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users