emmetio/sublime-tern

Does not work in ST3.

Closed this issue · 3 comments

I just started a test project to see if i can switch to this implementation, instead of using Marijn one but i keep getting ValueError: Expecting property name enclosed in double quotes: line 12 column 3 (char 154) at start and every time i try to use autocompletion.

My system is Win 7 x64, ST3 build 3052

The full error is:

TernJS: No need to update PyV8
Traceback (most recent call last):
  File "D:\Portable\Sublime Text 3\sublime_plugin.py", line 358, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "tern in D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package", line 439, in on_query_completions
  File "D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 148, in project_for_view
    projects = all_projects()
  File "D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 130, in <listcomp>
    result = [info(p) for p in projects_from_opened_files()]
  File "D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "D:\Portable\Sublime Text 3\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "X/json/__init__.py", line 264, in load
  File "X/json/__init__.py", line 309, in loads
  File "X/json/decoder.py", line 352, in decode
  File "X/json/decoder.py", line 368, in raw_decode
ValueError: Expecting property name enclosed in double quotes: line 12 column 3 (char 154)

In means your project config contains invalid JSON. All string should be wrapped into double quotes, single quotes are invalid.

Damn trailing comma!

@sergeche you are right, i found my problem war a trailing comma in the .sublime.project file.
Thanks for the support.

@sergeche Can we get a better error here? I pasted the same ValueError text and got this page as the only result back. I ran my project JSON through a validator and realized there was a comment that nothing but TernJS was (correctly) barfing on. I was able to fix it but other people will almost certainly hit this as well.