The world editor is written in Lua with few basic operations coded in C++ and exposed as tables to Lua.
It resides in the /lua/ge/extensions/editor folder, as a table named editor. The core Lua files for various editor sections are located in that root folder.
The various editor tools (their GUI code and logic), are basically extensions located in the /lua/ge/extensions/editor/extensions, so if you want to add a new tool for the editor, you can create a file in that folder following the test.lua as a starting template.
The core editor API resides in the editor table, so to use the function one would call editor.someFunction(…..)