In my day job I write code in Visual Studio, typically C# for Unity games (screenshots are from an old personal C++ project though). Outside of my day job, time/energy permitting, I write Lua code for my Defold game in the built in code editor. There are a few features from VS/Unity that I sorely miss as they dramatically cut down on wasted time and mental energy. These are in no particular order because I use every one of these features dozens of times every day and get frustrated every time I can’t use them in Defold. Some of these are at least partially available when debugging in Defold but would be just as useful when editing.
-
Function list. At the top of any file is a dropdown list of every function in that file, clicking one takes you to it. This dramatically reduces the amount of reading and scrolling needed to navigate large files and reduces wasted time spent moving around in the code trying to find that thing you were looking for to help with that other thing you’ve already forgotten because it took so much time and mental effort just to get where you needed to be. VS lists them alphabetically, sometimes I wish they were in order of definition, or visibility (e.g. all global/public functions first then all local functions).
-
Detailed scrollbar overlays . VS provides a lot of super useful information on it’s scrollbars, I’m sure there are others but in these screenshots alone I can see areas of the code I’ve edited since VS has been open (green is saved changes, yellow is unsaved); where breakpoints are (dark red); where errors are (bright red); where the cursor is (white line); which section of code is on screen (darkened box). Highlighting the sections of code I’ve edited is critical; almost every feature or fix involves jumping around between a handful of functions across several large files and the scrollbar overlays make navigating between just those arbitrary sections effortless. I miss this more and more as my Defold project grows, it may be my top request.
Partial ‘map’ scrollbar:
Partial regular scrollbar:
-
Configuration. A code editor should not dictate how I format my code. Almost every line of code I write in Defold I am fighting against the autocomplete and autoformatting, please let me customize it or at least just let me turn it off. I’d be faster and way less frustrated without it. It makes me not want to write code out of pure frustration. I already had some parentheses, I didn’t want those argument names, I specifically indented it that way for a reason, just get out of my way.
-
Member autocomplete (‘intellisense’) for tables. I know Lua isn’t a compiled language but this is still completely possible and would make working in large projects with various complex tables much easier. Being able to see what data members a table has would reduce the amount of things you need to hold in your head.
-
A better log console. Unity’s console window is also not up to scratch, in every project I include the free or paid version of the asset store plugin Console Enhanced. It has categories (info/warning/error/custom) that can be toggled on or off, it has a search filter (Defold’s console is searchable but still shows entries that don’t match the search), it has options to include the time and/or frame of each entry. Most important of all it has a clickable call stack for every log. Want to know where this function was called from or who called it first? Good luck! It just feels silly when Defold tells me I got a nullref on line X of file Y and I can’t click that message to go there. Also nobody ever tells you which of the potentially many objects in the line triggered the null, which is stupid.
-
Let me print whatever the hell I want. I don’t care if it’s a bool or nil or a table or what, just concatenate the strings and log the damn thing.
-
Peeking. This is another feature that dramatically reduces navigation time and energy. I want to call a function, or I’m looking at an existing function call, and I want to know what that function does but I don’t want to navigate there because I’m in the middle of something. Right-click -> Peek definition. I’m using a constant defined at the top of the file and I want to quickly add another one. Right-click -> Peek definition. I peeked a function and it calls something I wasn’t aware of, now I want to peek that function. Right-click -> Peek definition, now my peek window has a stack I can navigate along. All. The. Time. Also right-click -> Go to definition for when I actually do want to go there.