srusskih / SublimeJEDI

awesome Python autocompletion with SublimeText
MIT License
938 stars 109 forks source link

import autocompletion are undone #203

Closed kwargs closed 7 years ago

kwargs commented 7 years ago

OS X + ST3

With "logging_level": "debug", in sublime_jedi.sublime-settings.

Jedi - Python autocompletion.sublime_jedi.completion: command history: [('insert', {'characters': 'u'}, 1), ('insert', {'characters': 'r'}, 1), ('', None, 0)]
Jedi - Python autocompletion.sublime_jedi.completion: JEDI completion triggered
Jedi - Python autocompletion.sublime_jedi.completion: JEDI has completion in daemon response [['urllib\tmodule', 'urllib'], ['urllib2\tmodule', 'urllib2'], ['urlparse\tmodule', 'urlparse'], ['urwid\tmodule', 'urwid']]
Jedi - Python autocompletion.sublime_jedi.completion: JEDI completion triggered
Jedi - Python autocompletion.sublime_jedi.utils: Sending request to daemon for "autocomplete"
Jedi - Python autocompletion.sublime_jedi.completion: command history: [('insert', {'characters': 'r'}, 1), ('insert', {'characters': 'l'}, 1), ('', None, 0)]
Jedi - Python autocompletion.sublime_jedi.completion: JEDI completion triggered
Jedi - Python autocompletion.sublime_jedi.completion: JEDI has completion in daemon response [['urllib\tmodule', 'urllib'], ['urllib2\tmodule', 'urllib2'], ['urlparse\tmodule', 'urlparse']]

https://youtu.be/MUQuMMq4DpY

srusskih commented 7 years ago

Thanks. will try to find a time :(

srusskih commented 7 years ago

Looks like it's a common issue for ST. All language related settings are stored in Python Package. The is a Completion Rules.tmPreferences file, where <key>cancelCompletion</key> settings is set as <string>^(.*\b(and|or)$)|(\s*(pass|return|and|or|(class|def|import)\s*[a-zA-Z_0-9]+)$)</string>

Jedi plugin has Completion Rules.tmPreferences file for ST2, but ST3 ignore it.

There is some workaround:

Copy-Paste

  1. Delete your Sublime Text Cache file Cache/Python/Completion Rules.tmPreferences.cache
  2. Copy https://raw.githubusercontent.com/srusskih/SublimeJEDI/master/Completion%20Rules.tmPreferences to User/Packages/Python/

Fundamental

  1. install Package https://packagecontrol.io/packages/PackageResourceViewer
  2. cmd+shift+p 2.1. type PackageResourceViewer: Open Resource 2.2. type python and select Python package 2.3. type Completion Rules.tmPreferences 2.4. remove import from the regexp.

Sorry, but I can't anything do with ST3 behavior. Bit looks like I should put it in the Readme.

Hope, it helps.