LanguageService

sealed external interface LanguageService(source)

Properties

Link copied to clipboard
abstract val toLineColumnOffset: (fileName: String, position: Double) -> LineAndCharacter?

Functions

Link copied to clipboard
abstract fun applyCodeActionCommand(action: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<{typescript/CodeActionCommand=} typescript/InstallPackageAction>, formatSettings: FormatCodeSettings = definedExternally): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ApplyCodeActionCommandResult>>
abstract fun applyCodeActionCommand(fileName: String, action: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<{typescript/CodeActionCommand=} typescript/InstallPackageAction>): ERROR CLASS: Symbol not found for Promise<ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ApplyCodeActionCommandResult>>
abstract fun applyCodeActionCommand(fileName: String, action: CodeActionCommand): ERROR CLASS: Symbol not found for Promise<typescript/ApplyCodeActionCommandResult>
abstract fun applyCodeActionCommand(action: CodeActionCommand, formatSettings: FormatCodeSettings = definedExternally): ERROR CLASS: Symbol not found for Promise<typescript/ApplyCodeActionCommandResult>
Link copied to clipboard
abstract fun cleanupSemanticCache()

This is used as a part of restarting the language service.

Link copied to clipboard
abstract fun commentSelection(fileName: String, textRange: TextRange): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun dispose()
Link copied to clipboard
abstract fun findReferences(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ReferencedSymbol>??
Link copied to clipboard
abstract fun findRenameLocations(fileName: String, position: Double, findInStrings: Boolean, findInComments: Boolean, providePrefixAndSuffixTextForRename: Boolean = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/RenameLocation>??
abstract fun findRenameLocations(fileName: String, position: Double, findInStrings: Boolean, findInComments: Boolean, preferences: UserPreferences): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/RenameLocation>??
Link copied to clipboard
abstract fun getApplicableRefactors(fileName: String, positionOrRange: Double, preferences: UserPreferences?, triggerReason: RefactorTriggerReason = definedExternally, kind: String = definedExternally, includeInteractiveActions: Boolean = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ApplicableRefactorInfo>
abstract fun getApplicableRefactors(fileName: String, positionOrRange: TextRange, preferences: UserPreferences?, triggerReason: RefactorTriggerReason = definedExternally, kind: String = definedExternally, includeInteractiveActions: Boolean = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ApplicableRefactorInfo>
Link copied to clipboard
abstract fun getBraceMatchingAtPosition(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextSpan>
Link copied to clipboard
abstract fun getBreakpointStatementAtPosition(fileName: String, position: Double): TextSpan?
Link copied to clipboard
abstract fun getCodeFixesAtPosition(fileName: String, start: Double, end: Double, errorCodes: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/Double>, formatOptions: FormatCodeSettings, preferences: UserPreferences): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/CodeFixAction>
Link copied to clipboard
abstract fun getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: Any, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions
Link copied to clipboard
abstract fun getCompilerOptionsDiagnostics(): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/Diagnostic>

Gets global diagnostics related to the program configuration and compiler options.

Link copied to clipboard
abstract fun getCompletionEntryDetails(fileName: String, position: Double, entryName: String, formatOptions: FormatCodeOptions?, source: String?, preferences: UserPreferences?, data: CompletionEntryData?): CompletionEntryDetails?
abstract fun getCompletionEntryDetails(fileName: String, position: Double, entryName: String, formatOptions: FormatCodeSettings?, source: String?, preferences: UserPreferences?, data: CompletionEntryData?): CompletionEntryDetails?

Gets the extended details for a completion entry retrieved from getCompletionsAtPosition.

Link copied to clipboard
abstract fun getCompletionEntrySymbol(fileName: String, position: Double, name: String, source: String?): Symbol?
Link copied to clipboard
abstract fun getCompletionsAtPosition(fileName: String, position: Double, options: GetCompletionsAtPositionOptions?, formattingSettings: FormatCodeSettings = definedExternally): WithMetadata<CompletionInfo>?

Gets completion entries at a particular position in a file.

Link copied to clipboard
Link copied to clipboard
abstract fun getDefinitionAtPosition(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/DefinitionInfo>??
Link copied to clipboard
abstract fun getDocCommentTemplateAtPosition(fileName: String, position: Double, options: DocCommentTemplateOptions = definedExternally, formatOptions: FormatCodeSettings = definedExternally): TextInsertion?
Link copied to clipboard
abstract fun getDocumentHighlights(fileName: String, position: Double, filesToSearch: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/String>): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/DocumentHighlights>??
Link copied to clipboard
abstract fun getEditsForFileRename(oldFilePath: String, newFilePath: String, formatOptions: FormatCodeSettings, preferences: UserPreferences?): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/FileTextChanges>
Link copied to clipboard
abstract fun getEditsForRefactor(fileName: String, formatOptions: FormatCodeSettings, positionOrRange: Double, refactorName: String, actionName: String, preferences: UserPreferences?, interactiveRefactorArguments: InteractiveRefactorArguments = definedExternally): RefactorEditInfo?
abstract fun getEditsForRefactor(fileName: String, formatOptions: FormatCodeSettings, positionOrRange: TextRange, refactorName: String, actionName: String, preferences: UserPreferences?, interactiveRefactorArguments: InteractiveRefactorArguments = definedExternally): RefactorEditInfo?
Link copied to clipboard
abstract fun getEmitOutput(fileName: String, emitOnlyDtsFiles: Boolean = definedExternally, forceDtsEmit: Boolean = definedExternally): EmitOutput
Link copied to clipboard
abstract fun getEncodedSemanticClassifications(fileName: String, span: TextSpan, format: SemanticClassificationFormat = definedExternally): Classifications

Gets semantic highlights information for a particular file. Has two formats, an older version used by VS and a format used by VS Code.

Link copied to clipboard

Encoded as triples of start, length, ClassificationType.

Link copied to clipboard
abstract fun getFileReferences(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ReferenceEntry>
Link copied to clipboard
abstract fun getFormattingEditsAfterKeystroke(fileName: String, position: Double, key: String, options: FormatCodeOptions): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
abstract fun getFormattingEditsAfterKeystroke(fileName: String, position: Double, key: String, options: FormatCodeSettings): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun getFormattingEditsForDocument(fileName: String, options: FormatCodeOptions): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
abstract fun getFormattingEditsForDocument(fileName: String, options: FormatCodeSettings): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun getFormattingEditsForRange(fileName: String, start: Double, end: Double, options: FormatCodeOptions): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
abstract fun getFormattingEditsForRange(fileName: String, start: Double, end: Double, options: FormatCodeSettings): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun getImplementationAtPosition(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ImplementationLocation>??
Link copied to clipboard
abstract fun getIndentationAtPosition(fileName: String, position: Double, options: EditorOptions): Double
abstract fun getIndentationAtPosition(fileName: String, position: Double, options: EditorSettings): Double
Link copied to clipboard
abstract fun getJsxClosingTagAtPosition(fileName: String, position: Double): JsxClosingTagInfo?

This will return a defined result if the position is after the > of the opening tag, or somewhere in the text, of a JSXElement with no closing tag. Editors should call this after > is typed.

Link copied to clipboard
abstract fun getLinkedEditingRangeAtPosition(fileName: String, position: Double): LinkedEditingInfo?
Link copied to clipboard
abstract fun getMoveToRefactoringFileSuggestions(fileName: String, positionOrRange: Double, preferences: UserPreferences?, triggerReason: RefactorTriggerReason = definedExternally, kind: String = definedExternally): LanguageServiceGetMoveToRefactoringFileSuggestionsResult
abstract fun getMoveToRefactoringFileSuggestions(fileName: String, positionOrRange: TextRange, preferences: UserPreferences?, triggerReason: RefactorTriggerReason = definedExternally, kind: String = definedExternally): LanguageServiceGetMoveToRefactoringFileSuggestionsResult
Link copied to clipboard
abstract fun getNameOrDottedNameSpan(fileName: String, startPos: Double, endPos: Double): TextSpan?
Link copied to clipboard
abstract fun getNavigateToItems(searchValue: String, maxResultCount: Double = definedExternally, fileName: String = definedExternally, excludeDtsFiles: Boolean = definedExternally, excludeLibFiles: Boolean = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/NavigateToItem>
Link copied to clipboard
abstract fun getNavigationBarItems(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/NavigationBarItem>
Link copied to clipboard
abstract fun getNavigationTree(fileName: String): NavigationTree
Link copied to clipboard
abstract fun getOutliningSpans(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/OutliningSpan>
Link copied to clipboard
abstract fun getPasteEdits(args: PasteEditsArgs, formatOptions: FormatCodeSettings): PasteEdits
Link copied to clipboard
abstract fun getProgram(): Program?
Link copied to clipboard
abstract fun getQuickInfoAtPosition(fileName: String, position: Double): QuickInfo?

Gets semantic information about the identifier at a particular position in a file. Quick info is what you typically see when you hover in an editor.

Link copied to clipboard
abstract fun getReferencesAtPosition(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ReferenceEntry>??
Link copied to clipboard
abstract fun getRenameInfo(fileName: String, position: Double, options: RenameInfoOptions = definedExternally): RenameInfo
abstract fun getRenameInfo(fileName: String, position: Double, preferences: UserPreferences): RenameInfo
Link copied to clipboard
abstract fun getSemanticClassifications(fileName: String, span: TextSpan): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ClassifiedSpan>
Link copied to clipboard
abstract fun getSemanticDiagnostics(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/Diagnostic>

Gets warnings or errors indicating type system issues in a given file. Requesting semantic diagnostics may start up the type system and run deferred work, so the first call may take longer than subsequent calls.

Link copied to clipboard
abstract fun getSignatureHelpItems(fileName: String, position: Double, options: SignatureHelpItemsOptions?): SignatureHelpItems?
Link copied to clipboard
abstract fun getSmartSelectionRange(fileName: String, position: Double): SelectionRange
Link copied to clipboard
abstract fun getSpanOfEnclosingComment(fileName: String, position: Double, onlyMultiLine: Boolean): TextSpan?
Link copied to clipboard
abstract fun getSuggestionDiagnostics(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/DiagnosticWithLocation>

Gets suggestion diagnostics for a specific file. These diagnostics tend to proactively suggest refactors, as opposed to diagnostics that indicate potentially incorrect runtime behavior.

Link copied to clipboard
abstract fun getSupportedCodeFixes(fileName: String = definedExternally): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<kotlin/String>
Link copied to clipboard
abstract fun getSyntacticClassifications(fileName: String, span: TextSpan): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/ClassifiedSpan>
Link copied to clipboard
abstract fun getSyntacticDiagnostics(fileName: String): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/DiagnosticWithLocation>

Gets errors indicating invalid syntax in a file.

Link copied to clipboard
abstract fun getTodoComments(fileName: String, descriptors: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TodoCommentDescriptor>): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TodoComment>
Link copied to clipboard
abstract fun getTypeDefinitionAtPosition(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/DefinitionInfo>??
Link copied to clipboard
abstract fun isValidBraceCompletionAtPosition(fileName: String, position: Double, openingBrace: Double): Boolean
Link copied to clipboard
abstract fun organizeImports(args: OrganizeImportsArgs, formatOptions: FormatCodeSettings, preferences: UserPreferences?): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/FileTextChanges>
Link copied to clipboard
abstract fun prepareCallHierarchy(fileName: String, position: Double): Any?
Link copied to clipboard
abstract fun preparePasteEditsForFile(fileName: String, copiedTextRanges: ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextRange>): Boolean
Link copied to clipboard
abstract fun provideCallHierarchyIncomingCalls(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/CallHierarchyIncomingCall>
Link copied to clipboard
abstract fun provideCallHierarchyOutgoingCalls(fileName: String, position: Double): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/CallHierarchyOutgoingCall>
Link copied to clipboard
abstract fun provideInlayHints(fileName: String, span: TextSpan, preferences: UserPreferences?): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/InlayHint>
Link copied to clipboard
abstract fun toggleLineComment(fileName: String, textRange: TextRange): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun toggleMultilineComment(fileName: String, textRange: TextRange): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>
Link copied to clipboard
abstract fun uncommentSelection(fileName: String, textRange: TextRange): ERROR CLASS: Symbol not found for js.array.ReadonlyArray<typescript/TextChange>