Skip to content

Commit 95cf14d

Browse files
committed
fix plugin activation crash (thx to vsc integration tests)
1 parent 377399c commit 95cf14d

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

typescript/src/completionsAtPosition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ const arrayMoveItemToFrom = <T>(array: T[], originalItem: ArrayPredicate<T>, ite
341341
}
342342

343343
const patchBuiltinMethods = (c: GetConfig, languageService: ts.LanguageService, isCheckedFile: boolean) => {
344-
if (isTs5 && (isCheckedFile || !c('additionalIncludeExtensions').length)) return
344+
if (isTs5() && (isCheckedFile || !c('additionalIncludeExtensions').length)) return
345345

346346
let addFileExtensions: string[] | undefined
347347
const getAddFileExtensions = () => {

typescript/src/getPatchedNavTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig
8787
patches,
8888
returnModuleCode,
8989
skipStartMarker = false,
90-
}: PatchData = !isTs5
90+
}: PatchData = !isTs5()
9191
? {
9292
markerModuleStart: 'var NavigationBar;',
9393
markerModuleEnd: '(ts.NavigationBar = {}));',
@@ -115,7 +115,7 @@ const getPatchedNavModule = (additionalFeatures: AdditionalFeatures): { getNavig
115115
}
116116
const getModuleString = () => `module.exports = (ts, getNameFromJsxTag) => {\n${lines.join('\n')}\nreturn ${returnModuleCode}}`
117117
let moduleString = getModuleString()
118-
if (isTs5) {
118+
if (isTs5()) {
119119
const { languageService } = createLanguageService({
120120
'main.ts': moduleString,
121121
})

typescript/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const boostExistingSuggestions = (entries: ts.CompletionEntry[], predicat
118118
}
119119

120120
// semver: can't use compare as it incorrectly works with build postfix
121-
export const isTs5 = semver.major(ts.version) >= 5
121+
export const isTs5 = () => semver.major(ts.version) >= 5
122122

123123
// Workaround esbuild bundle modules
124124
export const nodeModules = __WEB__

0 commit comments

Comments
 (0)