Skip to content

ScriptEditorService

Not yet Class Services NotCreatable NotReplicated Service

This service is used for interacting with ScriptDocument instances.

Not implemented yet

This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.

0 Nova members · 26 modern Roblox members not implemented yet

Description

This service is used for interacting with ScriptDocument instances. It provides methods to open, find, and list script documents that represent scripts currently open in the Studio Script Editor. It also enables plugins to register custom callbacks for autocomplete and script analysis, and fires events when script documents are opened, closed, or changed.

This service is only available in Studio plugins and the command bar (Plugin security level).

Inheritance

Object → Instance → ScriptEditorService

Methods

Member Signature Summary
ClearUriScript ScriptEditorService:ClearUriScript(uri: string): null —
DeregisterAutocompleteCallback ScriptEditorService:DeregisterAutocompleteCallback(name: string): null Removes a previously registered callback with the name name.
DeregisterScriptAnalysisCallback ScriptEditorService:DeregisterScriptAnalysisCallback(name: string): null Removes a previously registered callback with the name name.
EditSourceAsyncWithRanges ScriptEditorService:EditSourceAsyncWithRanges(script: LuaSourceContainer, newText: string, startLine: int, startCharacter: int, endLine: int, endCharacter: int): Tuple —
FindScriptDocument ScriptEditorService:FindScriptDocument(script: LuaSourceContainer): ScriptDocument Returns the open ScriptDocument corresponding to the given LuaSourceContainer, or nil if the given script is not open.
ForceReloadSource ScriptEditorService:ForceReloadSource(uri: string, newsrc: string): null —
GetEditorSource ScriptEditorService:GetEditorSource(script: LuaSourceContainer): string Returns the edit-time source for the given script.
GetScriptDocuments ScriptEditorService:GetScriptDocuments(): Instances Returns an array of the currently open script documents, including the command bar.
IsAutocompleteCallbackRegistered ScriptEditorService:IsAutocompleteCallbackRegistered(name: string): bool —
IsScriptAnalysisCallbackRegistered ScriptEditorService:IsScriptAnalysisCallbackRegistered(name: string): bool —
OpenScriptDocumentAsync ScriptEditorService:OpenScriptDocumentAsync(script: LuaSourceContainer, options: Dictionary = nil): Tuple Requests that a Script Editor open the specified script. Returns (true, nil) if the request succeeds. Returns (false, string) if the request fails, with a string that de…
OpenTemporaryDocumentAsync ScriptEditorService:OpenTemporaryDocumentAsync(scriptId: string, initialContent: string): Tuple —
RegisterAutocompleteCallback ScriptEditorService:RegisterAutocompleteCallback(name: string, priority: int, callbackFunction: Function): null Registers an autocomplete callback callbackFunction named name with priority priority.
RegisterScriptAnalysisCallback ScriptEditorService:RegisterScriptAnalysisCallback(name: string, priority: int, callbackFunction: Function): null Registers a Script Analysis callback callbackFunction named name with priority.
SetUriScript ScriptEditorService:SetUriScript(uri: string, source: string): null —
StripComments ScriptEditorService:StripComments(code: string): string —
UpdateSourceAsync ScriptEditorService:UpdateSourceAsync(script: LuaSourceContainer, callback: Function): null Generates new content from the old script and updates the script editor if it's open, or the Script instance if the script editor is closed.

Events

Member Signature Summary
TextDocumentDidChange TextDocumentDidChange(document: ScriptDocument, changesArray: Variant) Fires just after a ScriptDocument changes.
TextDocumentDidClose TextDocumentDidClose(oldDocument: ScriptDocument) Fires just before a ScriptDocument object is destroyed, which happens right after the script editor closes.
TextDocumentDidOpen TextDocumentDidOpen(newDocument: ScriptDocument) Fires just after a ScriptDocument object is created and parented to the service, which happens right after the script editor opens.

Roblox reference: ScriptEditorService

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.