As a Roblox developer, it would be a nice QOL change to have all services (or the most used ones) being immediately accessible as a global built-in without constantly having to use GetService() (such as workspace) at the very top. As Roblox doesn’t autofill local ReplicatedStorage = game:G I’d have to manually type it out every time.
it would improve my development experience a little when creating a new script. Eliminating this small hurdle whenever I create a new modulescript.
Aside: Don’t hesitate to send feature requests
This change is a nice demonstration of the power of feature requests.
In total this change only took about a day of work to implement, test, and release. However it will likely save the community countless hours Shorthand Properties Panel Input
Some services are not immediately available, and I believe calling GetService when it doesn’t exist will yield, or at least do some work before returning. Having it immediately as a variable may potentially be nil.
It would be up to the engineer to make it work similar to GetService() for those specific cases. Otherwise most of the other commonly used services are readily available.
An engineer actually responded to this.
Basically, not all of the services are available/exist at all times, calling :GetService() creates the service if it hasn’t been initialized yet.
And this is actually the case for a lot of services.
As mentioned, not all services exist by default. This could be worked around by adding additional machinery to the environment but that would come with additional performance costs to accessing game / workspace / etc.
Namespace pollution. Do you want every service in your code completion popup? What if I told you there’s about 50 services with publicly accessible methods on them, do you still want all of them in the code completion popup?
Worth noting that auto-editing scripts to include the used services could be implemented as a Studio plugin using the LSP API.
This person actually created a very neat studio plugin that autocompletes service names, have been using it for a long time, and literally forgot about writing down service variables.
Wow, this is great! Features like these makes using the Script Editor so much more better. I wish to see this natively implemented but for now I’ll consider this the solution : D
I wouldn’t say that the documentation on the LSP API is bad. Consider for example the documentation on RegisterAutocompletionCallback, granted the LSP API surface is more complex than most Roblox APIs.
Were you looking for something more in the vein of an example plugin using the API?