microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

Autocompletion suddently not working anymore. #602

Closed jpvignolo closed 7 years ago

jpvignolo commented 7 years ago

ST build 3126 Linux Ubuntu 16.04

I have an angular2 project which I moved to angular4. Since the upgrade, the autocompletion in typescript files stopped working. As far as I remember it was working properly before. I'm running un linux ubuntu 16.04. On a different computer, running a linux VM running on a windows host, it's still working properly, even after the angular upgrade. Here is the sublime console log, looks like, at the end, there is an error on a python file. :

DPI scale: 1
startup, version: 3126 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /
packages path: /home/jp/.config/sublime-text-3/Packages
state path: /home/jp/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /home/jp/.config/sublime-text-3/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.086595
startup time: 0.165328
first paint time: 0.17097
first paint time: 0.197428
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin TypeScript.main
2017-04-18 17:33:56,851: 140533199673152: WARNING: TypeScript plugin initialized.
plugins loaded
lang_service_enabled: True
Path of tsserver.js: /usr/lib/node_modules/@angular/cli/node_modules/typescript/tsserver.js
Path of tsc.js: /usr/lib/node_modules/@angular/cli/node_modules/typescript/tsc.js
Trying to spawn node executable from: /usr/bin/node
ref view not found
Package Control: Skipping automatic upgrade, last run at 2017-04-18 17:19:59, next run at 2017-04-18 18:19:59 or after
Exception in thread Thread-2:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/home/jp/.config/sublime-text-3/Packages/TypeScript/typescript/libs/node_client.py", line 146, in monitorPostQueue
    self.server_proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe

here is my settings file (~/.config/sublime-text-3/Packages/User/Preferences.sublime-settings) :

{
    "draw_white_space": "all",
    "font_size": 10,
    "ignored_packages":
    [
        "Vintage"
    ],
    "typescript_tsdk": "/usr/lib/node_modules/@angular/cli/node_modules/typescript/"
}

and typescript module is installed there. Project is compiling fine with angular-cli.

Looked at both issues : #574 and #452 and couldn't find any working fix there.

jpvignolo commented 7 years ago

Tried the computer running the ubuntu VM where Typescript autocomplete is working properly and the console shows more or less the exact same output except the last 7 lines :

Exception in thread Thread-2:
Traceback (most recent call last):
  File "./python3.3/threading.py", line 901, in _bootstrap_inner
  File "./python3.3/threading.py", line 858, in run
  File "/home/jp/.config/sublime-text-3/Packages/TypeScript/typescript/libs/node_client.py", line 146, in monitorPostQueue
    self.server_proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe

Btw, on that computer, the sublime settings files doesn't seems to contain any reference to typescript_tsdk setting. So I removed it from my setting file in the non working computer and now everything is working again. Don't know what changed and why it suddenly broke everything (I remember adding it on purpose when I started working with typescript and angular2 to make autocomplete work) but it solved the problem for me.

oliverbenns commented 4 years ago

Hi, just reiterating that I had a typo in the path for the typescript_tsdk setting which caused this issue so this will likely be your issue if you find yourself here.