Add SignatureInformation.activateParmater

For #94637

Allows the active paramter to be be specified per signature instead of for all signatures. If provided, this overrides `SignatureHelp.activeParamter`
This commit is contained in:
Matt Bierner
2020-04-15 19:01:31 -07:00
parent 6903204820
commit be6b1dfaec
6 changed files with 40 additions and 12 deletions

View File

@@ -939,7 +939,8 @@ export namespace SignatureInformation {
return {
label: info.label,
documentation: info.documentation ? MarkdownString.fromStrict(info.documentation) : undefined,
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.from) : []
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.from) : [],
activeParameter: info.activeParameter,
};
}
@@ -947,7 +948,8 @@ export namespace SignatureInformation {
return {
label: info.label,
documentation: htmlContent.isMarkdownString(info.documentation) ? MarkdownString.to(info.documentation) : info.documentation,
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.to) : []
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.to) : [],
activeParameter: info.activeParameter,
};
}
}

View File

@@ -1291,6 +1291,7 @@ export class SignatureInformation {
label: string;
documentation?: string | MarkdownString;
parameters: ParameterInformation[];
activeParameter?: number;
constructor(label: string, documentation?: string | MarkdownString) {
this.label = label;