Let intellisense show Plugin Security Identity methods on Scripts, (as example those with Run Context set to Plugin), for a better dev experience

This seems to be a Studio only suggestion. You could also see it as a bug. But I believe it is a missing implementation feature.

As a Roblox developer, it is currently too hard to develop plugins in Studio, because of the intellisense.

Currently, if I do this
image

I am not getting any auto suggestions, because it is a Script. In comparison the the “Run Command” console, which actually shows you the methods, because it is on a different Security Identity or something.

VS Code supports it

However, it’s a third party thing and idk. Plugins like Roblox LSP and all that.

 

Roblox does support it but not for Script

Things like !nonstrict, !strict, !nolint
etc. don’t solve the issue either.

 

If this issue is addressed, it would improve my development experience because getting suggestions for the methods and etc. by the intellisense, simplifies everything.

Having to hop around into the devforum and have a thousands of tabs open, can be very annoying. Especially, if the console supports it.

See how “Run Console” supports the Plugin Security Identity:

Missing Implementation Feature

image

You can turn Scripts into Plugin Contexts.

game.Workspace.Script = Enum.RunContext.Plugin

But it doesn’t change the intellisense behaviour. If Roblox could change that, so that it would give support. That would be amazing!

 

Here’s a forum thread: Change Script Identitiy only for the Script Editor to have Plugin intellisense

2 Likes

Thats a good idea! Very helpfull

1 Like

Pardon me if I’m misunderstanding something, but we have this setting already: it’s in Studio Settings → Script Editor → General → Autocomplete Plugin-security methods. Check that box and you should start getting Autocomplete for plugin-security methods in the normal script editor.

Edit: game.Workspace.Script = Enum.RunContext.Plugin
This is a good point! We have code that auto-detects if a script is running in a plugin, but it predates RunContext and it seems we overlooked adding that to the detection. I will file a ticket to fix this problem, but in the mean time the setting should serve as a manual override.

2 Likes

it does serve well and work as a manual override, you’d just have to remember to turn it off

otherwise you get things autosuggested, which may mislead you into wrong promises, e.g. something not working because of it being at the wrong Security Identity.

Would be interesting as a fast toggle in this tab
image

 

If script.RunContext = Enum.RunContext.Plugin would change the behavior of the intellisense, that would be cool too.

ModuleScripts don’t have a RunContext though

2 Likes

Hello! After restarting Studio, RunContext being set to plugin should now properly cause the editor to infer that it is editing a plugin and display plugin security methods.

3 Likes

It works!

What about RunContext for ModuleScripts?

and the ability to also choose “Plugin” from “RunContext”

image

because it’s not there
image

1 Like

Well, it doesn’t. Restarted studio, restarted the game.