WIP - ofxLuaAutoComplete

howdy all,

ive been using ofxLua lately, love it. if you dont know it, its by @danomatika - i love lua, its a great language and really easy to read etc etc.
but one thing is that some syntax is different. main difference is that instead of say ofCircle in oF, it would be of.circle in lua. so i have been slightly busy trying to make an auto-complete sheet to hopefully help people using ofxLua, but you are using say sublime text for inputting the text.

its not finished at all, but its just more of a start. its is also pretty hacky and more than likely can be done better :wink:
you can grab it from my github account here
https://github.com/lewislepton/ofxLuaAutoComplete

again, if you know of a better way to get auto-complete this way, then by all means that would be cool :wink:

happy coding

You can print all names in the “of” wrapper module to the console by running:

lua.pushTable("of");
lua.printTable();
lua.popTable();

thanks for that. ill have a good look

though was just now thinking of a better way. such as if i could read the openFrameworks directory folder, find the ones which all start with ‘ofSomething’ and make a script that could make a ‘.’ then make sure the first letter ended up lowercase. its just locating the folder is my problem.
i guess in a way that ofxLua works right now, but has the auto-complete feature

ill press on. thanks

Try this lua code. It will print the “of” module table names recursively:

function printTable(o,h)
	if type(o) == "table" then
		local s = ""
		for k,v in pairs(o) do
			if type(v) == 'table' then
				s = s..printTable(v,h.."."..k)
			elseif h ~= nil then
				s = s..h.."."..k.."\n"
			else
				s = s..k.."\n"
			end
		end
		return s
	else
		return tostring(o)
	end
end

print(printTable(of, "of"))

Gives me (snippet):

of.getStyle
of.CLOSE
of.dist
of.bufferFromFile
of.getViewportWidth
of.FilePath_addLeadingSlash
of.FULLSCREEN
of.setStyle
of.ALIGN_VERT_CENTER
of.drawPlane
of.TARGET_ANDROID
of.CONSOLE_COLOR_PURPLE
of.getHours
of.PIXELS_RGB565
of.LIGHT_DIRECTIONAL
of.OUTLINE
of.getWeekday
of.FloatColor_fromHex
of.CONSOLE_COLOR_RESTORE
of.getUsingArbTex
of.TARGET_WINGCC
of.BLENDMODE_SUBTRACT
of.BLENDMODE_ALPHA
of.IMAGE_FORMAT_PBM
of.IMAGE_FORMAT_PCX
of.Shader_COLOR_ATTRIBUTE
of.IMAGE_FORMAT_JNG
of.I2C
of.ARD_OFF
of.FIRMATA_END_SYSEX
of.rotateZ
...

oooh, fantastic. thank you