简体   繁体   English

TSLint:WebStorm中的语言服务执行超时

[英]TSLint: Language service execution timeout in WebStorm

I'm currently using WebStorm (2017.2.4) on MacOS Sierra and this pop-up shows once for a while: 我目前在MacOS Sierra上使用WebStorm(2017.2.4),这个弹出窗口暂时显示一次:

错误信息

Me and my colleagues have exactly the same TSLint config and code style defined in WebStorm. 我和我的同事在WebStorm中定义了完全相同的TSLint配置和代码样式。 And problem occurs only on my machine.. :( 问题只发生在我的机器上.. :(

I've tried to: 我试过:

  • invalided caches and restart 无效的缓存和重启
  • reinstall node packages and npm 重新安装节点包和npm

I have no clue what's wrong. 我不知道出了什么问题。 I would be very grateful if anyone can help me with these. 如果有人能帮助我,我将非常感激。

I'm not sure whether this will solve your problem or not. 我不确定这是否能解决你的问题。

Enable the plugin in your tsconfig.json file: tsconfig.json文件中启用插件:

{
  "compilerOptions": {
    "plugins": [
      { "name": "tslint-language-service"}
    ]
  }
}

For more detail, please go to this URL: https://www.npmjs.com/package/tslint-language-service 有关更多详细信息,请访问以下URL: https//www.npmjs.com/package/tslint-language-service

Probably this is due to a big file being linted. 可能这是由于一个大文件被褪色。 I encountered the same problem while I was running code inspection with WS 2017.3.4 and it showed me the exact file where it came from. 我在使用WS 2017.3.4运行代码检查时遇到了同样的问题,它向我展示了它来自的确切文件。 It's a TypeScript file with only 8 lines but one of them is soft wrapped like 300 lines. 它是一个只有8行的TypeScript文件,但其中一行是300行的软包裹。

I put a // tslint:disable on the first line because I anyway didn't need to lint this data file and the problem disappeared. 我在第一行放了一个// tslint:disable ,因为我反正不需要lint这个数据文件,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM