@@ -10055,12 +10055,42 @@ declare namespace ts {
10055
10055
includeInsertTextCompletions?: boolean;
10056
10056
}
10057
10057
type SignatureHelpTriggerCharacter = "," | "(" | "<";
10058
+ type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
10058
10059
interface SignatureHelpItemsOptions {
10060
+ triggerReason?: SignatureHelpTriggerReason;
10061
+ }
10062
+ type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
10063
+ /**
10064
+ * Signals that the user manually requested signature help.
10065
+ * The language service will unconditionally attempt to provide a result.
10066
+ */
10067
+ interface SignatureHelpInvokedReason {
10068
+ kind: "invoked";
10069
+ triggerCharacter?: undefined;
10070
+ }
10071
+ /**
10072
+ * Signals that the signature help request came from a user typing a character.
10073
+ * Depending on the character and the syntactic context, the request may or may not be served a result.
10074
+ */
10075
+ interface SignatureHelpCharacterTypedReason {
10076
+ kind: "characterTyped";
10059
10077
/**
10060
- * If the editor is asking for signature help because a certain character was typed
10061
- * (as opposed to when the user explicitly requested them) this should be set.
10078
+ * Character that was responsible for triggering signature help.
10062
10079
*/
10063
- triggerCharacter?: SignatureHelpTriggerCharacter;
10080
+ triggerCharacter: SignatureHelpTriggerCharacter;
10081
+ }
10082
+ /**
10083
+ * Signals that this signature help request came from typing a character or moving the cursor.
10084
+ * This should only occur if a signature help session was already active and the editor needs to see if it should adjust.
10085
+ * The language service will unconditionally attempt to provide a result.
10086
+ * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move.
10087
+ */
10088
+ interface SignatureHelpRetriggeredReason {
10089
+ kind: "retrigger";
10090
+ /**
10091
+ * Character that was responsible for triggering signature help.
10092
+ */
10093
+ triggerCharacter?: SignatureHelpRetriggerCharacter;
10064
10094
}
10065
10095
interface ApplyCodeActionCommandResult {
10066
10096
successMessage: string;
@@ -11242,7 +11272,7 @@ declare namespace ts.Rename {
11242
11272
function getRenameInfo(program: Program, sourceFile: SourceFile, position: number): RenameInfo;
11243
11273
}
11244
11274
declare namespace ts.SignatureHelp {
11245
- function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, triggerCharacter: SignatureHelpTriggerCharacter | undefined, cancellationToken: CancellationToken): SignatureHelpItems | undefined;
11275
+ function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, triggerReason: SignatureHelpTriggerReason | undefined, cancellationToken: CancellationToken): SignatureHelpItems | undefined;
11246
11276
interface ArgumentInfoForCompletions {
11247
11277
readonly invocation: CallLikeExpression;
11248
11278
readonly argumentIndex: number;
@@ -12973,8 +13003,22 @@ declare namespace ts.server.protocol {
12973
13003
argumentCount: number;
12974
13004
}
12975
13005
type SignatureHelpTriggerCharacter = "," | "(" | "<";
13006
+ type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")";
12976
13007
interface SignatureHelpRequestArgs extends FileLocationRequestArgs {
12977
- triggerCharacter?: SignatureHelpTriggerCharacter;
13008
+ triggerReason?: SignatureHelpTriggerReason;
13009
+ }
13010
+ type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason;
13011
+ interface SignatureHelpInvokedReason {
13012
+ kind: "invoked";
13013
+ triggerCharacter?: undefined;
13014
+ }
13015
+ interface SignatureHelpCharacterTypedReason {
13016
+ kind: "characterTyped";
13017
+ triggerCharacter: SignatureHelpTriggerCharacter;
13018
+ }
13019
+ interface SignatureHelpRetriggeredReason {
13020
+ kind: "retrigger";
13021
+ triggerCharacter?: SignatureHelpRetriggerCharacter;
12978
13022
}
12979
13023
interface SignatureHelpRequest extends FileLocationRequest {
12980
13024
command: CommandTypes.SignatureHelp;
0 commit comments