ScriptEditorService

Show Deprecated
Not Creatable
Service
Not Replicated

This service is used for interacting with ScriptDocument instances.

Summary

Properties

Events


Fires just after a ScriptDocument changes.


Fires just before a ScriptDocument object is destroyed, which happens right after the script editor closes.


Fires just after a ScriptDocument object is created and parented to the service, which happens right after the script editor opens.

Methods


Returns the open ScriptDocument corresponding to the given LuaSourceContainer, or nil if the given script is not open.

RegisterLSPCallback(methodToOverride: LSPMethodType, callbackFunction: function): nil  


Properties

Events

TextDocumentDidChange

Plugin Security

Fires just after a ScriptDocument changes. The textChanged is an array of change structures of the format:

{ range : { start : { line : number, character : number }, end : { line : number, character : number } }, text: string }

Parameters

document: ScriptDocument
changesArray: Variant

Code Samples

ScriptEditorService.TextDocumentDidChange

1game:GetService("ScriptEditorService").TextDocumentDidChange:Connect(
2 function(doc, changes)
3 print("Changed", doc, changes)
4 end)
5

TextDocumentDidClose

Plugin Security

Fires just before a ScriptDocument object is destroyed, which happens right after the script editor closes. After this event fires, the ScriptDocument enters a "Closed" state, and trying to call its methods throws an error. ScriptDocument objects aren't reusable, even if the script editor reopens the same script.

Parameters

oldDocument: ScriptDocument

Code Samples

ScriptEditorService.TextDocumentDidClose

1game:GetService("ScriptEditorService").TextDocumentDidClose:Connect(
2 function(doc)
3 print("Closed", doc)
4 end)
5

TextDocumentDidOpen

Plugin Security

Fires just after a ScriptDocument object is created and parented to the service, which happens right after the script editor opens.

Parameters

newDocument: ScriptDocument

Code Samples

ScriptEditorService.TextDocumentDidOpen

1game:GetService("ScriptEditorService").TextDocumentDidOpen:Connect(
2 function(doc)
3 print("Opened", doc)
4 end)
5

Methods

FindScriptDocument

Plugin Security

Returns the open ScriptDocument corresponding to the given LuaSourceContainer, or nil if the given script is not open.

Parameters


GetScriptDocuments

Plugin Security

Returns

RegisterLSPCallback

Roblox Script Security

Parameters

methodToOverride: LSPMethodType
callbackFunction: function

Returns

OpenScriptDocumentAsync

Yields
Plugin Security

Parameters


Returns