Pseudo classes and autocomplete

Jan 14, 2012 at 4:29 PM

Hey, I see you've implemented Autocomplete which is really kickass but now the next step I suppose would be to support pseudo functions for the autocomplete for example array's methods Find, Sort, Remove etc, now my idea is to make a pseudo class for the array type which then gets exclusively parsed for the autocompletion data for example:

//==============================================================================
// This is a mirrored c++ class for intellisense purposes.
//==============================================================================

/**
 * A mirrored class of the c++ FArray.
 */
class Array
	native;

/**
 * The length of the array.
 */
var native int Length;


/**
 * Adds a item to the array.
 *
 * @param	item - The item to add.
 */
native final function AddItem( object item );

/**
 * Removes a specified item.
 *
 * @param	item - The item to remove.
 */
native final function RemoveItem( object item );

/**
 * Inserts a item at a specified index.
 *
 * @param	index - The index to insert the item at.
 * @param	count - The item to insert.
 */
native final function InsertItem( int index, object item );

/**
 * Find and returns the found element with a specified value, if nothing is found it will return -1.
 *
 * @param	value - The value to look for.
 *
 * @return	The found index or -1 if value wasn't found.
 */
native final function int Find( object  value );

/**
 * Find and returns the found element with a specified value, if nothing is found it will return -1.
 *
 * @param	propertyName - The property name of within a struct to test against.
 * @param	value - The value to look for.
 *
 * @return	The found index or -1 if value wasn't found.
 */
native final function int Find( name propertyName, object  value );

/**
 * Sorts the array.
 *
 * @param	sortDelegate - The method to use for sorting.
 */
native final function Sort( delegate sortDelegate );

The same could be done for class contexts for example:
/**
 * Access a static function from this class instance.
 */
var const native Specifier 	Static;

/**
 * Access a default variable from this class instance.
 */
var const native Specifier 	Default;

/**
 * Access a constant from this class instance.
 */
var const native Specifier Const;
Of course you could just hardcode it all in but that kills the advantage of customization/different engine/game versions

Coordinator
Jan 14, 2012 at 7:51 PM

Ideally if you have classes like "Array" I can inject them into parsing process and it(Autocomplete) will work.  So your Idea is brilliant, Unfortunately I do not know all "pseudo" class functions.

Coordinator
Jan 14, 2012 at 7:52 PM

and I already fixing some issues with auto-complete, so next update will bring fully working Auto-complete(in all cases)

Coordinator
Mar 17, 2012 at 8:56 PM

this is released in 0.0.26

Mar 17, 2012 at 9:23 PM

So did you use this concept?

Coordinator
Mar 17, 2012 at 9:37 PM

Yes, I am using your file to achieve it,  Thank you for your help.  I am just thinking if we need to do the same thing for delegates and classes.

Mar 17, 2012 at 9:43 PM

Awesome! I've made one for classes as well but I didn't put it here.

 

//==============================================================================
// This is a mirrored c++ class for intellisense purposes.
//==============================================================================

/**
 * A mirrored class of c++ UClass.
 */
class Class
	native;

/**
 * Access a static function from this class instance.
 */
var const native Specifier 	Static;

/**
 * Access a default variable from this class instance.
 */
var const native Specifier 	Default;

/**
 * Access a constant from this class instance.
 */
var const native Specifier 	Const;

/**
 * Access a object from this class instance.
 */
var const native Object 	Self;

/**
 * Access a function from this class parent's instance.
 */
var const native Specifier 	Super;


Also want to let you know that I made my own UnrealScript IDE back in 2010 which I never released. This IDE used this method, also had Templates project solutions and its 100% handwritten UnrealScript parser.
But I've canceled the program, so I'll just give you those.
 

Coordinator
Mar 18, 2012 at 8:53 AM

Thank you Eliot.