Skip to main content
Module

x/deno2node/src/deps.deno.ts>LanguageService

Compile your Deno project to run on Node.js.
Latest
class LanguageService
import { LanguageService } from "https://deno.land/x/deno2node@v1.12.0/src/deps.deno.ts";

Constructors

new
private
LanguageService()

Properties

readonly
compilerObject: ts.LanguageService

Gets the compiler language service.

Methods

findReferences(node: Node): ReferencedSymbol[]

Finds references based on the specified node.

findReferencesAsNodes(node: Node): Node<ts.Node>[]

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

findReferencesAtPosition(sourceFile: SourceFile, pos: number): ReferencedSymbol[]

Finds references based on the specified position.

findRenameLocations(node: Node, options?: RenameOptions): RenameLocation[]

Find the rename locations for the specified node.

getCodeFixesAtPosition(
filePathOrSourceFile: string | SourceFile,
start: number,
end: number,
errorCodes: ReadonlyArray<number>,
formatOptions?: FormatCodeSettings,
preferences?: UserPreferences,
): CodeFixAction[]

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

getCombinedCodeFix(
filePathOrSourceFile: string | SourceFile,
fixId: { },
formatSettings?: FormatCodeSettings,
preferences?: UserPreferences,
): CombinedCodeActions

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

getDefinitions(node: Node): DefinitionInfo[]

Gets the definitions for the specified node.

getDefinitionsAtPosition(sourceFile: SourceFile, pos: number): DefinitionInfo[]

Gets the definitions at the specified position.

getEditsForRefactor(
filePathOrSourceFile: string | SourceFile,
formatSettings: FormatCodeSettings,
positionOrRange: number | { getPos(): number; getEnd(): number; },
refactorName: string,
actionName: string,
preferences?: UserPreferences,
): RefactorEditInfo | undefined

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

getEmitOutput(sourceFile: SourceFile, emitOnlyDtsFiles?: boolean): EmitOutput

Gets the emit output of a source file.

getEmitOutput(filePath: string, emitOnlyDtsFiles?: boolean): EmitOutput

Gets the emit output of a source file.

getFormattedDocumentText(filePath: string, formatSettings: FormatCodeSettings): string

Gets the formatted text for a document.

getFormattingEditsForDocument(filePath: string, formatSettings: FormatCodeSettings): TextChange[]

Gets the formatting edits for a document.

getFormattingEditsForRange(
filePath: string,
range: [number, number],
formatSettings: FormatCodeSettings,
): TextChange[]

Gets the formatting edits for a range.

getIdentationAtPosition(
sourceFile: SourceFile,
position: number,
settings?: EditorSettings,
): number

Gets the indentation at the specified position.

getIdentationAtPosition(
filePath: string,
position: number,
settings?: EditorSettings,
): number

Gets the indentation at the specified position.

getImplementations(node: Node): ImplementationLocation[]

Gets the implementations for the specified node.

getImplementationsAtPosition(sourceFile: SourceFile, pos: number): ImplementationLocation[]

Gets the implementations at the specified position.

getProgram(): Program

Gets the language service's program.

getSuggestionDiagnostics(filePathOrSourceFile: SourceFile | string): DiagnosticWithLocation[]

Gets the suggestion diagnostics.

organizeImports(
sourceFile: SourceFile,
formatSettings?: FormatCodeSettings,
userPreferences?: UserPreferences,
): FileTextChanges[]

Gets the file text changes for organizing the imports in a source file.

organizeImports(
filePath: string,
formatSettings?: FormatCodeSettings,
userPreferences?: UserPreferences,
): FileTextChanges[]

Gets the file text changes for organizing the imports in a source file.