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 { public get bundledVersion(): TypeScriptVersion | null {
const file = requireFunc.resolve('typescript') try {
if (!file || !fs.existsSync(file)) { const file = requireFunc.resolve('typescript')
const bundledVersion = new TypeScriptVersion(
path.dirname(file),
'')
return bundledVersion
} catch (e) {
workspace.showMessage('Bundled typescript module not found', 'error') workspace.showMessage('Bundled typescript module not found', 'error')
return null return null
} }
const bundledVersion = new TypeScriptVersion(
path.dirname(file),
''
)
return bundledVersion
} }
} }