Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃 Pick PR #45391 (Some cleanup around inlay hints typ...) into release-4.4 #45529

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/harness/client.ts
Expand Up @@ -653,7 +653,7 @@ namespace ts.server {

return response.body!.map(item => ({ // TODO: GH#18217
...item,
kind: item.kind as InlayHintKind | undefined,
kind: item.kind as InlayHintKind,
position: this.lineOffsetToPosition(file, item.position),
}));
}
Expand Down
8 changes: 2 additions & 6 deletions src/server/protocol.ts
Expand Up @@ -2562,11 +2562,7 @@ namespace ts.server.protocol {
body?: SignatureHelpItems;
}

export const enum InlayHintKind {
Type = "Type",
Parameter = "Parameter",
Enum = "Enum",
}
export type InlayHintKind = "Type" | "Parameter" | "Enum";

export interface InlayHintsRequestArgs extends FileRequestArgs {
/**
Expand All @@ -2587,7 +2583,7 @@ namespace ts.server.protocol {
export interface InlayHintItem {
text: string;
position: Location;
kind?: InlayHintKind;
kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/session.ts
Expand Up @@ -1452,7 +1452,7 @@ namespace ts.server {
});
}

private provideInlayHints(args: protocol.InlayHintsRequestArgs) {
private provideInlayHints(args: protocol.InlayHintsRequestArgs): readonly protocol.InlayHintItem[] {
const { file, project } = this.getFileAndProject(args);
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file)!;
const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file));
Expand Down
2 changes: 1 addition & 1 deletion src/services/types.ts
Expand Up @@ -720,7 +720,7 @@ namespace ts {
export interface InlayHint {
text: string;
position: number;
kind?: InlayHintKind;
kind: InlayHintKind;
whitespaceBefore?: boolean;
whitespaceAfter?: boolean;
}
Expand Down