typescript 7.1.0-dev.20261001.1 → 7.1.0-dev.20261003.1
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/dist/api/async/api.d.ts +73 -42
- package/dist/api/async/api.d.ts.map +1 -1
- package/dist/api/async/api.js +224 -68
- package/dist/api/async/api.js.map +1 -1
- package/dist/api/async/client.d.ts.map +1 -1
- package/dist/api/async/client.js +73 -16
- package/dist/api/async/client.js.map +1 -1
- package/dist/api/async/types.d.ts +4 -3
- package/dist/api/async/types.d.ts.map +1 -1
- package/dist/api/compilerOptions.generated.d.ts +123 -0
- package/dist/api/compilerOptions.generated.d.ts.map +1 -0
- package/dist/api/compilerOptions.generated.js +8 -0
- package/dist/api/compilerOptions.generated.js.map +1 -0
- package/dist/api/diagnosticFormatter.d.ts.map +1 -1
- package/dist/api/diagnosticFormatter.js.map +1 -1
- package/dist/api/fs.d.ts +10 -8
- package/dist/api/fs.d.ts.map +1 -1
- package/dist/api/fs.js.map +1 -1
- package/dist/api/node/encoder.generated.js +1 -1
- package/dist/api/node/encoder.generated.js.map +1 -1
- package/dist/api/node/node.d.ts +18 -10
- package/dist/api/node/node.d.ts.map +1 -1
- package/dist/api/node/node.generated.js +1 -1
- package/dist/api/node/node.generated.js.map +1 -1
- package/dist/api/node/node.infrastructure.d.ts.map +1 -1
- package/dist/api/node/node.infrastructure.js.map +1 -1
- package/dist/api/node/node.js +39 -11
- package/dist/api/node/node.js.map +1 -1
- package/dist/api/path.d.ts +46 -9
- package/dist/api/path.d.ts.map +1 -1
- package/dist/api/path.js +365 -28
- package/dist/api/path.js.map +1 -1
- package/dist/api/prepareCompilerOptions.generated.d.ts +5 -0
- package/dist/api/prepareCompilerOptions.generated.d.ts.map +1 -0
- package/dist/api/prepareCompilerOptions.generated.js +24 -0
- package/dist/api/prepareCompilerOptions.generated.js.map +1 -0
- package/dist/api/proto.generated.d.ts +223 -172
- package/dist/api/proto.generated.d.ts.map +1 -1
- package/dist/api/proto.generated.js +3 -0
- package/dist/api/proto.generated.js.map +1 -1
- package/dist/api/sourceFileCache.d.ts +15 -9
- package/dist/api/sourceFileCache.d.ts.map +1 -1
- package/dist/api/sourceFileCache.js +30 -12
- package/dist/api/sourceFileCache.js.map +1 -1
- package/dist/api/sync/api.d.ts +101 -49
- package/dist/api/sync/api.d.ts.map +1 -1
- package/dist/api/sync/api.js +314 -86
- package/dist/api/sync/api.js.map +1 -1
- package/dist/api/sync/types.d.ts +4 -3
- package/dist/api/sync/types.d.ts.map +1 -1
- package/dist/api/typedPaths.d.ts +3 -0
- package/dist/api/typedPaths.d.ts.map +1 -0
- package/dist/api/typedPaths.js +2 -0
- package/dist/api/typedPaths.js.map +1 -0
- package/dist/ast/ast.d.ts +58 -7
- package/dist/ast/ast.d.ts.map +1 -1
- package/dist/ast/ast.generated.d.ts +3 -3
- package/dist/ast/ast.generated.d.ts.map +1 -1
- package/dist/ast/factory.generated.d.ts +2 -2
- package/dist/ast/factory.generated.d.ts.map +1 -1
- package/dist/ast/factory.generated.js.map +1 -1
- package/dist/ast/is.generated.d.ts.map +1 -1
- package/dist/ast/is.generated.js +2 -1
- package/dist/ast/is.generated.js.map +1 -1
- package/dist/ast/scanner.d.ts.map +1 -1
- package/dist/ast/scanner.js +1 -0
- package/dist/ast/scanner.js.map +1 -1
- package/dist/enums/caseSensitivity.d.ts +2 -0
- package/dist/enums/caseSensitivity.d.ts.map +1 -0
- package/dist/enums/caseSensitivity.enum.d.ts +5 -0
- package/dist/enums/caseSensitivity.enum.d.ts.map +1 -0
- package/dist/enums/caseSensitivity.enum.js +7 -0
- package/dist/enums/caseSensitivity.enum.js.map +1 -0
- package/dist/enums/caseSensitivity.js +7 -0
- package/dist/enums/caseSensitivity.js.map +1 -0
- package/dist/enums/jsxEmit.enum.js +1 -1
- package/dist/enums/jsxEmit.enum.js.map +1 -1
- package/dist/enums/jsxEmit.js +1 -1
- package/dist/enums/jsxEmit.js.map +1 -1
- package/dist/enums/moduleDetectionKind.enum.js +1 -1
- package/dist/enums/moduleDetectionKind.enum.js.map +1 -1
- package/dist/enums/moduleDetectionKind.js +1 -1
- package/dist/enums/moduleDetectionKind.js.map +1 -1
- package/dist/enums/moduleKind.enum.js +1 -1
- package/dist/enums/moduleKind.enum.js.map +1 -1
- package/dist/enums/moduleKind.js +1 -1
- package/dist/enums/moduleKind.js.map +1 -1
- package/dist/enums/moduleResolutionKind.enum.js +1 -1
- package/dist/enums/moduleResolutionKind.enum.js.map +1 -1
- package/dist/enums/moduleResolutionKind.js +1 -1
- package/dist/enums/moduleResolutionKind.js.map +1 -1
- package/dist/enums/newLineKind.enum.js +1 -1
- package/dist/enums/newLineKind.enum.js.map +1 -1
- package/dist/enums/newLineKind.js +1 -1
- package/dist/enums/newLineKind.js.map +1 -1
- package/dist/enums/scriptTarget.d.ts.map +1 -1
- package/dist/enums/scriptTarget.enum.d.ts.map +1 -1
- package/dist/enums/scriptTarget.enum.js +1 -0
- package/dist/enums/scriptTarget.enum.js.map +1 -1
- package/dist/enums/scriptTarget.js +1 -0
- package/dist/enums/scriptTarget.js.map +1 -1
- package/dist/enums/syntaxKind.enum.d.ts +198 -197
- package/dist/enums/syntaxKind.enum.d.ts.map +1 -1
- package/dist/enums/syntaxKind.enum.js +199 -198
- package/dist/enums/syntaxKind.enum.js.map +1 -1
- package/dist/enums/syntaxKind.js +199 -198
- package/dist/enums/syntaxKind.js.map +1 -1
- package/dist/vscode/extensionApi.d.ts +56 -0
- package/dist/vscode/extensionApi.d.ts.map +1 -0
- package/dist/vscode/extensionApi.js +2 -0
- package/dist/vscode/extensionApi.js.map +1 -0
- package/dist/vscode/protocol.generated.d.ts +2886 -0
- package/dist/vscode/protocol.generated.d.ts.map +1 -0
- package/dist/vscode/protocol.generated.js +4 -0
- package/dist/vscode/protocol.generated.js.map +1 -0
- package/package.json +16 -9
- package/schemas/jsconfig.schema.json +2207 -0
- package/schemas/tsconfig.schema.json +2206 -0
package/dist/api/sync/api.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ import { SymbolOwnerKind } from "#enums/symbolOwnerKind";
|
|
|
18
18
|
import { TypeFlags } from "#enums/typeFlags";
|
|
19
19
|
import { TypeFormatFlags } from "#enums/typeFormatFlags";
|
|
20
20
|
import { TypePredicateKind } from "#enums/typePredicateKind";
|
|
21
|
-
import { type __String, type CallLikeExpression, type Declaration, type Expression, type FileReference, type Identifier, ModifierFlags, type NamedTupleMember, type Node, type ParameterDeclaration, type
|
|
21
|
+
import { type __String, type CallLikeExpression, type Declaration, type Expression, type FileReference, type Identifier, ModifierFlags, type NamedTupleMember, type Node, type ParameterDeclaration, type PathKey, type RootedDirectoryPath, type RootedFilePath, type SourceFile, type StringLiteralLikeNode, type SyntaxKind, type TypeNode } from "../../ast/index.ts";
|
|
22
22
|
import type { APIOptions, LSPConnectionOptions } from "../options.ts";
|
|
23
|
-
import type { BuildResponse, CleanBuildResponse, CompactSymbolReference, CompilerOptions, CompletionPreferences, ConfiguredProjectId, CreateBuildOrchestratorResponse, CreateProgramOptions as ProtocolCreateProgramOptions, CreateSnapshotParams as ProtocolCreateSnapshotParams, CreateSnapshotProgramParams as ProtocolCreateSnapshotProgramParams, CreateSnapshotResponse, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, FileNotifications, InferredProjectId, LanguageServerSnapshotChanges as ProtocolLanguageServerSnapshotChanges, ModuleResolutionEntry, ModuleResolutionSpec, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ProjectResponse, ProtocolSymbolResponse, ReadConfigFileResponse, ReconfigureSnapshotProgramParams as ProtocolReconfigureSnapshotProgramParams, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, StaticModuleResolution, SymbolPropertyMethod, SymbolReference, SymbolResponse, SymbolsPropertyMethod, SyntheticProjectId, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UserPreferences } from "../proto.ts";
|
|
23
|
+
import type { BuildResponse, CleanBuildResponse, CompactSymbolReference, CompilerOptions, CompletionPreferences, ConfiguredProjectId, CreateBuildOrchestratorResponse, CreateProgramOptions as ProtocolCreateProgramOptions, CreateSnapshotParams as ProtocolCreateSnapshotParams, CreateSnapshotProgramParams as ProtocolCreateSnapshotProgramParams, CreateSnapshotResponse, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, FileNotifications, InferredProjectId, LanguageServerSnapshotChanges as ProtocolLanguageServerSnapshotChanges, ModuleResolutionEntry, ModuleResolutionSpec, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ProjectResponse, ProtocolSymbolResponse, RawCompilerOptions, ReadConfigFileResponse, ReconfigureSnapshotProgramParams as ProtocolReconfigureSnapshotProgramParams, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SignaturePropertyMethod, SignatureResponse, SourceFileMetadata, StaticModuleResolution, SymbolPropertyMethod, SymbolReference, SymbolResponse, SymbolsPropertyMethod, SyntheticProjectId, TextEdit, TypeAcquisition, TypePropertyMethod, TypeResponse, TypesPropertyMethod, UserPreferences } from "../proto.ts";
|
|
24
24
|
import { type CachedSourceFile, SourceFileCache } from "../sourceFileCache.ts";
|
|
25
25
|
import type { RequestTiming, TimingAccumulators, TimingInfo } from "../timing.ts";
|
|
26
26
|
import { Client, type ClientSocketOptions, type ClientSpawnOptions } from "./client.ts";
|
|
@@ -28,7 +28,7 @@ import type { AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLi
|
|
|
28
28
|
export { formatDiagnostics, formatDiagnosticsWithColorAndContext } from "../diagnosticFormatter.ts";
|
|
29
29
|
export { documentURIToFileName, fileNameToDocumentURI } from "../path.ts";
|
|
30
30
|
export { CheckFlags, CompletionItemKind, DiagnosticCategory, ElementFlags, EmitOnly, IndexKind, JsxEmit, ModifierFlags, ModuleKind, ModuleResolutionKind, NodeBuilderFlags, ObjectFlags, ScriptKind, SignatureFlags, SignatureKind, SymbolFlags, SymbolOwnerKind, TypeFlags, TypeFormatFlags, TypePredicateKind };
|
|
31
|
-
export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, CompletionPreferences, ConditionalType, ConfiguredProjectId, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FileNotifications, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InferredProjectId, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, MappedType, ModuleResolutionEntry, ModuleResolutionSpec, NumberLiteralType, ObjectType, PackageId, ParsedCommandLine, ProjectId, ProjectReference, ReadConfigFileResponse, RequestTiming, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SourceFileMetadata, StaticModuleResolution, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, SyntheticProjectId, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, UserPreferences, };
|
|
31
|
+
export type { APIImportAdderAction as ImportAdderAction, APIOptions, AssertsIdentifierTypePredicate, AssertsThisTypePredicate, BigIntLiteralType, BooleanLiteralType, ClientSocketOptions, ClientSpawnOptions, CompilerOptions, CompletionEntry, CompletionInfo, CompletionOptions, CompletionPreferences, ConditionalType, ConfiguredProjectId, CreateSourceFileOptions, Diagnostic, DocumentIdentifier, DocumentPosition, EmitOutput, EmitOutputFile, EmitResult, FileNotifications, FormatDiagnosticsHost, FreshableType, GenericType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, IndexedAccessType, IndexInfo, IndexType, InferredProjectId, InterfaceType, IntersectionType, IntrinsicType, JSDocTagInfo, LiteralType, LSPConnectionOptions, MappedType, ModuleResolutionEntry, ModuleResolutionSpec, NumberLiteralType, ObjectType, PackageId, ParsedCommandLine, ProjectId, ProjectReference, RawCompilerOptions, ReadConfigFileResponse, RequestTiming, ResolutionMode, ResolvedModule, ResolvedTypeReferenceDirective, ResolveModuleNameResult, SourceFileMetadata, StaticModuleResolution, StringLiteralType, StringMappingType, StructuredType, SubstitutionType, SyntheticProjectId, TemplateLiteralType, TextEdit, ThisTypePredicate, TimingAccumulators, TimingInfo, TupleType, TupleTypeReference, Type, TypeAcquisition, TypeParameter, TypePredicate, TypePredicateBase, TypeReference, UnionOrIntersectionType, UnionType, UserPreferences, };
|
|
32
32
|
export interface ModuleResolverOptions {
|
|
33
33
|
moduleResolutions?: ModuleResolutionSpec | undefined;
|
|
34
34
|
resolveModuleName?: ResolveModuleNameCallback | undefined;
|
|
@@ -41,8 +41,11 @@ export type InProgressSnapshot = number & {
|
|
|
41
41
|
readonly [inProgressSnapshotBrand]: never;
|
|
42
42
|
};
|
|
43
43
|
export type ResolveModuleNameCallback = (moduleName: string, containingDirectory: string, resolutionMode: ResolutionMode | undefined, options: ResolveModuleNameCallbackOptions) => StaticModuleResolution | undefined;
|
|
44
|
-
export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver"> & {
|
|
44
|
+
export type CreateProgramOptions = Omit<ProtocolCreateProgramOptions, "moduleResolver" | "projectReferences"> & {
|
|
45
45
|
moduleResolver?: ModuleResolver | undefined;
|
|
46
|
+
projectReferences?: readonly (Omit<ProjectReference, "path"> & {
|
|
47
|
+
path: string;
|
|
48
|
+
})[] | undefined;
|
|
46
49
|
};
|
|
47
50
|
export type CreateSnapshotProgramParams = Omit<ProtocolCreateSnapshotProgramParams, "options"> & {
|
|
48
51
|
options?: CreateProgramOptions | undefined;
|
|
@@ -59,7 +62,7 @@ export type LanguageServerSnapshotChanges = Omit<ProtocolLanguageServerSnapshotC
|
|
|
59
62
|
reconfigurePrograms?: readonly ReconfigureSnapshotProgramParams[] | undefined;
|
|
60
63
|
};
|
|
61
64
|
export interface TranspileOptions {
|
|
62
|
-
compilerOptions?:
|
|
65
|
+
compilerOptions?: RawCompilerOptions | undefined;
|
|
63
66
|
fileName?: string | undefined;
|
|
64
67
|
reportDiagnostics?: boolean | undefined;
|
|
65
68
|
}
|
|
@@ -71,12 +74,14 @@ export interface TranspileOutput {
|
|
|
71
74
|
export { all, type AllAPIRequestGenerator, type AnyAPIRequestGenerator, type APIRequestGenerator, defer, type DeferredAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
|
|
72
75
|
import { type AnyAPIRequestGenerator, type ExecutedGeneratorsResults } from "./generatorSupport.ts";
|
|
73
76
|
export declare class API<FromLSP extends boolean = false> implements FormatDiagnosticsHost {
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
/** @internal */
|
|
78
|
+
readonly client: Client;
|
|
79
|
+
/** @internal */
|
|
80
|
+
readonly sourceFileCache: SourceFileCache<Symbol>;
|
|
76
81
|
private toPath;
|
|
77
|
-
private currentDirectory;
|
|
78
82
|
private readonly decoder;
|
|
79
|
-
private
|
|
83
|
+
private currentDirectory;
|
|
84
|
+
private caseSensitivity;
|
|
80
85
|
private initialized;
|
|
81
86
|
private initializing;
|
|
82
87
|
private activeSnapshots;
|
|
@@ -85,6 +90,14 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
|
|
|
85
90
|
readonly printer: Printer;
|
|
86
91
|
readonly internal: InternalAPI;
|
|
87
92
|
constructor(options?: APIOptions | LSPConnectionOptions);
|
|
93
|
+
/**
|
|
94
|
+
* Looks up a remote declaration's binder symbol. Throws for synthesized or configuration ASTs.
|
|
95
|
+
*/
|
|
96
|
+
get getSymbol(): {
|
|
97
|
+
(declaration: Declaration): Symbol;
|
|
98
|
+
gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
99
|
+
};
|
|
100
|
+
private get fetchDeclarationSymbol();
|
|
88
101
|
/**
|
|
89
102
|
* Create an API instance from an existing LSP connection's API session.
|
|
90
103
|
* Use this when connecting to an API pipe provided by an LSP server via custom/initializeAPISession.
|
|
@@ -96,8 +109,9 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
|
|
|
96
109
|
batch<T extends readonly AnyAPIRequestGenerator[]>(...requestGenerators: T): ExecutedGeneratorsResults<T>;
|
|
97
110
|
private get ensureInitialized();
|
|
98
111
|
private get initializeWorker();
|
|
99
|
-
getCurrentDirectory():
|
|
112
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
100
113
|
getCanonicalFileName(fileName: string): string;
|
|
114
|
+
private getCaseSensitivity;
|
|
101
115
|
getNewLine(): string;
|
|
102
116
|
get createBuildOrchestrator(): {
|
|
103
117
|
(rootNames: readonly string[], buildOrchestratorOptions: BuildOrchestratorOptions): BuildOrchestrator;
|
|
@@ -198,8 +212,8 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
|
|
|
198
212
|
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
199
213
|
};
|
|
200
214
|
get createModuleResolver(): {
|
|
201
|
-
(compilerOptions:
|
|
202
|
-
gen(compilerOptions:
|
|
215
|
+
(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): ModuleResolver;
|
|
216
|
+
gen(compilerOptions: RawCompilerOptions, options?: ModuleResolverOptions): Generator<ProtocolRequest, ModuleResolver, ProtocolResponse["result"]>;
|
|
203
217
|
};
|
|
204
218
|
clearSourceFileCache(): void;
|
|
205
219
|
get runWithTemporaryFileUpdate(): {
|
|
@@ -228,22 +242,26 @@ export declare class API<FromLSP extends boolean = false> implements FormatDiagn
|
|
|
228
242
|
};
|
|
229
243
|
/** Creates a program from current filesystem state. */
|
|
230
244
|
get createProgram(): {
|
|
231
|
-
(rootFiles: readonly DocumentIdentifier[], compilerOptions:
|
|
232
|
-
gen(rootFiles: readonly DocumentIdentifier[], compilerOptions:
|
|
245
|
+
(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Program;
|
|
246
|
+
gen(rootFiles: readonly DocumentIdentifier[], compilerOptions: RawCompilerOptions, createProgramOptions?: CreateProgramOptions): Generator<ProtocolRequest, Program, ProtocolResponse["result"]>;
|
|
233
247
|
};
|
|
234
248
|
}
|
|
235
249
|
type EnsureInitialized = (() => void) & {
|
|
236
250
|
gen(): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
237
251
|
};
|
|
252
|
+
/** Looks up a remote declaration's binder symbol through its API. Throws for non-remote declarations. */
|
|
253
|
+
export declare function getSymbol(declaration: Declaration): Symbol;
|
|
254
|
+
export declare namespace getSymbol {
|
|
255
|
+
function gen(declaration: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
256
|
+
}
|
|
238
257
|
/** An independently retained source file and its disposable remote-lifetime lease. */
|
|
239
258
|
export declare class RetainedSourceFile {
|
|
240
259
|
readonly sourceFile: SourceFile;
|
|
241
260
|
private readonly lease;
|
|
242
|
-
private readonly client;
|
|
243
261
|
private readonly onDispose;
|
|
244
262
|
private disposed;
|
|
245
263
|
private disposePromise;
|
|
246
|
-
constructor(sourceFile: SourceFile, lease: number,
|
|
264
|
+
constructor(sourceFile: SourceFile, lease: number, onDispose: () => void);
|
|
247
265
|
[globalThis.Symbol.dispose](): void;
|
|
248
266
|
get dispose(): {
|
|
249
267
|
(): void;
|
|
@@ -261,12 +279,12 @@ export declare class InternalAPI {
|
|
|
261
279
|
gen(dir: string): Generator<ProtocolRequest, void, ProtocolResponse["result"]>;
|
|
262
280
|
};
|
|
263
281
|
get stopCPUProfile(): {
|
|
264
|
-
():
|
|
265
|
-
gen(): Generator<ProtocolRequest,
|
|
282
|
+
(): RootedFilePath;
|
|
283
|
+
gen(): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
|
|
266
284
|
};
|
|
267
285
|
get saveHeapProfile(): {
|
|
268
|
-
(dir: string):
|
|
269
|
-
gen(dir: string): Generator<ProtocolRequest,
|
|
286
|
+
(dir: string): RootedFilePath;
|
|
287
|
+
gen(dir: string): Generator<ProtocolRequest, RootedFilePath, ProtocolResponse["result"]>;
|
|
270
288
|
};
|
|
271
289
|
}
|
|
272
290
|
type SnapshotUpdater = ((params: CreateSnapshotParams) => Snapshot) & {
|
|
@@ -321,7 +339,7 @@ export declare class Snapshot {
|
|
|
321
339
|
readonly operation: SnapshotOperation;
|
|
322
340
|
private projectMap;
|
|
323
341
|
private toPath;
|
|
324
|
-
private
|
|
342
|
+
private readonly api;
|
|
325
343
|
private disposed;
|
|
326
344
|
private disposePromise;
|
|
327
345
|
private onDispose;
|
|
@@ -329,7 +347,8 @@ export declare class Snapshot {
|
|
|
329
347
|
private projectDataMap;
|
|
330
348
|
private updateSnapshot;
|
|
331
349
|
readonly internal: SnapshotInternalAPI;
|
|
332
|
-
|
|
350
|
+
private get client();
|
|
351
|
+
constructor(data: CreateSnapshotResponse, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, onDispose: () => void, updateSnapshot: SnapshotUpdater, baseSnapshot?: Snapshot);
|
|
333
352
|
getProjects(): readonly Project[];
|
|
334
353
|
getConfiguredProject(configFileName: string): Project<ConfiguredProjectId> | undefined;
|
|
335
354
|
getProject<Id extends ProjectId>(projectId: Id): Project<Id> | undefined;
|
|
@@ -393,15 +412,15 @@ declare class SnapshotObjectRegistry {
|
|
|
393
412
|
clear(): void;
|
|
394
413
|
}
|
|
395
414
|
declare class ProjectObjectRegistry {
|
|
396
|
-
private client;
|
|
397
415
|
private snapshotId;
|
|
398
416
|
readonly project: Project;
|
|
399
417
|
private snapshotRegistry;
|
|
400
|
-
private sourceFileCache;
|
|
401
418
|
private types;
|
|
402
419
|
private signatures;
|
|
403
420
|
private disposed;
|
|
404
|
-
|
|
421
|
+
private get client();
|
|
422
|
+
private get sourceFileCache();
|
|
423
|
+
constructor(snapshotId: number, project: Project, snapshotRegistry: SnapshotObjectRegistry);
|
|
405
424
|
getOrCreateSymbol(data: ProtocolSymbolResponse): Symbol;
|
|
406
425
|
/** Find an already-interned symbol and retain its file record for this registry. */
|
|
407
426
|
getCachedSymbol(reference: CompactSymbolReference): Symbol | undefined;
|
|
@@ -467,21 +486,22 @@ declare class ProjectObjectRegistry {
|
|
|
467
486
|
};
|
|
468
487
|
}
|
|
469
488
|
export declare class Project<Id extends ProjectId = ProjectId> {
|
|
489
|
+
/** @internal */
|
|
490
|
+
readonly api: API<boolean>;
|
|
470
491
|
readonly id: Id;
|
|
471
|
-
readonly configFileName:
|
|
472
|
-
readonly currentDirectory:
|
|
492
|
+
readonly configFileName: RootedFilePath | undefined;
|
|
493
|
+
readonly currentDirectory: RootedDirectoryPath;
|
|
473
494
|
readonly dirty: boolean;
|
|
474
495
|
readonly parsedCommandLine: ParsedCommandLine;
|
|
475
496
|
/** @deprecated Use `parsedCommandLine.options`. */
|
|
476
497
|
readonly compilerOptions: CompilerOptions;
|
|
477
498
|
/** @deprecated Use `parsedCommandLine.fileNames`. */
|
|
478
|
-
readonly rootFiles: readonly
|
|
499
|
+
readonly rootFiles: readonly RootedFilePath[];
|
|
479
500
|
readonly program: Program<Id>;
|
|
480
501
|
readonly checker: Checker;
|
|
481
502
|
readonly languageService: LanguageService;
|
|
482
|
-
private client;
|
|
483
503
|
private snapshotId;
|
|
484
|
-
constructor(data: ProjectResponse, snapshotId: number,
|
|
504
|
+
constructor(data: ProjectResponse, snapshotId: number, toPath: (fileName: string, basePath?: string) => PathKey, api: API<boolean>, snapshotRegistry: SnapshotObjectRegistry);
|
|
485
505
|
/** @deprecated Use `languageService.getImportAdderEdits`. */
|
|
486
506
|
get getImportAdderEdits(): {
|
|
487
507
|
(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
|
|
@@ -497,9 +517,9 @@ export declare class Project<Id extends ProjectId = ProjectId> {
|
|
|
497
517
|
export declare class LanguageService {
|
|
498
518
|
private snapshotId;
|
|
499
519
|
private project;
|
|
500
|
-
private client;
|
|
501
520
|
private objectRegistry;
|
|
502
|
-
|
|
521
|
+
private get client();
|
|
522
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
503
523
|
get getImportAdderEdits(): {
|
|
504
524
|
(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): readonly TextEdit[];
|
|
505
525
|
gen(file: DocumentIdentifier, actions: readonly APIImportAdderAction[]): Generator<ProtocolRequest, readonly TextEdit[], ProtocolResponse["result"]>;
|
|
@@ -526,16 +546,15 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
|
|
|
526
546
|
readonly snapshotId: number;
|
|
527
547
|
readonly id: Id;
|
|
528
548
|
private readonly project;
|
|
529
|
-
private readonly client;
|
|
530
|
-
private readonly sourceFileCache;
|
|
531
549
|
private readonly toPath;
|
|
532
|
-
private readonly formatDiagnosticsHost;
|
|
533
550
|
private readonly decoder;
|
|
534
551
|
private readonly sourceFileMetadataCache;
|
|
535
552
|
private ownedSnapshot;
|
|
536
553
|
private disposePromise;
|
|
537
|
-
|
|
538
|
-
|
|
554
|
+
private get client();
|
|
555
|
+
private get sourceFileCache();
|
|
556
|
+
constructor(snapshotId: number, project: Project<Id>, toPath: (fileName: string, basePath?: string) => PathKey);
|
|
557
|
+
getCurrentDirectory(): RootedDirectoryPath;
|
|
539
558
|
getCanonicalFileName(fileName: string): string;
|
|
540
559
|
getNewLine(): string;
|
|
541
560
|
/** @internal */
|
|
@@ -551,6 +570,16 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
|
|
|
551
570
|
(file: DocumentIdentifier): SourceFile | undefined;
|
|
552
571
|
gen(file: DocumentIdentifier): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
|
|
553
572
|
};
|
|
573
|
+
/**
|
|
574
|
+
* Returns the source file for an already-canonical path.
|
|
575
|
+
*
|
|
576
|
+
* @internal
|
|
577
|
+
*/
|
|
578
|
+
get getSourceFileByPath(): {
|
|
579
|
+
(path: PathKey): SourceFile | undefined;
|
|
580
|
+
gen(path: PathKey): Generator<ProtocolRequest, SourceFile | undefined, ProtocolResponse["result"]>;
|
|
581
|
+
};
|
|
582
|
+
private get getSourceFileWorker();
|
|
554
583
|
get getResolvedModule(): {
|
|
555
584
|
(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): ResolvedModule | undefined;
|
|
556
585
|
gen(file: DocumentIdentifier, moduleName: string, mode: ModuleKind): Generator<ProtocolRequest, ResolvedModule | undefined, ProtocolResponse["result"]>;
|
|
@@ -576,8 +605,8 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
|
|
|
576
605
|
gen(typeReferenceDirective: FileReference, sourceFile: DocumentIdentifier): Generator<ProtocolRequest, ResolvedTypeReferenceDirective | undefined, ProtocolResponse["result"]>;
|
|
577
606
|
};
|
|
578
607
|
get getSourceFileNames(): {
|
|
579
|
-
(): readonly
|
|
580
|
-
gen(): Generator<ProtocolRequest, readonly
|
|
608
|
+
(): readonly RootedFilePath[];
|
|
609
|
+
gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
|
|
581
610
|
};
|
|
582
611
|
/**
|
|
583
612
|
* Returns program-stored metadata for the given source file, or `undefined` if the file
|
|
@@ -595,10 +624,11 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
|
|
|
595
624
|
* this `Program` instance.
|
|
596
625
|
*/
|
|
597
626
|
get getSourceFileMetadataByPath(): {
|
|
598
|
-
(path:
|
|
599
|
-
gen(path:
|
|
627
|
+
(path: PathKey): SourceFileMetadata | undefined;
|
|
628
|
+
gen(path: PathKey): Generator<ProtocolRequest, SourceFileMetadata | undefined, ProtocolResponse["result"]>;
|
|
600
629
|
};
|
|
601
630
|
private get fetchSourceFileMetadata();
|
|
631
|
+
private pathKeyForFileName;
|
|
602
632
|
/**
|
|
603
633
|
* Returns whether the given source file was loaded as part of an external library
|
|
604
634
|
* (e.g. a dependency resolved from `node_modules`). The underlying program metadata is
|
|
@@ -622,8 +652,8 @@ export declare class Program<Id extends ProjectId = ProjectId> implements Format
|
|
|
622
652
|
* Includes the root config file and any extended config files.
|
|
623
653
|
*/
|
|
624
654
|
get getConfigFileNames(): {
|
|
625
|
-
(): readonly
|
|
626
|
-
gen(): Generator<ProtocolRequest, readonly
|
|
655
|
+
(): readonly RootedFilePath[];
|
|
656
|
+
gen(): Generator<ProtocolRequest, readonly RootedFilePath[], ProtocolResponse["result"]>;
|
|
627
657
|
};
|
|
628
658
|
/**
|
|
629
659
|
* Get a config source file by file name/URI.
|
|
@@ -779,12 +809,35 @@ export declare class BuildOrchestrator {
|
|
|
779
809
|
export declare class Checker {
|
|
780
810
|
private snapshotId;
|
|
781
811
|
private project;
|
|
782
|
-
private client;
|
|
783
812
|
private objectRegistry;
|
|
784
813
|
private wellKnownSymbols;
|
|
785
814
|
private wellKnownSignatures;
|
|
786
|
-
|
|
815
|
+
private get client();
|
|
816
|
+
constructor(snapshotId: number, project: Project, objectRegistry: ProjectObjectRegistry);
|
|
787
817
|
dispose(): void;
|
|
818
|
+
/** Get the merged symbol, or the original symbol if it has not been merged. */
|
|
819
|
+
get getMergedSymbol(): {
|
|
820
|
+
(symbol: Symbol): Symbol;
|
|
821
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
822
|
+
};
|
|
823
|
+
/**
|
|
824
|
+
* Get a node's merged symbol. For a declaration, prefer
|
|
825
|
+
* {@link Checker.getSymbolOfDeclaration} for a non-nullable result.
|
|
826
|
+
*/
|
|
827
|
+
get getSymbolOfNode(): {
|
|
828
|
+
(node: Node): Symbol | undefined;
|
|
829
|
+
gen(node: Node): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
830
|
+
};
|
|
831
|
+
/** Get a declaration's merged symbol. */
|
|
832
|
+
get getSymbolOfDeclaration(): {
|
|
833
|
+
(node: Declaration): Symbol;
|
|
834
|
+
gen(node: Declaration): Generator<ProtocolRequest, Symbol, ProtocolResponse["result"]>;
|
|
835
|
+
};
|
|
836
|
+
/** Get a symbol's merged parent, if any. */
|
|
837
|
+
get getParentOfSymbol(): {
|
|
838
|
+
(symbol: Symbol): Symbol | undefined;
|
|
839
|
+
gen(symbol: Symbol): Generator<ProtocolRequest, Symbol | undefined, ProtocolResponse["result"]>;
|
|
840
|
+
};
|
|
788
841
|
get getSymbolAtLocation(): {
|
|
789
842
|
(node: Node): Symbol | undefined;
|
|
790
843
|
(nodes: readonly Node[]): (Symbol | undefined)[];
|
|
@@ -1286,7 +1339,7 @@ export declare class NodeHandle<out T extends Node = Node> {
|
|
|
1286
1339
|
private readonly fileOwner;
|
|
1287
1340
|
readonly index: number;
|
|
1288
1341
|
readonly kind: SyntaxKind;
|
|
1289
|
-
readonly path:
|
|
1342
|
+
readonly path: PathKey;
|
|
1290
1343
|
constructor(handle: string, canonicalProject: Project | undefined, fileOwner?: SourceFileOwner);
|
|
1291
1344
|
/**
|
|
1292
1345
|
* Resolve this handle to the actual AST node by fetching the source file from a project
|
|
@@ -1316,11 +1369,10 @@ export interface SignatureUsage {
|
|
|
1316
1369
|
/** The node handle for the call expression, if the reference is invoked. */
|
|
1317
1370
|
call?: NodeHandle | undefined;
|
|
1318
1371
|
}
|
|
1319
|
-
/** A cached source-file record and
|
|
1372
|
+
/** A cached source-file record and its owning API. */
|
|
1320
1373
|
interface SourceFileOwner {
|
|
1321
1374
|
readonly record: CachedSourceFile<Symbol>;
|
|
1322
|
-
readonly
|
|
1323
|
-
readonly client: Client;
|
|
1375
|
+
readonly api: API<boolean>;
|
|
1324
1376
|
}
|
|
1325
1377
|
type SymbolStorage = {
|
|
1326
1378
|
readonly kind: typeof SymbolOwnerKind.File;
|