@servicenow/sdk - v4.4.1
    Preparing search index...
    Index

    Accessors

    • get compilerObject(): tsc.LanguageService

      Gets the compiler language service.

      Returns tsc.LanguageService

    Methods

    • Finds references based on the specified node.

      Parameters

      • node: Node

        Node to find references for.

      Returns ReferencedSymbol[]

    • Finds the nodes that reference the definition(s) of the specified node.

      Parameters

      Returns Node<tsc.Node>[]

    • Finds references based on the specified position.

      Parameters

      • sourceFile: SourceFile

        Source file.

      • pos: number

        Position to find the reference at.

      Returns ReferencedSymbol[]

    • Find the rename locations for the specified node.

      Parameters

      • node: Node

        Node to get the rename locations for.

      • Optionaloptions: RenameOptions

        Options for renaming.

      Returns RenameLocation[]

    • Gets the edit information for applying a code fix at the provided text range in a source file.

      Parameters

      • filePathOrSourceFile: string | SourceFile

        File path or source file to get the code fixes for.

      • start: number

        Start position of the text range to be fixed.

      • end: number

        End position of the text range to be fixed.

      • errorCodes: readonly number[]

        One or more error codes associated with the code fixes to retrieve.

      • OptionalformatOptions: FormatCodeSettings

        Format code settings.

      • Optionalpreferences: UserPreferences

        User preferences for refactoring.

      Returns CodeFixAction[]

    • Gets file changes and actions to perform for the provided fixId.

      Parameters

      • filePathOrSourceFile: string | SourceFile

        File path or source file to get the combined code fixes for.

      • fixId: {}

        Identifier for the code fix (ex. "fixMissingImport"). These ids are found in the ts.codefix namespace in the compiler api source.

      • OptionalformatSettings: FormatCodeSettings

        Format code settings.

      • Optionalpreferences: UserPreferences

        User preferences for refactoring.

      Returns CombinedCodeActions

    • Gets the edit information for applying a refactor at a the provided position in a source file.

      Parameters

      • filePathOrSourceFile: string | SourceFile

        File path or source file to get the edits for.

      • formatSettings: FormatCodeSettings

        Fomat code settings.

      • positionOrRange: number | { getEnd(): number; getPos(): number }

        Position in the source file where to apply given refactor.

      • refactorName: string

        Refactor name.

      • actionName: string

        Refactor action name.

      • Optionalpreferences: UserPreferences

        User preferences for refactoring.

      Returns RefactorEditInfo | undefined

    • Gets the emit output of a source file.

      Parameters

      • sourceFile: SourceFile

        Source file.

      • OptionalemitOnlyDtsFiles: boolean

        Whether to only emit the d.ts files.

      Returns EmitOutput

    • Gets the emit output of a source file.

      Parameters

      • filePath: string

        File path.

      • OptionalemitOnlyDtsFiles: boolean

        Whether to only emit the d.ts files.

      Returns EmitOutput

    • Gets the formatted text for a document.

      Parameters

      • filePath: string

        File path of the source file.

      • formatSettings: FormatCodeSettings

        Format code settings.

      Returns string

    • Gets the formatting edits for a document.

      Parameters

      • filePath: string

        File path of the source file.

      • formatSettings: FormatCodeSettings

        Format code settings.

      Returns TextChange[]

    • Gets the formatting edits for a range.

      Parameters

      • filePath: string

        File path.

      • range: [number, number]

        Position range.

      • formatSettings: FormatCodeSettings

        Format code settings.

      Returns TextChange[]

    • Gets the indentation at the specified position.

      Parameters

      Returns number

    • Gets the indentation at the specified position.

      Parameters

      • filePath: string

        File path.

      • position: number

        Position.

      • Optionalsettings: tsc.EditorSettings

        Editor settings.

      Returns number

    • Gets the implementations at the specified position.

      Parameters

      • sourceFile: SourceFile

        Source file.

      • pos: number

        Position.

      Returns ImplementationLocation[]

    • Gets the language service's program.

      Returns Program

    • Gets the suggestion diagnostics.

      Parameters

      • filePathOrSourceFile: string | SourceFile

        The source file or file path to get suggestions for.

      Returns DiagnosticWithLocation[]