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: unknown class><CodeActionCommand>,     formatSettings: FormatCodeSettings = definedExternally): <Error class: unknown class><<Error class: unknown class><ApplyCodeActionCommandResult>>
abstract fun applyCodeActionCommand(    fileName: String,     action: <Error class: unknown class><CodeActionCommand>): <Error class: unknown class><<Error class: unknown class><ApplyCodeActionCommandResult>>
abstract fun applyCodeActionCommand(    fileName: String,     action: CodeActionCommand): <Error class: unknown class><ApplyCodeActionCommandResult>
abstract fun applyCodeActionCommand(    action: CodeActionCommand,     formatSettings: FormatCodeSettings = definedExternally): <Error class: unknown class><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: unknown class><TextChange>
Link copied to clipboard
abstract fun dispose()
Link copied to clipboard
abstract fun findReferences(fileName: String, position: Double): <Error class: unknown class><ReferencedSymbol>?
Link copied to clipboard
abstract fun findRenameLocations(    fileName: String,     position: Double,     findInStrings: Boolean,     findInComments: Boolean,     providePrefixAndSuffixTextForRename: Boolean = definedExternally): <Error class: unknown class><RenameLocation>?
abstract fun findRenameLocations(    fileName: String,     position: Double,     findInStrings: Boolean,     findInComments: Boolean,     preferences: UserPreferences): <Error class: unknown class><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: unknown class><ApplicableRefactorInfo>
abstract fun getApplicableRefactors(    fileName: String,     positionOrRange: TextRange,     preferences: UserPreferences?,     triggerReason: RefactorTriggerReason = definedExternally,     kind: String = definedExternally,     includeInteractiveActions: Boolean = definedExternally): <Error class: unknown class><ApplicableRefactorInfo>
Link copied to clipboard
abstract fun getBraceMatchingAtPosition(fileName: String, position: Double): <Error class: unknown class><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: unknown class><Double>,     formatOptions: FormatCodeSettings,     preferences: UserPreferences): <Error class: unknown class><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: unknown class><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: unknown class><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: unknown class><String>): <Error class: unknown class><DocumentHighlights>?
Link copied to clipboard
abstract fun getEditsForFileRename(    oldFilePath: String,     newFilePath: String,     formatOptions: FormatCodeSettings,     preferences: UserPreferences?): <Error class: unknown class><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: unknown class><ReferenceEntry>
Link copied to clipboard
abstract fun getFormattingEditsAfterKeystroke(    fileName: String,     position: Double,     key: String,     options: FormatCodeOptions): <Error class: unknown class><TextChange>
abstract fun getFormattingEditsAfterKeystroke(    fileName: String,     position: Double,     key: String,     options: FormatCodeSettings): <Error class: unknown class><TextChange>
Link copied to clipboard
abstract fun getFormattingEditsForDocument(fileName: String, options: FormatCodeOptions): <Error class: unknown class><TextChange>
abstract fun getFormattingEditsForDocument(fileName: String, options: FormatCodeSettings): <Error class: unknown class><TextChange>
Link copied to clipboard
abstract fun getFormattingEditsForRange(    fileName: String,     start: Double,     end: Double,     options: FormatCodeOptions): <Error class: unknown class><TextChange>
abstract fun getFormattingEditsForRange(    fileName: String,     start: Double,     end: Double,     options: FormatCodeSettings): <Error class: unknown class><TextChange>
Link copied to clipboard
abstract fun getImplementationAtPosition(fileName: String, position: Double): <Error class: unknown class><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: unknown class><NavigateToItem>
Link copied to clipboard
abstract fun getNavigationBarItems(fileName: String): <Error class: unknown class><NavigationBarItem>
Link copied to clipboard
abstract fun getNavigationTree(fileName: String): NavigationTree
Link copied to clipboard
abstract fun getOutliningSpans(fileName: String): <Error class: unknown class><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: unknown class><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: unknown class><ClassifiedSpan>
Link copied to clipboard
abstract fun getSemanticDiagnostics(fileName: String): <Error class: unknown class><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: unknown class><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: unknown class><String>
Link copied to clipboard
abstract fun getSyntacticClassifications(fileName: String, span: TextSpan): <Error class: unknown class><ClassifiedSpan>
Link copied to clipboard
abstract fun getSyntacticDiagnostics(fileName: String): <Error class: unknown class><DiagnosticWithLocation>

Gets errors indicating invalid syntax in a file.

Link copied to clipboard
abstract fun getTodoComments(    fileName: String,     descriptors: <Error class: unknown class><TodoCommentDescriptor>): <Error class: unknown class><TodoComment>
Link copied to clipboard
abstract fun getTypeDefinitionAtPosition(fileName: String, position: Double): <Error class: unknown class><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: unknown class><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: unknown class><TextRange>): Boolean
Link copied to clipboard
abstract fun provideCallHierarchyIncomingCalls(fileName: String, position: Double): <Error class: unknown class><CallHierarchyIncomingCall>
Link copied to clipboard
abstract fun provideCallHierarchyOutgoingCalls(fileName: String, position: Double): <Error class: unknown class><CallHierarchyOutgoingCall>
Link copied to clipboard
abstract fun provideInlayHints(fileName: String, span: TextSpan, preferences: UserPreferences?): <Error class: unknown class><InlayHint>
Link copied to clipboard
abstract fun toggleLineComment(fileName: String, textRange: TextRange): <Error class: unknown class><TextChange>
Link copied to clipboard
abstract fun toggleMultilineComment(fileName: String, textRange: TextRange): <Error class: unknown class><TextChange>
Link copied to clipboard
abstract fun uncommentSelection(fileName: String, textRange: TextRange): <Error class: unknown class><TextChange>