Skip to content

Commit cf8e348

Browse files
committed
fix: make type-driven completions publically available with typescript@next
1 parent 19c0a03 commit cf8e348

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/configurationType.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export type Configuration = {
116116
'suggestions.keywordsInsertText': 'none' | 'space'
117117
/**
118118
* Will be `format-short` by default in future as super useful!
119-
* Requires symbol patch
119+
* Requires TypeScript 5.0+
120120
* @default disable
121121
*/
122122
'suggestions.displayImportedInfo': 'disable' | 'short-format' | 'long-format'
@@ -439,7 +439,7 @@ export type Configuration = {
439439
'objectLiteralCompletions.keepOriginal': 'below' | 'above' | 'remove'
440440
/**
441441
* Wether to exclude non-JSX components completions in JSX component locations
442-
* Requires `completion-symbol` patch
442+
* Requires TypeScript 5.0+
443443
* @default false
444444
*/
445445
'experiments.excludeNonJsxCompletions': boolean
@@ -487,7 +487,7 @@ export type Configuration = {
487487
/**
488488
* Enable to display additional information about source declaration in completion's documentation
489489
* For now only displays function's body
490-
* Requires symbol patch
490+
* Requires TypeScript 5.0+
491491
* @default false
492492
*/
493493
displayAdditionalInfoInCompletions: boolean

typescript/src/completionsAtPosition.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,16 @@ export const getCompletionsAtPosition = (
8383
const unpatch = patchBuiltinMethods(c, languageService, isCheckedFile)
8484
const getPrior = () => {
8585
try {
86-
return languageService.getCompletionsAtPosition(fileName, position, options, formatOptions)
86+
return languageService.getCompletionsAtPosition(
87+
fileName,
88+
position,
89+
{
90+
...options,
91+
//@ts-expect-error remove when updated to ts5.0
92+
includeSymbol: true,
93+
},
94+
formatOptions,
95+
)
8796
} finally {
8897
unpatch?.()
8998
}

0 commit comments

Comments
 (0)