Thread Tools Display Modes
06-22-11, 01:09 AM   #1
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Interactive Console Autocompletion


I have always debugged using /print commands, and I have wished that I could autocomplete the names of the variables and functions, so I finally got around to writing it. It is a work in progress, but it is functional in its current form.

I created a "mixin" type library to add autocomplete support to the WoW command line.

By autocomplete I mean completion of global identifiers and their fields.

So for example you could say:

chatframe1edi<tab> and it would complete the first proposal and subsequent tabs would cycle through the various completions.

then once you had say: "ChatFrame1EditBox"

you could type:

ChatFrame1EditBox.<tab> and see the available fields. or even ChatFrame1EditBox:<tab> and see the available functions with autocompletion available for both variants.

It still needs some work, but it is usable in its current form.

It uses a fix in the latest version of AceTab, so be sure you have that, I have submitted a patch for AceTab you can use in the meantime. http://www.wowace.com/addons/ace3/ti...atch-handling/

You can download Prat if you want to play around with this stuff, just grab the Prat-3.0_Debug folder from Prat-3.0/pullouts and put it in your addon directory along with Prat and the patched AceTab.

I wrote the source to be reusable so you can add it to any addon (with access to AceTab).

Source is here:

http://hg.wowace.com/wow/prat-3-0/ma...alcomplete.lua

Here's a screencast - keep in mind it is still sorta rough:

http://www.screencast.com/t/gRczrQJo3

To reuse it, just copy the globalcomplete.lua into your addon. If you use the addon table supplied by blizzard then it will mix right in, and you just need to call self:EnableGlobalCompletions(...)
Attached Thumbnails
Click image for larger version

Name:	6-21-2011 3-40-22 AM.jpg
Views:	2848
Size:	149.4 KB
ID:	6281  

Last edited by sylvanaar : 06-22-11 at 01:22 AM.
  Reply With Quote
06-22-11, 02:41 AM   #2
Fredrasaurus
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Jun 2010
Posts: 2
That's awesome!

Thank you!
  Reply With Quote
06-25-11, 01:51 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
A problem I've had with developing SlashHelp is that changing the text in an editbox causes taint and until the editbox is cleared, secure commands can't be run from it. After discovering the default UI has its own tab handling for autocomplete, I left it to that.

I can look into adding in support for Lua code. I'll either have to manually provide a list of commands that support it as an argument or provide an API for third-party addons to register for.

__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
06-27-11, 07:58 AM   #4
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
Originally Posted by SDPhantom View Post
A problem I've had with developing SlashHelp is that changing the text in an editbox causes taint and until the editbox is cleared, secure commands can't be run from it. After discovering the default UI has its own tab handling for autocomplete, I left it to that.

I can look into adding in support for Lua code. I'll either have to manually provide a list of commands that support it as an argument or provide an API for third-party addons to register for.

In the case of Lua code printing you don't care if it is tainted or not usually. Since your are doing (mostly) introspection rather than execution.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » Interactive Console Autocompletion

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off