johncsnyder / SwiftKitten

Swift autocompleter for Sublime Text, via the adorable SourceKitten framework
MIT License
139 stars 18 forks source link

Autocomplete not working #2

Open skipadu opened 8 years ago

skipadu commented 8 years ago

Autocomplete seems not to work at the moment. And when looking from the console, it gives this error:

Traceback (most recent call last): File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 125, in parse_value File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 158, in number decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 160, in handle_timeout File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 112, in handle_timeout File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 118, in on_idle File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 329, in _get_structure_info File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 138, in items File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 65, in parse File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 185, in basic_parse File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 127, in parse_value ijson.backends.python.UnexpectedSymbol: Unexpected symbol 'T' at 0

johncsnyder commented 8 years ago

It appears this issue originates in linting (get_structure_info). Set linting to false in the settings to confirm this.

It could be a problem with ijson in windows... or perhaps a character encoding issue ?

I don't have a windows system, so this will be hard for me to reproduce until I set up a virtual environment with your configuration. If you can, some more debug information would be helpful (for example on line 511 in SwiftKitten.py, print p.stdout to console).

skipadu commented 8 years ago

I removed the sublimelinter completely from my Sublime Text and ther error continued. Or if there is setting in SwiftKitten for linting, I don't know where to look exactly.

Currently the SwiftKitten.py r.510 if buffer_id not in self.cache: r.511 self.cache[buffer_id] = {} # initalize cache for buffer

Do you mean that I should put the print like this? r.510 if buffer_id not in self.cache: r.511 print(p.stdout) r.512 self.cache[buffer_id] = {} # initalize cache for buffer

johncsnyder commented 8 years ago

By the linting, I mean the linter setting in SwiftKitten.sublime-settings. You can set it to false.

If you installed via package control, then the plugin is compressed in Installed Packages folder. You can use the PackageDev plugin to extract the plugin to the Packages folder so you can more easily edit the files.

Sorry, the line number is 328 in your version. change it this:

# run structure info command
p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT)
print(p.stdout)
structure_info = list(ijson.items(p.stdout,''))[0]
skipadu commented 8 years ago

Okay. Now I took the linting to false in SwiftKitten.sublime-settings and added that print(p.stdout)like you described.

And below is the result:

Request denied: completion for "" already in progress.

<_io.BufferedReader name=4> Traceback (most recent call last): File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 125, in parse_value File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 158, in number decimal.InvalidOperation: [] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 160, in handle_timeout File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 112, in handle_timeout File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 118, in on_idle File "SwiftKitten in C:\st3\Data\Installed Packages\SwiftKitten.sublime-package", line 330, in _get_structure_info File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 138, in items File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\common.py", line 65, in parse File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 185, in basic_parse File "C:\st3\Data\Installed Packages\SwiftKitten.sublime-package\ijson\ijson\backends\python.py", line 127, in parse_value ijson.backends.python.UnexpectedSymbol: Unexpected symbol 'T' at 0
chika-kasymov commented 8 years ago

I have the same problem. I'm currently working with macOS Sierra 10.12, Sublime Text 3 and SourceKitten 0.14.1.