Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

IntelliSense III


  • Please log in to reply
77 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
IntelliSense III
(I've re-used the old thread instead of starting a new one, so the initial posts are in response to Intellisense II)

Features:
While you start typing a command, it displays the full command name, and if you press Tab then it completes the command with proper case and displays its parameter help. And if you continue to keep typing and don't press Tab, it still displays the command parameter help when you press comma or space just after the command name.

Posted Image

Posted Image


Though its ready to be run as-is, you can edit the topmost (configuration) section of script to your needs, then just start typing ahk commands in your editor.
Escape and Enter clear the tooltip and the seeking starts afresh.

It'll be useful for newbies... but experienced users who often load up the help just to look up the cmd syntax (I do) will also benefit.

Download


Here's a part of a script that you can edit to support your favourite editor and put in a Timer of your all time running script, so that you don't have to remember to run IntelliSense whenever you start ahk scripting. (Requires 'DetectHiddenWindows, On')
;launches/closes IntelliSense
WinGetTitle, ATitle, A
IfInString, ATitle, PSPad - [
IfInString, ATitle, .ahk
IfWinNotExist, IntelliSense.ahk - AutoHotkey
{
	Run, E:\dos\batch\IntelliSense.ahk
	;Run, E:\dos\batch\IntelliType.ahk
	WinGet, SWID, ID, %ATitle%
}

IfWinNotExist, ahk_id %SWID%
IfWinExist, IntelliSense.ahk - AutoHotkey
{
	WinClose, IntelliSense.ahk - AutoHotkey
	WinClose, IntelliType.ahk - AutoHotkey
}

Old versions:
IntelliSense I (obsolete) tracked a command while it was typed and offered to type a match with all its default parameters for u.

IntelliSense II showed the complete syntax applicable to the command you've just typed. AHK's default installation carries this script in its Extras folder and also in its Script Showcase.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
Thanks, that's very helpful. I also find myself having to search through the help guide to check each commands syntax.

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
Wow. Thanks. This is very similar to what AHK Editor does, but more often than not I'm using my familiar EditPad, and need to be reminded of a particular parameter's position. Thanks for sharing this! :wink:

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004

that does what other 'Intellisense-Included' code editors do.... it just shows the complete syntax applicable to the command you've just typed.

Note to self: RTFM. :oops:

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Another great script, Rajat. Since its usefulness is on par with your context-sensitive help script, I will put it in the showcase and reference it in the FAQ. If you want to make any revisions or add more of a description at the top, feel free to do so and mail me the new version. Otherwise, I'll just use the version posted above.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
thanx for the positive response guyz!

Chris, if there's something else that would improve the functioning which you or somebody else suggests, then i can add it... otherwise i think that the script's okay as it is.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
and btw i'm thinking about replacing the cmd autocomplete script that accompanies textpad syntax installation script, with this one... what say?

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Although I don't use TextPad or auto-complete currently (though I will probably start using the new one you posted above), I imagine it would be an improvement for most TextPad users.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've made some changes:
-The tooltip shows below now instead of at top, this is to take care of help for commands that take more than one line (like loops)
-Now the directives which don't have any parameters also show help, which is to show that they in fact don't accept any parameters.
-Multiline commands don't show messed up now.
-A bug in the code fixed that prevented correct help to be shown for commands like 'WinGetPos'

Note: As the matching is done with the first word of every command, the loops all show the same help.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
@ Rajat
Quick one: would it make sense to include the download link within your signature (maybe create a hotkey for that task to include such a link while you post your statement/reply) ?!

JM2C & thx.

:wink:

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
I've added a feature that i think completes the script. After you see the syntax help, if you need details on that cmd then press Ctrl+F1 to show ahk help on that cmd. Sort of like context-sensitive help but this works even when you're writing any of the parameters of the cmd and doesn't require your cursor to be in the cmd word.

by the way i use this code in my 24/7 script in a timer that's always running:
;launches/closes IntelliSense
WinGetActiveTitle, ATitle
IfInString, ATitle, TextPad - [
        IfWinNotExist, IntelliSense.ahk - AutoHotkey
                Run, E:\batch\IntelliSense.ahk

IfWinNotExist, TextPad - [
        IfWinExist, IntelliSense.ahk - AutoHotkey
                WinClose, IntelliSense.ahk - AutoHotkey

so now i don't need to remember to run the script every time i get to coding. requires 'SetTitleMatchMode, 2' and 'DetectHiddenWindows, On
'.

I hope Chris didn't start to work on 'embellishing' the script for posting in the showcase... otherwise i have just made his work difficult.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Quick one: would it make sense to include the download link within your signature (maybe create a hotkey for that task to include such a link while you post your statement/reply) ?!

I'm afraid i didn't fully understand it... please explain a little....

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


BoBo
  • Guests
  • Last active:
  • Joined: --
Instead of: There's always just one more bug. (which is currently part of your forum signature) use a download link the the program/script/update you announce at that post ...

Maybe the idea is stupid and not just the way I descripe it :shock:

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

Instead of: There's always just one more bug. (which is currently part of your forum signature) use a download link the the program/script/update you announce at that post ...

as i see it, there's just one thing i'm offering for download... sgui, and there's a separate link for it. well ofcourse i'm not counting the .ico files for the aquarium or other misc stuff..

and i'm changing my sign too... i can see it gettin' stale.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I hope Chris didn't start to work on 'embellishing' the script for posting in the showcase... otherwise i have just made his work difficult.

Not yet, and even if I had it's not too hard to add things, especially nice things like the context sensitive help. Thanks.