Dan2552/SublimeTextSwiftAutocomplete

Parsing error when completing

jnordberg opened this issue · 2 comments

I'm unable to get the completion to work on my machine. Seeing a JSON parse error in console, sourcekitten installed and works when using it standalone.

Error:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 672, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/subl.py", line 17, in on_query_completions
    suggestions = subl_source_kitten.complete_with_haste(offset, file, project_directory, text)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/subl_source_kitten.py", line 38, in complete_with_haste
    return results["full"]
KeyError: 'full'
Exception in thread Thread-217:
Traceback (most recent call last):
  File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration

During handling of the above exception, another exception occurred:

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 "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/subl_source_kitten.py", line 24, in <lambda>
    stripped = lambda : operator.setitem(results, "stripped", complete(offset, file, project_directory, stripped_text))
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/subl_source_kitten.py", line 51, in complete
    collection = source_kitten.complete(offset, file, project_directory, text)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 29, in complete
    return _execute(cmd, _json_parse)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 102, in _execute
    return _execute_cached("§§§".join(cmd), result_handler)
  File "./python3.3/functools.py", line 275, in wrapper
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 110, in _execute_cached
    result = result_handler(p.stdout)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 114, in _json_parse
    results = json.loads(str(stdout.read(), 'utf8'))
  File "./python3.3/json/__init__.py", line 316, in loads
  File "./python3.3/json/decoder.py", line 351, in decode
  File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded

Exception in thread Thread-216:
Traceback (most recent call last):
  File "./python3.3/json/decoder.py", line 367, in raw_decode
StopIteration

During handling of the above exception, another exception occurred:

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 "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/subl_source_kitten.py", line 23, in <lambda>
    full = lambda : operator.setitem(results, "full", complete(offset, file, project_directory, text))
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/subl_source_kitten.py", line 51, in complete
    collection = source_kitten.complete(offset, file, project_directory, text)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 29, in complete
    return _execute(cmd, _json_parse)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 102, in _execute
    return _execute_cached("§§§".join(cmd), result_handler)
  File "./python3.3/functools.py", line 275, in wrapper
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 110, in _execute_cached
    result = result_handler(p.stdout)
  File "/Users/jnordberg/Library/Application Support/Sublime Text 3/Installed Packages/Swift Autocomplete.sublime-package/src/source_kitten.py", line 114, in _json_parse
    results = json.loads(str(stdout.read(), 'utf8'))
  File "./python3.3/json/__init__.py", line 316, in loads
  File "./python3.3/json/decoder.py", line 351, in decode
  File "./python3.3/json/decoder.py", line 369, in raw_decode
ValueError: No JSON object could be decoded
$ sourcekitten version
0.22.0
$ swift -version
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin17.7.0
$ xcodebuild -version
Xcode 10.1
Build version 10B61

I have the same issue here. @jnordberg have you found any work around for that?

No, I gave up and went back to Xcode :(