@tslite/services 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +3 -1
- package/dist/_namespaces/edit.d.ts +1 -1
- package/dist/_namespaces/edit.js +10759 -11
- package/dist/_namespaces/ts.codefix.d.ts +0 -1
- package/dist/_namespaces/ts.js +10196 -19
- package/dist/classifier.d.ts +3 -1
- package/dist/codeFixProvider.d.ts +2 -1
- package/dist/codefixes/helpers.d.ts +3 -1
- package/dist/codefixes/importFixes.d.ts +3 -1
- package/dist/completions.d.ts +5 -2
- package/dist/documentHighlights.d.ts +3 -1
- package/dist/documentRegistry.d.ts +2 -1
- package/dist/findAllReferences.d.ts +3 -1
- package/dist/formatting/formatting.d.ts +3 -2
- package/dist/formatting/formattingContext.d.ts +2 -1
- package/dist/formatting/formattingScanner.d.ts +2 -2
- package/dist/formatting/rule.d.ts +1 -1
- package/dist/formatting/rulesMap.d.ts +1 -1
- package/dist/formatting/smartIndenter.d.ts +2 -1
- package/dist/getEditsForFileRename.d.ts +4 -1
- package/dist/goToDefinition.d.ts +3 -1
- package/dist/importTracker.d.ts +2 -1
- package/dist/navigationBar.d.ts +3 -1
- package/dist/organizeImports.d.ts +4 -2
- package/dist/outliningElementsCollector.d.ts +3 -1
- package/dist/refactorProvider.d.ts +1 -1
- package/dist/refactors/extractSymbol.d.ts +2 -1
- package/dist/rename.d.ts +3 -1
- package/dist/services.d.ts +5 -2
- package/dist/signatureHelp.d.ts +3 -1
- package/dist/smartSelection.d.ts +2 -1
- package/dist/stringCompletions.d.ts +3 -1
- package/dist/suggestionDiagnostics.d.ts +4 -3
- package/dist/symbolDisplay.d.ts +3 -1
- package/dist/textChanges.d.ts +4 -2
- package/dist/types.d.ts +3 -3
- package/dist/utilities.d.ts +7 -2
- package/package.json +7 -5
- package/dist/_namespaces/ts.Completions.StringCompletions.js +0 -2
- package/dist/_namespaces/ts.Completions.js +0 -3
- package/dist/_namespaces/ts.FindAllReferences.js +0 -3
- package/dist/_namespaces/ts.GoToDefinition.js +0 -2
- package/dist/_namespaces/ts.NavigationBar.js +0 -2
- package/dist/_namespaces/ts.OrganizeImports.js +0 -2
- package/dist/_namespaces/ts.OutliningElementsCollector.js +0 -2
- package/dist/_namespaces/ts.Rename.js +0 -2
- package/dist/_namespaces/ts.SignatureHelp.js +0 -2
- package/dist/_namespaces/ts.SmartSelectionRange.js +0 -2
- package/dist/_namespaces/ts.SymbolDisplay.js +0 -2
- package/dist/_namespaces/ts.codefix.js +0 -27
- package/dist/_namespaces/ts.formatting.js +0 -8
- package/dist/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.js +0 -2
- package/dist/_namespaces/ts.refactor.convertParamsToDestructuredObject.js +0 -2
- package/dist/_namespaces/ts.refactor.convertStringOrTemplateLiteral.js +0 -2
- package/dist/_namespaces/ts.refactor.extractSymbol.js +0 -2
- package/dist/_namespaces/ts.refactor.js +0 -10
- package/dist/_namespaces/ts.textChanges.js +0 -2
- package/dist/classifier.js +0 -715
- package/dist/codeFixProvider.js +0 -84
- package/dist/codefixes/addConvertToUnknownForNonOverlappingTypes.d.ts +0 -1
- package/dist/codefixes/addConvertToUnknownForNonOverlappingTypes.js +0 -21
- package/dist/codefixes/addEmptyExportDeclaration.js +0 -17
- package/dist/codefixes/addMissingAsync.js +0 -75
- package/dist/codefixes/addMissingAwait.js +0 -236
- package/dist/codefixes/addMissingConst.js +0 -91
- package/dist/codefixes/addNameToNamelessParameter.js +0 -29
- package/dist/codefixes/convertConstToLet.js +0 -30
- package/dist/codefixes/convertToAsyncFunction.js +0 -495
- package/dist/codefixes/convertToMappedObjectType.js +0 -48
- package/dist/codefixes/correctQualifiedNameToIndexedAccessType.js +0 -33
- package/dist/codefixes/fixAddModuleReferTypeMissingTypeof.js +0 -27
- package/dist/codefixes/fixAwaitInSyncFunction.js +0 -69
- package/dist/codefixes/fixExpectedComma.js +0 -35
- package/dist/codefixes/fixInvalidJsxCharacters.js +0 -41
- package/dist/codefixes/fixMissingCallParentheses.js +0 -42
- package/dist/codefixes/fixSpelling.js +0 -94
- package/dist/codefixes/fixUnreachableCode.js +0 -65
- package/dist/codefixes/fixUnusedIdentifier.js +0 -224
- package/dist/codefixes/helpers.js +0 -53
- package/dist/codefixes/importFixes.js +0 -441
- package/dist/codefixes/inferFromUsage.js +0 -742
- package/dist/codefixes/removeUnnecessaryAwait.js +0 -41
- package/dist/codefixes/returnValueCorrect.js +0 -132
- package/dist/codefixes/splitTypeOnlyImport.js +0 -32
- package/dist/codefixes/useBigintLiteral.js +0 -29
- package/dist/completions.js +0 -1720
- package/dist/documentHighlights.js +0 -367
- package/dist/documentRegistry.js +0 -63
- package/dist/editingServices.js +0 -4
- package/dist/findAllReferences.js +0 -1366
- package/dist/formatting/formatting.js +0 -1021
- package/dist/formatting/formattingContext.js +0 -78
- package/dist/formatting/formattingScanner.js +0 -228
- package/dist/formatting/rule.js +0 -22
- package/dist/formatting/rules.js +0 -610
- package/dist/formatting/rulesMap.js +0 -127
- package/dist/formatting/smartIndenter.js +0 -518
- package/dist/getEditsForFileRename.js +0 -86
- package/dist/goToDefinition.js +0 -246
- package/dist/importTracker.js +0 -422
- package/dist/index.js +0 -3
- package/dist/navigationBar.js +0 -549
- package/dist/organizeImports.js +0 -290
- package/dist/outliningElementsCollector.js +0 -261
- package/dist/refactorProvider.js +0 -16
- package/dist/refactors/addOrRemoveBracesToArrowFunction.js +0 -86
- package/dist/refactors/convertExport.js +0 -126
- package/dist/refactors/convertImport.js +0 -116
- package/dist/refactors/convertParamsToDestructuredObject.js +0 -282
- package/dist/refactors/convertStringOrTemplateLiteral.js +0 -148
- package/dist/refactors/extractSymbol.js +0 -1281
- package/dist/refactors/extractType.js +0 -102
- package/dist/refactors/moveToNewFile.js +0 -477
- package/dist/rename.js +0 -100
- package/dist/services.js +0 -1480
- package/dist/signatureHelp.js +0 -414
- package/dist/smartSelection.js +0 -243
- package/dist/stringCompletions.js +0 -220
- package/dist/suggestionDiagnostics.js +0 -92
- package/dist/symbolDisplay.js +0 -400
- package/dist/textChanges.js +0 -1163
- package/dist/types.js +0 -263
- package/dist/utilities.js +0 -1981
package/dist/classifier.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile, TextSpan, UnderscoreEscapedMap } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, TypeChecker } from "@tslite/checker";
|
|
3
|
+
import type { Classifications, ClassifiedSpan, Classifier } from "./_namespaces/ts.js";
|
|
2
4
|
/**
|
|
3
5
|
* O classificador léxico: a classe de cada token de um trecho, só pelo scanner, sem árvore nem programa. É o que
|
|
4
6
|
* classifica um trecho solto, como o bloco de código de um hover, que não é arquivo de programa nenhum.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { textChanges } from "./_namespaces/edit.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DiagnosticMessage, DiagnosticWithLocation } from "@tslite/parser";
|
|
3
|
+
import type { CodeFixAction, CodeFixAllContext, CodeFixContext, CodeFixRegistration, CombinedCodeActions, FileTextChanges, TextChange } from "@tslite/services";
|
|
3
4
|
export type DiagnosticAndArguments = DiagnosticMessage | [DiagnosticMessage, string] | [DiagnosticMessage, string, string];
|
|
4
5
|
export declare function createCodeFixActionWithoutFixAll(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments): CodeFixAction;
|
|
5
6
|
export declare function createCodeFixAction(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments): CodeFixAction;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { Node,
|
|
1
|
+
import type { Node, ScriptTarget, Symbol, TypeNode } from "@tslite/parser";
|
|
2
|
+
import type { SymbolTracker } from "@tslite/printer";
|
|
3
|
+
import type { NodeBuilderFlags, Type, TypeChecker } from "@tslite/checker";
|
|
2
4
|
import type { ImportAdder } from "../_namespaces/ts.codefix.js";
|
|
3
5
|
export declare function typeToAutoImportableTypeNode(checker: TypeChecker, importAdder: ImportAdder, type: Type, contextNode: Node, scriptTarget: ScriptTarget, flags?: NodeBuilderFlags, tracker?: SymbolTracker): TypeNode | undefined;
|
|
4
6
|
export declare function tryGetAutoImportableReferenceFromImportTypeNode(importTypeNode: TypeNode | undefined, type: Type | undefined, scriptTarget: ScriptTarget): {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { formatting, textChanges } from "../_namespaces/edit.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DiagnosticWithLocation, SourceFile, Symbol, UserPreferences } from "@tslite/parser";
|
|
3
|
+
import type { CheckResult } from "@tslite/checker";
|
|
4
|
+
import type { CodeAction, CodeFixContextBase, LanguageServiceHost } from "@tslite/services";
|
|
3
5
|
export declare const importFixName = "import";
|
|
4
6
|
export interface ImportAdder {
|
|
5
7
|
addImportFromDiagnostic: (diagnostic: DiagnosticWithLocation, context: CodeFixContextBase) => void;
|
package/dist/completions.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { ScriptTarget } from "@tslite/parser";
|
|
2
|
+
import { ScriptElementKind } from "./_namespaces/ts.js";
|
|
3
|
+
import type { Identifier, Node, PropertyAccessExpression, Push, SourceFile, Symbol, UserPreferences } from "@tslite/parser";
|
|
4
|
+
import type { CancellationToken, CheckResult, TypeChecker } from "@tslite/checker";
|
|
5
|
+
import type { CodeAction, CompletionEntry, CompletionEntryDetails, CompletionInfo, CompletionsTriggerCharacter, FormatCodeSettings, JSDocTagInfo, LanguageServiceHost, SymbolDisplayPart } from "./_namespaces/ts.js";
|
|
3
6
|
/**
|
|
4
7
|
* O auto-import do completion: o que lista os módulos de que se importa e o que monta a edição do import. Os dois são
|
|
5
8
|
* da edição (o `importFixes.ts` da tag, com o `textChanges` e o `formatting`), e a leitura não os carrega: a edição os
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, CheckResult } from "@tslite/checker";
|
|
3
|
+
import type { HighlightSpan } from "./_namespaces/ts.js";
|
|
2
4
|
export interface DocumentHighlights {
|
|
3
5
|
fileName: string;
|
|
4
6
|
highlightSpans: HighlightSpan[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Path, ScriptKind, SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { IScriptSnapshot } from "./_namespaces/ts.js";
|
|
2
3
|
/**
|
|
3
4
|
* O registro de documentos guarda os `SourceFile` que várias instâncias do language service compartilham: cada uma
|
|
4
5
|
* segura as árvores dos arquivos do seu programa, e as árvores são quase toda a memória que ele ocupa. Com um registro
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { SemanticMeaning } from "./_namespaces/ts.js";
|
|
2
|
-
import type { BinaryExpression, CallExpression,
|
|
2
|
+
import type { BinaryExpression, CallExpression, ForInOrOfStatement, Identifier, NamedDeclaration, Node, ReadonlyMap, SignatureDeclaration, SourceFile, StringLiteral, Symbol, TextSpan } from "@tslite/parser";
|
|
3
|
+
import type { CancellationToken, CheckResult, TypeChecker } from "@tslite/checker";
|
|
4
|
+
import type { HighlightSpan, ImplementationLocation, ReferenceEntry, ReferencedSymbol, RenameLocation } from "./_namespaces/ts.js";
|
|
3
5
|
export interface SymbolAndEntries {
|
|
4
6
|
readonly definition: Definition | undefined;
|
|
5
7
|
readonly references: readonly Entry[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LanguageVariant, SyntaxKind } from "
|
|
2
|
-
import type {
|
|
1
|
+
import { LanguageVariant, SyntaxKind } from "@tslite/parser";
|
|
2
|
+
import type { Node, SourceFile, SourceFileLike, TextRange, TriviaKind } from "@tslite/parser";
|
|
3
|
+
import type { EditorSettings, FormatCodeSettings, FormattingHost, TextChange } from "@tslite/services";
|
|
3
4
|
import type { RulesMap } from "../_namespaces/ts.formatting.js";
|
|
4
5
|
export interface FormatContext {
|
|
5
6
|
readonly options: FormatCodeSettings;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Node, SourceFileLike } from "@tslite/parser";
|
|
2
|
+
import type { FormatCodeSettings } from "@tslite/services";
|
|
2
3
|
import type { TextRangeWithKind } from "../_namespaces/ts.formatting.js";
|
|
3
4
|
export declare enum FormattingRequestKind {
|
|
4
5
|
FormatDocument = 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LanguageVariant } from "
|
|
2
|
-
import type { Node } from "
|
|
1
|
+
import { LanguageVariant } from "@tslite/parser";
|
|
2
|
+
import type { Node } from "@tslite/parser";
|
|
3
3
|
import type { TextRangeWithKind, TokenInfo } from "../_namespaces/ts.formatting.js";
|
|
4
4
|
export interface FormattingScanner {
|
|
5
5
|
advance(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FormatCodeSettings, FormattingHost } from "
|
|
1
|
+
import type { FormatCodeSettings, FormattingHost } from "@tslite/services";
|
|
2
2
|
import { FormattingContext } from "../_namespaces/ts.formatting.js";
|
|
3
3
|
import type { FormatContext, Rule } from "../_namespaces/ts.formatting.js";
|
|
4
4
|
export declare function getFormatContext(options: FormatCodeSettings, host: FormattingHost): FormatContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Node, NodeArray, SourceFile, SourceFileLike, TextRange } from "@tslite/parser";
|
|
2
|
+
import type { EditorSettings, FormatCodeSettings } from "@tslite/services";
|
|
2
3
|
import type { TextRangeWithKind } from "../_namespaces/ts.formatting.js";
|
|
3
4
|
export declare namespace SmartIndenter {
|
|
4
5
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GetCanonicalFileName, UserPreferences } from "@tslite/parser";
|
|
2
|
+
import type { CheckResult } from "@tslite/checker";
|
|
3
|
+
import type { FileTextChanges, LanguageServiceHost } from "@tslite/services";
|
|
4
|
+
import type { formatting } from "./_namespaces/edit.js";
|
|
2
5
|
export declare function getEditsForFileRename(program: CheckResult, oldFileOrDirPath: string, newFileOrDirPath: string, host: LanguageServiceHost, formatContext: formatting.FormatContext, preferences: UserPreferences): readonly FileTextChanges[];
|
|
3
6
|
/** If 'path' refers to an old directory, returns path in the new directory. */
|
|
4
7
|
type PathUpdater = (path: string) => string | undefined;
|
package/dist/goToDefinition.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CheckResult, TypeChecker } from "@tslite/checker";
|
|
3
|
+
import type { DefinitionInfo, DefinitionInfoAndBoundSpan } from "./_namespaces/ts.js";
|
|
2
4
|
/**
|
|
3
5
|
* Na tag, também a referência `/// <reference path>`, `<reference types>` e `<reference lib>` na posição, que dava o
|
|
4
6
|
* arquivo referido (CK-03, CK-46, CK-39), e o label de um `break` ou `continue` (CK-02).
|
package/dist/importTracker.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Identifier, Node, ReadonlyMap, SourceFile, StringLiteral, StringLiteralLike, Symbol } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, CheckResult, TypeChecker } from "@tslite/checker";
|
|
2
3
|
export interface ImportsResult {
|
|
3
4
|
/** For every import of the symbol, the location and local symbol for the import. */
|
|
4
5
|
importSearches: readonly [Identifier, Symbol][];
|
package/dist/navigationBar.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken } from "@tslite/checker";
|
|
3
|
+
import type { NavigationBarItem, NavigationTree } from "./_namespaces/ts.js";
|
|
2
4
|
export declare function getNavigationBarItems(sourceFile: SourceFile, cancellationToken: CancellationToken): NavigationBarItem[];
|
|
3
5
|
export declare function getNavigationTree(sourceFile: SourceFile, cancellationToken: CancellationToken): NavigationTree;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { formatting } from "./_namespaces/edit.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExportDeclaration, Expression, ImportDeclaration, SourceFile, UserPreferences } from "@tslite/parser";
|
|
3
|
+
import type { CheckResult } from "@tslite/checker";
|
|
4
|
+
import type { LanguageServiceHost } from "@tslite/services";
|
|
3
5
|
/**
|
|
4
6
|
* Organize imports by:
|
|
5
7
|
* 1) Removing unused imports
|
|
6
8
|
* 2) Coalescing imports from the same module
|
|
7
9
|
* 3) Sorting imports
|
|
8
10
|
*/
|
|
9
|
-
export declare function organizeImports(sourceFile: SourceFile, formatContext: formatting.FormatContext, host: LanguageServiceHost, program: CheckResult, preferences: UserPreferences): import("
|
|
11
|
+
export declare function organizeImports(sourceFile: SourceFile, formatContext: formatting.FormatContext, host: LanguageServiceHost, program: CheckResult, preferences: UserPreferences): import("@tslite/services").FileTextChanges[];
|
|
10
12
|
/**
|
|
11
13
|
* @param importGroup a list of ImportDeclarations, all with the same module name.
|
|
12
14
|
*/
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken } from "@tslite/checker";
|
|
3
|
+
import type { OutliningSpan } from "./_namespaces/ts.js";
|
|
2
4
|
export declare function collectElements(sourceFile: SourceFile, cancellationToken: CancellationToken): OutliningSpan[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplicableRefactorInfo, Refactor, RefactorContext, RefactorEditInfo } from "
|
|
1
|
+
import type { ApplicableRefactorInfo, Refactor, RefactorContext, RefactorEditInfo } from "@tslite/services";
|
|
2
2
|
/** @param name An unique code associated with each refactor. Does not have to be human-readable. */
|
|
3
3
|
export declare function registerRefactor(name: string, refactor: Refactor): void;
|
|
4
4
|
export declare function getApplicableRefactors(context: RefactorContext): ApplicableRefactorInfo[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Diagnostic, DiagnosticMessage, Expression, SourceFile, Statement, Symbol, TextSpan } from "@tslite/parser";
|
|
2
|
+
import type { ApplicableRefactorInfo, RefactorContext, RefactorEditInfo } from "@tslite/services";
|
|
2
3
|
/**
|
|
3
4
|
* Compute the associated code actions
|
|
4
5
|
* Exported for tests.
|
package/dist/rename.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CheckResult } from "@tslite/checker";
|
|
3
|
+
import type { RenameInfo, RenameInfoOptions } from "./_namespaces/ts.js";
|
|
2
4
|
export declare function getRenameInfo(program: CheckResult, sourceFile: SourceFile, position: number, options?: RenameInfoOptions): RenameInfo;
|
package/dist/services.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { ScriptKind, ScriptTarget } from "
|
|
2
|
-
import type {
|
|
1
|
+
import { ScriptKind, ScriptTarget } from "@tslite/parser";
|
|
2
|
+
import type { JsxAttributes, Node, ObjectLiteralElement, ObjectLiteralExpression, PropertyName, SourceFile, Symbol, TextChangeRange, UnderscoreEscapedMap } from "@tslite/parser";
|
|
3
|
+
import type { EmitTextWriter } from "@tslite/printer";
|
|
4
|
+
import type { CancellationToken, Type, TypeChecker } from "@tslite/checker";
|
|
5
|
+
import type { DocumentRegistry, EditorOptions, EditorSettings, FormatCodeOptions, FormatCodeSettings, HostCancellationToken, IScriptSnapshot, LanguageService, LanguageServiceHost, SymbolDisplayPart } from "./_namespaces/ts.js";
|
|
3
6
|
/** A versão da API do language service. */
|
|
4
7
|
export declare const servicesVersion = "0.8";
|
|
5
8
|
export interface DisplayPartsSymbolWriter extends EmitTextWriter {
|
package/dist/signatureHelp.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { CallLikeExpression,
|
|
1
|
+
import type { CallLikeExpression, Node, SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, CheckResult } from "@tslite/checker";
|
|
3
|
+
import type { SignatureHelpItems, SignatureHelpTriggerReason } from "./_namespaces/ts.js";
|
|
2
4
|
export declare function getSignatureHelpItems(program: CheckResult, sourceFile: SourceFile, position: number, triggerReason: SignatureHelpTriggerReason | undefined, cancellationToken: CancellationToken): SignatureHelpItems | undefined;
|
|
3
5
|
export interface ArgumentInfoForCompletions {
|
|
4
6
|
readonly invocation: CallLikeExpression;
|
package/dist/smartSelection.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { SelectionRange } from "./_namespaces/ts.js";
|
|
2
3
|
export declare function getSmartSelectionRange(pos: number, sourceFile: SourceFile): SelectionRange;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Node, SourceFile, UserPreferences } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, TypeChecker } from "@tslite/checker";
|
|
3
|
+
import type { CompletionEntryDetails, CompletionInfo, LanguageServiceHost } from "./_namespaces/ts.js";
|
|
2
4
|
import type { Log } from "./_namespaces/ts.Completions.js";
|
|
3
5
|
export declare function getStringLiteralCompletions(sourceFile: SourceFile, position: number, contextToken: Node | undefined, checker: TypeChecker, _host: LanguageServiceHost, log: Log, preferences: UserPreferences): CompletionInfo | undefined;
|
|
4
6
|
export declare function getStringLiteralCompletionDetails(name: string, sourceFile: SourceFile, position: number, contextToken: Node | undefined, checker: TypeChecker, _host: LanguageServiceHost, cancellationToken: CancellationToken): CompletionEntryDetails | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { CallExpression,
|
|
1
|
+
import type { CallExpression, DiagnosticWithLocation, Node, ReturnStatement, SourceFile } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, CheckResult, TypeChecker } from "@tslite/checker";
|
|
2
3
|
export declare function computeSuggestionDiagnostics(sourceFile: SourceFile, program: CheckResult, cancellationToken: CancellationToken): DiagnosticWithLocation[];
|
|
3
|
-
export declare function isReturnStatementWithFixablePromiseHandler(node: Node): node is ReturnStatement & {
|
|
4
|
+
export declare function isReturnStatementWithFixablePromiseHandler(node: Node, checker: TypeChecker): node is ReturnStatement & {
|
|
4
5
|
expression: CallExpression;
|
|
5
6
|
};
|
|
6
|
-
export declare function isFixablePromiseHandler(node: Node): boolean;
|
|
7
|
+
export declare function isFixablePromiseHandler(node: Node, checker: TypeChecker): boolean;
|
package/dist/symbolDisplay.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ScriptElementKind, SemanticMeaning } from "./_namespaces/ts.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Node, SourceFile, Symbol } from "@tslite/parser";
|
|
3
|
+
import type { TypeChecker } from "@tslite/checker";
|
|
4
|
+
import type { JSDocTagInfo, SymbolDisplayPart } from "./_namespaces/ts.js";
|
|
3
5
|
export declare function getSymbolKind(typeChecker: TypeChecker, symbol: Symbol, location: Node): ScriptElementKind;
|
|
4
6
|
export declare function getSymbolModifiers(symbol: Symbol): string;
|
|
5
7
|
interface SymbolDisplayPartsDocumentationAndSymbolKind {
|
package/dist/textChanges.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ScriptKind, SyntaxKind
|
|
2
|
-
import
|
|
1
|
+
import { ScriptKind, SyntaxKind } from "@tslite/parser";
|
|
2
|
+
import { formatting } from "./_namespaces/edit.js";
|
|
3
|
+
import type { DeclarationStatement, Expression, Modifier, Node, NodeArray, ObjectLiteralElementLike, ObjectLiteralExpression, ParameterDeclaration, PropertyAssignment, PropertySignature, SignatureDeclaration, SourceFile, Statement, TextRange, TypeNode, TypeParameterDeclaration, UserPreferences, VariableDeclaration, VariableStatement } from "@tslite/parser";
|
|
4
|
+
import type { FileTextChanges, LanguageServiceHost, TextChange } from "@tslite/services";
|
|
3
5
|
export interface ConfigurableStart {
|
|
4
6
|
leadingTriviaOption?: LeadingTriviaOption;
|
|
5
7
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Declaration, Diagnostic, DiagnosticWithLocation, LineAndCharacter, Map, NodeArray, ScriptKind, SignatureDeclaration, SourceFile, Symbol, SymbolFlags, TextChangeRange, TextRange, TextSpan, UnderscoreEscapedMap, UserPreferences, __String } from "@tslite/parser";
|
|
2
|
+
import type { CancellationToken, CheckResult, IntersectionType, LiteralType, NumberLiteralType, StringLiteralType, TypeFlags, TypeParameter, UnionOrIntersectionType, UnionType } from "@tslite/checker";
|
|
3
|
+
import type { DocumentHighlights } from "./_namespaces/ts.js";
|
|
2
4
|
import type { textChanges } from "./_namespaces/edit.js";
|
|
3
5
|
declare module "@tslite/parser" {
|
|
4
6
|
interface Node {
|
|
@@ -514,7 +516,6 @@ export interface FormatCodeOptions extends EditorOptions {
|
|
|
514
516
|
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean;
|
|
515
517
|
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean;
|
|
516
518
|
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
|
|
517
|
-
InsertSpaceAfterTypeAssertion?: boolean;
|
|
518
519
|
InsertSpaceBeforeFunctionParenthesis?: boolean;
|
|
519
520
|
PlaceOpenBraceOnNewLineForFunctions: boolean;
|
|
520
521
|
PlaceOpenBraceOnNewLineForControlBlocks: boolean;
|
|
@@ -533,7 +534,6 @@ export interface FormatCodeSettings extends EditorSettings {
|
|
|
533
534
|
readonly insertSpaceAfterOpeningAndBeforeClosingEmptyBraces?: boolean;
|
|
534
535
|
readonly insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean;
|
|
535
536
|
readonly insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean;
|
|
536
|
-
readonly insertSpaceAfterTypeAssertion?: boolean;
|
|
537
537
|
readonly insertSpaceBeforeFunctionParenthesis?: boolean;
|
|
538
538
|
readonly placeOpenBraceOnNewLineForFunctions?: boolean;
|
|
539
539
|
readonly placeOpenBraceOnNewLineForControlBlocks?: boolean;
|
package/dist/utilities.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { Map,
|
|
2
|
-
import
|
|
1
|
+
import { Map, ScriptKind, ScriptTarget, SymbolFlags, SyntaxKind } from "@tslite/parser";
|
|
2
|
+
import { SymbolFormatFlags, TypeFormatFlags } from "@tslite/checker";
|
|
3
|
+
import { ScriptElementKind, SymbolDisplayPartKind } from "./_namespaces/ts.js";
|
|
4
|
+
import type { BindingElement, CallExpression, CaseClause, CommentKind, CommentRange, Declaration, EqualityOperator, Expression, Identifier, ImportClause, ImportDeclaration, ImportSpecifier, Modifier, NoSubstitutionTemplateLiteral, Node, NodeArray, NumericLiteral, PropertyName, Scanner, SourceFile, SourceFileLike, Statement, StringLiteral, StringLiteralLike, Symbol, SyntaxList, TemplateExpression, TextRange, TextSpan, Token, TypeNode, UserPreferences, __String } from "@tslite/parser";
|
|
5
|
+
import type { ModuleSpecifierResolutionHost } from "@tslite/printer";
|
|
6
|
+
import type { CheckResult, Signature, Type, TypeChecker } from "@tslite/checker";
|
|
7
|
+
import type { DisplayPartsSymbolWriter, FileTextChanges, FormatCodeSettings, FormattingHost, IScriptSnapshot, LanguageServiceHost, RefactorContext, SymbolDisplayPart, TextChange } from "./_namespaces/ts.js";
|
|
3
8
|
import type { textChanges } from "./_namespaces/edit.js";
|
|
4
9
|
export declare const scanner: Scanner;
|
|
5
10
|
export declare enum SemanticMeaning {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tslite/services",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "The tsc 3.9.10 language service, copied from the tag and cut down to the TSLite Language, over the copy of the tsc checker",
|
|
5
5
|
"author": "Anderson D. Rosa <andersondrosa@outlook.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -24,11 +24,13 @@
|
|
|
24
24
|
"NOTICE"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tslite/checker": "1.
|
|
28
|
-
"@tslite/
|
|
27
|
+
"@tslite/checker": "1.17.0",
|
|
28
|
+
"@tslite/binder": "1.17.0",
|
|
29
|
+
"@tslite/parser": "1.17.0",
|
|
30
|
+
"@tslite/printer": "1.17.0"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@tslite/oracle": "0.1.
|
|
33
|
+
"@tslite/oracle": "0.1.3"
|
|
32
34
|
},
|
|
33
35
|
"repository": {
|
|
34
36
|
"type": "git",
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
"access": "public"
|
|
40
42
|
},
|
|
41
43
|
"scripts": {
|
|
42
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json && node ../../scripts/copy-declarations.mjs dist",
|
|
44
|
+
"build": "rm -rf dist && tsup && tsc -p tsconfig.build.json --emitDeclarationOnly && node ../../scripts/copy-declarations.mjs dist",
|
|
43
45
|
"clean": "rm -rf dist",
|
|
44
46
|
"test": "vitest run",
|
|
45
47
|
"accept": "node bin/accept.ts",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// O namespace `ts.codefix` do outFile da tag: o registro dos code fixes e os fixes que já vieram.
|
|
2
|
-
export * from "../codeFixProvider.js";
|
|
3
|
-
export * from "../codefixes/addConvertToUnknownForNonOverlappingTypes.js";
|
|
4
|
-
export * from "../codefixes/addEmptyExportDeclaration.js";
|
|
5
|
-
export * from "../codefixes/addMissingAsync.js";
|
|
6
|
-
export * from "../codefixes/addMissingAwait.js";
|
|
7
|
-
export * from "../codefixes/addMissingConst.js";
|
|
8
|
-
export * from "../codefixes/addNameToNamelessParameter.js";
|
|
9
|
-
export * from "../codefixes/convertToAsyncFunction.js";
|
|
10
|
-
export * from "../codefixes/correctQualifiedNameToIndexedAccessType.js";
|
|
11
|
-
export * from "../codefixes/importFixes.js";
|
|
12
|
-
export * from "../codefixes/fixSpelling.js";
|
|
13
|
-
export * from "../codefixes/returnValueCorrect.js";
|
|
14
|
-
export * from "../codefixes/fixInvalidJsxCharacters.js";
|
|
15
|
-
export * from "../codefixes/fixUnusedIdentifier.js";
|
|
16
|
-
export * from "../codefixes/fixUnreachableCode.js";
|
|
17
|
-
export * from "../codefixes/fixMissingCallParentheses.js";
|
|
18
|
-
export * from "../codefixes/fixAwaitInSyncFunction.js";
|
|
19
|
-
export * from "../codefixes/inferFromUsage.js";
|
|
20
|
-
export * from "../codefixes/helpers.js";
|
|
21
|
-
export * from "../codefixes/useBigintLiteral.js";
|
|
22
|
-
export * from "../codefixes/fixAddModuleReferTypeMissingTypeof.js";
|
|
23
|
-
export * from "../codefixes/convertToMappedObjectType.js";
|
|
24
|
-
export * from "../codefixes/removeUnnecessaryAwait.js";
|
|
25
|
-
export * from "../codefixes/splitTypeOnlyImport.js";
|
|
26
|
-
export * from "../codefixes/convertConstToLet.js";
|
|
27
|
-
export * from "../codefixes/fixExpectedComma.js";
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// O namespace `ts.formatting` do outFile da tag.
|
|
2
|
-
export * from "../formatting/formattingContext.js";
|
|
3
|
-
export * from "../formatting/formattingScanner.js";
|
|
4
|
-
export * from "../formatting/rule.js";
|
|
5
|
-
export * from "../formatting/rules.js";
|
|
6
|
-
export * from "../formatting/rulesMap.js";
|
|
7
|
-
export * from "../formatting/formatting.js";
|
|
8
|
-
export * from "../formatting/smartIndenter.js";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// O namespace `ts.refactor` do outFile da tag: o registro dos refactors e os refactors que já vieram.
|
|
2
|
-
export * from "../refactorProvider.js";
|
|
3
|
-
export * from "../refactors/convertExport.js";
|
|
4
|
-
export * from "../refactors/convertImport.js";
|
|
5
|
-
export * as extractSymbol from "./ts.refactor.extractSymbol.js";
|
|
6
|
-
export * from "../refactors/extractType.js";
|
|
7
|
-
export * from "../refactors/moveToNewFile.js";
|
|
8
|
-
export * as addOrRemoveBracesToArrowFunction from "./ts.refactor.addOrRemoveBracesToArrowFunction.js";
|
|
9
|
-
export * as convertParamsToDestructuredObject from "./ts.refactor.convertParamsToDestructuredObject.js";
|
|
10
|
-
export * as convertStringOrTemplateLiteral from "./ts.refactor.convertStringOrTemplateLiteral.js";
|