File tree 6 files changed +9
-17
lines changed
tests/baselines/reference/api
6 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -653,7 +653,7 @@ namespace ts.server {
653
653
654
654
return response . body ! . map ( item => ( { // TODO: GH#18217
655
655
...item ,
656
- kind : item . kind as InlayHintKind | undefined ,
656
+ kind : item . kind as InlayHintKind ,
657
657
position : this . lineOffsetToPosition ( file , item . position ) ,
658
658
} ) ) ;
659
659
}
Original file line number Diff line number Diff line change @@ -2562,11 +2562,7 @@ namespace ts.server.protocol {
2562
2562
body ?: SignatureHelpItems ;
2563
2563
}
2564
2564
2565
- export const enum InlayHintKind {
2566
- Type = "Type" ,
2567
- Parameter = "Parameter" ,
2568
- Enum = "Enum" ,
2569
- }
2565
+ export type InlayHintKind = "Type" | "Parameter" | "Enum" ;
2570
2566
2571
2567
export interface InlayHintsRequestArgs extends FileRequestArgs {
2572
2568
/**
@@ -2587,7 +2583,7 @@ namespace ts.server.protocol {
2587
2583
export interface InlayHintItem {
2588
2584
text : string ;
2589
2585
position : Location ;
2590
- kind ? : InlayHintKind ;
2586
+ kind : InlayHintKind ;
2591
2587
whitespaceBefore ?: boolean ;
2592
2588
whitespaceAfter ?: boolean ;
2593
2589
}
Original file line number Diff line number Diff line change @@ -1452,7 +1452,7 @@ namespace ts.server {
1452
1452
} ) ;
1453
1453
}
1454
1454
1455
- private provideInlayHints ( args : protocol . InlayHintsRequestArgs ) {
1455
+ private provideInlayHints ( args : protocol . InlayHintsRequestArgs ) : readonly protocol . InlayHintItem [ ] {
1456
1456
const { file, project } = this . getFileAndProject ( args ) ;
1457
1457
const scriptInfo = this . projectService . getScriptInfoForNormalizedPath ( file ) ! ;
1458
1458
const hints = project . getLanguageService ( ) . provideInlayHints ( file , args , this . getPreferences ( file ) ) ;
Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ namespace ts {
720
720
export interface InlayHint {
721
721
text : string ;
722
722
position : number ;
723
- kind ? : InlayHintKind ;
723
+ kind : InlayHintKind ;
724
724
whitespaceBefore ?: boolean ;
725
725
whitespaceAfter ?: boolean ;
726
726
}
Original file line number Diff line number Diff line change @@ -5887,7 +5887,7 @@ declare namespace ts {
5887
5887
interface InlayHint {
5888
5888
text: string;
5889
5889
position: number;
5890
- kind? : InlayHintKind;
5890
+ kind: InlayHintKind;
5891
5891
whitespaceBefore?: boolean;
5892
5892
whitespaceAfter?: boolean;
5893
5893
}
@@ -8740,11 +8740,7 @@ declare namespace ts.server.protocol {
8740
8740
interface SignatureHelpResponse extends Response {
8741
8741
body?: SignatureHelpItems;
8742
8742
}
8743
- enum InlayHintKind {
8744
- Type = "Type",
8745
- Parameter = "Parameter",
8746
- Enum = "Enum"
8747
- }
8743
+ type InlayHintKind = "Type" | "Parameter" | "Enum";
8748
8744
interface InlayHintsRequestArgs extends FileRequestArgs {
8749
8745
/**
8750
8746
* Start position of the span.
@@ -8762,7 +8758,7 @@ declare namespace ts.server.protocol {
8762
8758
interface InlayHintItem {
8763
8759
text: string;
8764
8760
position: Location;
8765
- kind? : InlayHintKind;
8761
+ kind: InlayHintKind;
8766
8762
whitespaceBefore?: boolean;
8767
8763
whitespaceAfter?: boolean;
8768
8764
}
Original file line number Diff line number Diff line change @@ -5887,7 +5887,7 @@ declare namespace ts {
5887
5887
interface InlayHint {
5888
5888
text : string ;
5889
5889
position : number ;
5890
- kind ? : InlayHintKind ;
5890
+ kind : InlayHintKind ;
5891
5891
whitespaceBefore ?: boolean ;
5892
5892
whitespaceAfter ?: boolean ;
5893
5893
}
You can’t perform that action at this time.
0 commit comments