When editing larger scripts it can be a bit difficult to navigate around. Some editors try to solve this problem by providing a code minimap, but those don’t seem to help much either because they only reveal the code’s shape. But what does help a lot is being able to see a high-level textual overview of what’s in the file, as this is actually useful information.
VS Code has a really nice feature which allows you to write comments that show up as labels in the code minimap / scrollbar area. I’ve been getting a lot of benefits from using this feature. The syntax for defining a region (in a JavaScript file) looks like:
I would get a lot of use out of a similar feature in Studio’s script editor, so I can quickly navigate through larger scripts and get an overview of what the script does. (Also, I don’t specifically want a code minimap cause I don’t care about that, I’m happy with the labels just showing up next to the scroll bar.)
We definitely need a better navigation but what you ask is just “no”
Because I do not want to write additional comments to help any IDE to understand my code that I already has written and which already has all required info to make navigation better: variables and functions.
IDEs usually provide outliner: it’s a separate window that shows all symbols in current file with ability to search in it. If you are not familiar with that it looks like Explorer for experience but for current script file.
Thank you!
An outliner widget is useful for searching for symbols, yes (although we already have some features which help with that, such as Ctrl+F or the Find in Place widget). However, the purpose of this feature request is less about finding symbols, and more about general navigation.
A large file may have many hundreds or thousands of symbols, so the outliner would get cluttered pretty quickly. It’s also common in Luau for people to write functions or variables in an anonymous sort of way, which would have to be shown to have a complete navigation experience. This clutter would unfortunately reduce the usefulness of the outliner for quick navigation.
Often times, useful waypoints/regions in a file do not directly correspond to a particular piece of code. For example if a function has two distinct parts to it, it may be useful to separate them by using a region label. The outliner can’t do this unfortunately. I want to have sparse and broad navigation information: “this is the UI update”, “this is the state machine evaluation”, “this is where I define developer product processing functions”, “these are the random helpers”, etc. The outliner may also not include code that is commented, or large prose comments which occasionally take up significant space and which we programmers want to navigate to or avoid.
Another issue is that quick, intuitive navigation is important to me: scrolling is the most intutive way to navigate, so I would prefer to have a navigation method available that can be used naturally while scrolling. Region labels allows this, as they let me see useful waypoints that I can scroll to.
The outliner actively impedes this, as it would most likely be a separate widget. That means more widgets taking up space on my screen, and more clicks to select/focus the widget, and it’s not automatically available in the script view, it’s a separate entity that needs to be managed. The Find in Place widget is annoying enough already, I don’t want to have to deal with another.
Para mi no es nesesario un nuevo editor de código ni nada mejor adaptado yo separo las partes de los códigos en --TextHere . Y asi lo tengo mas ordenado y limpio.
Si prefieres otra cosa puedes probar un puglin para el editor de código si hay uno.