Sublime Text的打字稿突然停止了工作?

时间:2016-11-03 10:16:57

标签: typescript plugins sublimetext

Sublime Text(build 3126)中的Typescript插件没有明显原因停止工作。

问题在于它不再理解类型,因此突出显示错误并禁用自动填充。

这发生在OS X 10.11.6上。

这是sublime文本控制台中的输出:

2016-11-03 11:14:24,674: 140735275929600: WARNING: TypeScript plugin initialized.
plugins loaded
[rsub] Server running on localhost:52698...
lang_service_enabled: True
Path of tsserver.js: /Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/tsserver/tsserver.js
Path of tsc.js: /Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/tsserver/tsc.js
Trying to spawn node executable from: /usr/local/bin/node
ref view not found
Traceback (most recent call last):
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 22, in _check_timeout_count
    self.handler()
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 66, in on_idle
    self.request_errors(view, info, 500)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 105, in request_errors
    cli.service.request_get_err(error_delay, files)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/service_proxy.py", line 194, in request_get_err
    self.__comm.postCmd(json_str)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 143, in postCmd
    self.server_proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/commands/quick_info.py", line 23, in run
    cli.service.quick_info(self.view.file_name(), get_location_from_view(self.view), self.handle_quick_info)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/service_proxy.py", line 219, in quick_info
    req_dict["seq"]
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 111, in sendCmdAsync
    if self.postCmd(cmd):
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 143, in postCmd
    self.server_proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 22, in _check_timeout_count
    self.handler()
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 79, in on_selection_idle
    self.request_document_highlights(view, info)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/listeners/idle.py", line 189, in request_document_highlights
    cli.service.async_document_highlights(view.file_name(), location, self.highlight_occurrences)
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/service_proxy.py", line 259, in async_document_highlights
    self.__comm.sendCmdAsync(json_str, on_completed, req_dict["seq"])
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 111, in sendCmdAsync
    if self.postCmd(cmd):
  File "/Users/Arthur/Library/Application Support/Sublime Text 3/Packages/TypeScript/typescript/libs/node_client.py", line 143, in postCmd
    self.server_proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe
Package Control: Skipping automatic upgrade, last run at 2016-11-03 10:21:38, next run at 2016-11-03 11:21:38 or after

1 个答案:

答案 0 :(得分:0)

我跟着this github issue按照说明做了:

  • 下载要点,解压缩,
  • 替换[Plugin folder] / tsserver文件夹中的四个文件(在OS X上使用Sublime Text > Preferences > Browse Package...菜单找到它,然后导航到Typescript/tsserver

它有效。