mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
LanguageServiceShim.getCompletionEntryDetails: Support undefined options (#20810)
* LanguageServiceShim.getCompletionEntryDetails: Support undefined options * Fix lint
This commit is contained in:
parent
8173733ead
commit
a92a594ebe
@ -141,7 +141,8 @@ namespace ts {
|
||||
getEncodedSemanticClassifications(fileName: string, start: number, length: number): string;
|
||||
|
||||
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): string;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined): string;
|
||||
// tslint:disable-next-line type-operator-spacing (false positive)
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined): string;
|
||||
|
||||
getQuickInfoAtPosition(fileName: string, position: number): string;
|
||||
|
||||
@ -906,11 +907,12 @@ namespace ts {
|
||||
}
|
||||
|
||||
/** Get a string based representation of a completion list entry details */
|
||||
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined) {
|
||||
// tslint:disable-next-line type-operator-spacing (false positive)
|
||||
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined) {
|
||||
return this.forwardJSONCall(
|
||||
`getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`,
|
||||
() => {
|
||||
const localOptions: ts.FormatCodeOptions = JSON.parse(options);
|
||||
const localOptions: ts.FormatCodeOptions = options === undefined ? undefined : JSON.parse(options);
|
||||
return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source);
|
||||
}
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user