cache error on require typescript module

This commit is contained in:
chemzqm 2019-06-27 14:28:21 +08:00
parent 09c17ab751
commit 87e09cfb18

View file

@ -116,15 +116,15 @@ export class TypeScriptVersionProvider {
}
public get bundledVersion(): TypeScriptVersion | null {
const file = requireFunc.resolve('typescript')
if (!file || !fs.existsSync(file)) {
try {
const file = requireFunc.resolve('typescript')
const bundledVersion = new TypeScriptVersion(
path.dirname(file),
'')
return bundledVersion
} catch (e) {
workspace.showMessage('Bundled typescript module not found', 'error')
return null
}
const bundledVersion = new TypeScriptVersion(
path.dirname(file),
''
)
return bundledVersion
}
}