Class CodeEditor

Handles interaction with the external application used for editing scripts.

Constructors

Properties

CodeTypes: EnumValue<ResourceType, number>[]

Contains resource types that are relevant to the code editor.

Accessors

  • get activeEditor(): EnumValue<CodeEditorType, number>
  • Changes the active code editor. All further operations on this object will be executed using this editor. If the specified editor is not valid for this platform, no change will be made.

    Returns EnumValue<CodeEditorType, number>

  • set activeEditor(value): void
  • Parameters

    Returns void

  • get isSolutionDirty(): boolean
  • Checks if the code editor's solution requires updating.

    Returns boolean

  • get projectSolutionPath(): FilePath
  • Returns the path to the workspace, if supported by the current code editor.

    Returns FilePath

Methods

  • Gets the contents of the code file specified by the UUID.

    Parameters

    • uuid: UUID

      The UUID of the code resource to be retrieved.

    Returns UncertainAsyncOp<string, string>

    An async op once the operation has completed.

  • Gets a representation of the FileSystem code resources.

    Returns JsonObject

    A JsonObject that represents the file tree of code resoruces in the file system.

  • Notifies the code editor that code file structure has changed and the solution needs to be rebuilt.

    Returns void

  • Opens a the code resource in the currently active code editor.

    Parameters

    • resource: Resource
    • line: number

      Line in the file to focus the editor on.

    Returns void

  • Opens a script file in the currently active code editor.

    Parameters

    • path: FilePath

      FilePath to the script file to open, either absolute or relative to the project resources folder.

    • line: number

      Line in the file to focus the editor on.

    Returns void

  • Opens a code file in the active external editor.

    Parameters

    • path: FilePath

      Path to the code file to open, can be absolute or relative to project resources folder. The file should be part of a solution in the active editor.

    • lineNumber: number

      Line number to focus on once the file is opened. Might not be supported by all editors.

    Returns void

  • Sets the contents of the code file specified by the UUID.

    Parameters

    • uuid: UUID

      The UUID of the code resource to be updated.

    • contents: string

      The contents to update the code file with.

    Returns UncertainAsyncOp<boolean, string>

    An async op once the operation has completed.

  • Generates a solution file for the active editor, which includes all scripts in the project.

    Returns void