Skip to content

Commit 885d4d6

Browse files
Remove "generate types" code (microsoft#31075)
1 parent b47194b commit 885d4d6

29 files changed

+18
-2058
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"gulp-rename": "latest",
6969
"gulp-sourcemaps": "latest",
7070
"istanbul": "latest",
71-
"lodash": "^4.17.11",
7271
"merge2": "latest",
7372
"minimist": "latest",
7473
"mkdirp": "latest",

src/compiler/diagnosticMessages.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4919,14 +4919,6 @@
49194919
"category": "Message",
49204920
"code": 95066
49214921
},
4922-
"Generate types for '{0}'": {
4923-
"category": "Message",
4924-
"code": 95067
4925-
},
4926-
"Generate types for all packages without types": {
4927-
"category": "Message",
4928-
"code": 95068
4929-
},
49304922
"Add 'unknown' conversion for non-overlapping types": {
49314923
"category": "Message",
49324924
"code": 95069

src/compiler/inspectValue.ts

Lines changed: 0 additions & 162 deletions
This file was deleted.

src/compiler/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@
5353
"moduleSpecifiers.ts",
5454
"watch.ts",
5555
"tsbuild.ts",
56-
"inspectValue.ts",
5756
]
5857
}

src/harness/fourslash.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3068,19 +3068,6 @@ Actual: ${stringify(fullActual)}`);
30683068
return this.languageService.getApplicableRefactors(fileName, positionOrRange, preferences) || ts.emptyArray;
30693069
}
30703070

3071-
public generateTypes(examples: ReadonlyArray<FourSlashInterface.GenerateTypesOptions>): void {
3072-
for (const { name = "example", value, global, output, outputBaseline } of examples) {
3073-
const actual = (global ? ts.generateTypesForGlobal : ts.generateTypesForModule)(name, value, this.formatCodeSettings);
3074-
if (outputBaseline) {
3075-
if (actual === undefined) throw ts.Debug.fail();
3076-
Harness.Baseline.runBaseline(ts.combinePaths("generateTypes", outputBaseline + ts.Extension.Dts), actual);
3077-
}
3078-
else {
3079-
assert.equal(actual, output, `generateTypes output for ${name} does not match`);
3080-
}
3081-
}
3082-
}
3083-
30843071
public configurePlugin(pluginName: string, configuration: any): void {
30853072
(<ts.server.SessionClient>this.languageService).configurePlugin(pluginName, configuration);
30863073
}
@@ -4140,19 +4127,6 @@ namespace FourSlashInterface {
41404127
public noMoveToNewFile(): void {
41414128
this.state.noMoveToNewFile();
41424129
}
4143-
4144-
public generateTypes(...options: GenerateTypesOptions[]): void {
4145-
this.state.generateTypes(options);
4146-
}
4147-
}
4148-
4149-
export interface GenerateTypesOptions {
4150-
readonly name?: string;
4151-
readonly value: unknown;
4152-
readonly global?: boolean;
4153-
// Exactly one of these should be set:
4154-
readonly output?: string;
4155-
readonly outputBaseline?: string;
41564130
}
41574131

41584132
export class Edit {

src/jsTyping/shared.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ namespace ts.server {
44
export const ActionSet: ActionSet = "action::set";
55
export const ActionInvalidate: ActionInvalidate = "action::invalidate";
66
export const ActionPackageInstalled: ActionPackageInstalled = "action::packageInstalled";
7-
export const ActionValueInspected: ActionValueInspected = "action::valueInspected";
87
export const EventTypesRegistry: EventTypesRegistry = "event::typesRegistry";
98
export const EventBeginInstallTypes: EventBeginInstallTypes = "event::beginInstallTypes";
109
export const EventEndInstallTypes: EventEndInstallTypes = "event::endInstallTypes";

src/jsTyping/types.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ declare namespace ts.server {
22
export type ActionSet = "action::set";
33
export type ActionInvalidate = "action::invalidate";
44
export type ActionPackageInstalled = "action::packageInstalled";
5-
export type ActionValueInspected = "action::valueInspected";
65
export type EventTypesRegistry = "event::typesRegistry";
76
export type EventBeginInstallTypes = "event::beginInstallTypes";
87
export type EventEndInstallTypes = "event::endInstallTypes";
98
export type EventInitializationFailed = "event::initializationFailed";
109

1110
export interface TypingInstallerResponse {
12-
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | ActionValueInspected | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
11+
readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed;
1312
}
1413

1514
export interface TypingInstallerRequestWithProjectName {
1615
readonly projectName: string;
1716
}
1817

1918
/* @internal */
20-
export type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest | InspectValueRequest;
19+
export type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest;
2120

2221
export interface DiscoverTypings extends TypingInstallerRequestWithProjectName {
2322
readonly fileNames: string[];
@@ -44,12 +43,6 @@ declare namespace ts.server {
4443
readonly projectRootPath: Path;
4544
}
4645

47-
/* @internal */
48-
export interface InspectValueRequest {
49-
readonly kind: "inspectValue";
50-
readonly options: InspectValueOptions;
51-
}
52-
5346
/* @internal */
5447
export interface TypesRegistryResponse extends TypingInstallerResponse {
5548
readonly kind: EventTypesRegistry;
@@ -62,12 +55,6 @@ declare namespace ts.server {
6255
readonly message: string;
6356
}
6457

65-
/* @internal */
66-
export interface InspectValueResponse {
67-
readonly kind: ActionValueInspected;
68-
readonly result: ValueInfo;
69-
}
70-
7158
export interface InitializationFailedResponse extends TypingInstallerResponse {
7259
readonly kind: EventInitializationFailed;
7360
readonly message: string;
@@ -115,5 +102,5 @@ declare namespace ts.server {
115102
}
116103

117104
/* @internal */
118-
export type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InspectValueResponse | InstallTypes | InitializationFailedResponse;
105+
export type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse;
119106
}

src/server/project.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,6 @@ namespace ts.server {
277277
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult> {
278278
return this.typingsCache.installPackage({ ...options, projectName: this.projectName, projectRootPath: this.toPath(this.currentDirectory) });
279279
}
280-
/* @internal */
281-
inspectValue(options: InspectValueOptions): Promise<ValueInfo> {
282-
return this.typingsCache.inspectValue(options);
283-
}
284280

285281
private get typingsCache(): TypingsCache {
286282
return this.projectService.typingsCache;

src/server/typingsCache.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace ts.server {
88
export interface ITypingsInstaller {
99
isKnownTypesPackageName(name: string): boolean;
1010
installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
11-
/* @internal */
12-
inspectValue(options: InspectValueOptions): Promise<ValueInfo>;
1311
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
1412
attach(projectService: ProjectService): void;
1513
onProjectClosed(p: Project): void;
@@ -20,7 +18,6 @@ namespace ts.server {
2018
isKnownTypesPackageName: returnFalse,
2119
// Should never be called because we never provide a types registry.
2220
installPackage: notImplemented,
23-
inspectValue: notImplemented,
2421
enqueueInstallTypingsRequest: noop,
2522
attach: noop,
2623
onProjectClosed: noop,
@@ -98,10 +95,6 @@ namespace ts.server {
9895
return this.installer.installPackage(options);
9996
}
10097

101-
inspectValue(options: InspectValueOptions): Promise<ValueInfo> {
102-
return this.installer.inspectValue(options);
103-
}
104-
10598
enqueueInstallTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray<string> | undefined, forceRefresh: boolean) {
10699
const typeAcquisition = project.getTypeAcquisition();
107100

0 commit comments

Comments
 (0)