Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a92a594

Browse filesBrowse files
author
Andy
authored
LanguageServiceShim.getCompletionEntryDetails: Support undefined options (microsoft#20810)
* LanguageServiceShim.getCompletionEntryDetails: Support undefined options * Fix lint
1 parent 8173733 commit a92a594
Copy full SHA for a92a594

1 file changed

+5-3Lines changed: 5 additions & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/services/shims.ts‎

Copy file name to clipboardExpand all lines: src/services/shims.ts
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ namespace ts {
141141
getEncodedSemanticClassifications(fileName: string, start: number, length: number): string;
142142

143143
getCompletionsAtPosition(fileName: string, position: number, options: GetCompletionsAtPositionOptions | undefined): string;
144-
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined): string;
144+
// tslint:disable-next-line type-operator-spacing (false positive)
145+
getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined): string;
145146

146147
getQuickInfoAtPosition(fileName: string, position: number): string;
147148

@@ -906,11 +907,12 @@ namespace ts {
906907
}
907908

908909
/** Get a string based representation of a completion list entry details */
909-
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/, source: string | undefined) {
910+
// tslint:disable-next-line type-operator-spacing (false positive)
911+
public getCompletionEntryDetails(fileName: string, position: number, entryName: string, options: string/*Services.FormatCodeOptions*/ | undefined, source: string | undefined) {
910912
return this.forwardJSONCall(
911913
`getCompletionEntryDetails('${fileName}', ${position}, '${entryName}')`,
912914
() => {
913-
const localOptions: ts.FormatCodeOptions = JSON.parse(options);
915+
const localOptions: ts.FormatCodeOptions = options === undefined ? undefined : JSON.parse(options);
914916
return this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source);
915917
}
916918
);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.