Giter Club home page Giter Club logo

sublime-tern's Introduction

Deprecated: use Tern for Sublime instead

TernJS is a JavaScript type inference engine written by Marijn Haverbeke. It analyses your JS code on-the-fly and provides autocompletion, function argument hints, jump-to-definition, and various automatic refactoring operations.

This plugin adds TernJS support into Sublime Text editor.

How to install

Sublime Tern can be installed as any other plugin with Package Control:

  1. In ST editor, call “Install Package” command from Command Palette.
  2. Find “TernJS” in plugins list and hit Enter to install it.

When installed, Sublime Tern will automatically download PyV8 binary required to run this plugin. If you experience issues with PyV8 loader, you can install it manually.

Warning: if you have Emmet plugin installed and using Sublime Text 2, you have to make sure you have the latest PyV8 binary. It must be automatically updated within 24 hours (you need to restart ST2 editor), but you can forcibly update it:

  1. Quit ST2 editor
  2. Completely remove PyV8 package (remove this folder from ST2’s Packages folder)
  3. Start ST2 editor. Latest PyV8 should be downloaded and installed automatically.

With old PyV8 binary, you’ll experience a lot of crashes.

How to use

Read special blog post about how to use and configure TernJS.

sublime-tern's People

Contributors

jonkirkman avatar sergeche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sublime-tern's Issues

TypeError: Cannot call method 'request' of undefined

Traceback (most recent call last):
  File "./tern.py", line 421, in <lambda>
    sublime.set_timeout(lambda: ctx.js().locals.forceFileUpdate(view, p['id']), 1)
TypeError: TypeError: Cannot call method 'request' of undefined ( js/controller.js @ 222 : 24 )  ->     ternServers[projectId].request(req, function() {});

SublimeText 2 build 2220, OSX ML, latest TernJS package upgrade from Package Control

adding more def's

hi there
Im wondering how would you add more defs taken underscore as an example

here is an actionscript.json file I was using as a test case
{
"!name": "actionscript",
"action": {
"!doc": "Save the previous value of the _ variable.",
"!type": "fn(obj: ?) -> +_",
"VERSION": {
"!type": "string",
"!url": "http://underscorejs.org/#VERSION"
},
".licence": {
"!doc": "Returns a function that will only be executed after being called N times.",
"!url": "http://",
"!type": "fn(times: number, func: fn()) -> !1"
}
}
}

it seems some other file needs to be modified, any ideas
M

rename variable bug

Whenever i try to rename a variable I get this:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 502, in run
    view.sel().add_all(regions)
Boost.Python.ArgumentError: Python argument types in
    RegionSet.add_all(RegionSet, list)
did not match C++ signature:
    add_all(SelectionSet {lvalue}, SelectionSet)

ReferenceError: sawGetSet is not defined

When trying to TernJS: Reload:

Syncing project /Users/niko/Sites/foo/foo.sublime-project
Staring TernJS server for /Users/niko/Sites/foo/foo.sublime-project with 3 libs and 674 files
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 451, in run
    reload_ternjs()
  File "./tern.py", line 383, in reload_ternjs
    sync_all_projects()
  File "./tern.py", line 368, in sync_all_projects
    sync_project(p)
  File "./tern.py", line 348, in sync_project
    ctx.js().locals.startServer(json.dumps(p, ensure_ascii=False), resolved_libs)
ReferenceError: ReferenceError: sawGetSet is not defined ( js/acorn_loose.js @ 683 : 29 )  ->         isGetSet = sawGetSet = true;

Sublime Text 2 build 2220, OSX ML

ValueError: Expecting property name enclosed in double quotes

When installing this plugin in Sublime Text 3 build 3059, I am getting:

Traceback (most recent call last):
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\sublime_plugin.py", line 207, in on_load
    callback.on_load(v)
  File "tern in C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 438, in on_load
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 148, in project_for_view
    projects = all_projects()
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\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 "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 130, in <listcomp>
    result = [info(p) for p in projects_from_opened_files()]
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\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 20 column 3 (char 384)
Traceback (most recent call last):
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "tern in C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 486, in run
  File "tern in C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 398, in reload_ternjs
  File "tern in C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 394, in reset_all_projects
  File "tern in C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package", line 327, in all_projects
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 130, in all_projects
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 130, in <listcomp>
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 136, in info
  File "C:\Users\Jeremy\apps\Sublime Text 3 Beta\Data\Installed Packages\TernJS.sublime-package\ternjs\project.py", line 63, in get_ternjs_config
  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 20 column 3 (char 384)

Unfortunately this is preventing TernJS from working, it seems, as I am not getting expected autocomplete functionality. Any tips/tricks for me?

Does not work in ST3.

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)

Node require files

I can't seem to get sublime-tern to recognise modules imported through node's require function, aside from the core modules. It is currently spitting out this if I try to require() any non-core modules:

https://gist.github.com/hoagy-davis-digges/7379824

Update: I can get the autocompletion working by putting in the file paths:

express = require('node_modules/express/index');
nodeio = require('node_modules/node.io/index')

this gets rid of the first two errors, but the rest still slow down the system. It looks like tern is looking for all the files which are being required in the root project directory, instead of in the correct node_modules folder, any ideas on why it might be doing that?

Thanks

Python errors when using TernJS plugin

Hi,

I've just installed ST3 (Sublime Text Build 3065 x64 Setup.exe) on my Windows 8.1 x64. I tried to add TernJS plugin and have some issues:

TernJS: No need to update PyV8
Traceback (most recent call last):
  File "D:\Software\Sublime\sublime_plugin.py", line 157, in on_api_ready
    m.plugin_loaded()
  File "D:\Software\Sublime\Data\Packages\sublime-tern\tern.py", line 609, in plugin_loaded
    init()
  File "D:\Software\Sublime\Data\Packages\sublime-tern\tern.py", line 84, in init
    sync_all_projects()
  File "D:\Software\Sublime\Data\Packages\sublime-tern\tern.py", line 384, in sync_all_projects
    for p in all_projects():
  File "D:\Software\Sublime\Data\Packages\sublime-tern\tern.py", line 327, in all_projects
    proj = copy(project.all_projects())
  File "D:\Software\Sublime\Data\Packages\sublime-tern\ternjs\project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "D:\Software\Sublime\Data\Packages\sublime-tern\ternjs\project.py", line 130, in <listcomp>
    result = [info(p) for p in projects_from_opened_files()]
  File "D:\Software\Sublime\Data\Packages\sublime-tern\ternjs\project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "D:\Software\Sublime\Data\Packages\sublime-tern\ternjs\project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "./json/__init__.py", line 274, in load
  File "./json/__init__.py", line 319, in loads
  File "./json/decoder.py", line 352, in decode
  File "./json/decoder.py", line 368, in raw_decode
ValueError: Expecting property name enclosed in double quotes: line 9 column 5 (char 98)

any chance to get it fixed?

Thanks!

Code Completion not working

The plugin installs fine, and the other functions like "Jump to definition" work, but ctrl+space does not do anything, even for the simplest examples.

The only odd thing I noticed was the messages appearing when I restart the ternjs server:

Syncing project /var/www/ld26/ld26.sublime-project
Starting TernJS server for /var/www/ld26/ld26.sublime-project with 2 libs and 2 files
Syncing project empty
Starting TernJS server for empty with 1 libs and 0 files

Here is my sublime-project file:

{
    "folders":
    [
        {
            "path": "/var/www/ld26"
        }
    ],

  "ternjs": {
    "include":["caat.js","game.js"],
    "libs": ["browser"]
  }
}

There are only 2 js files in the project (caat.js and game.js) both in the root of the project folder.

Sublime slowdown

Hi! Your plugin increased Sublime load time a lot. Also it may hang editor while typing something.

Error in is_st3 function?

Linux, Sublime Text 3 build 3008

reloading plugin TernJS.tern
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 65, in reload_plugin
    m = importlib.import_module(modulename)
  File "X/importlib/__init__.py", line 88, in import_module
  File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1525, in _find_and_load_unlocked
  File "/home/cvladan/.config/sublime-text-3/Installed Packages/TernJS.sublime-package/tern.py", line 577, in <module>
  File "/home/cvladan/.config/sublime-text-3/Installed Packages/TernJS.sublime-package/tern.py", line 48, in is_st3

I hope it helps.

Plugin causes memory leaks in ST3

After installing sublime-tern, Sublime began to work slower. plugin_host.exe was continuously growing and cause Sublime crash. After Sublime-tern removal, everything was fine again.

Support for `.tern-project` files

It will be great to have support for .tern-project files.
This can speed up Tern loading in case of large projects that contain multiple sub-folders each of them with a specific configuration.

Sublime tern hangs the editor.

Startup seems to work as expected. There is a short delay as the project is being indexed by tern and then sublime behaves as normal until I start typing in a JS file. After pressing any character key (ie- [A-Za-z$_] inside of a place where an identifier is expected, tern seems to kick in and I get a spinning beach ball of death. I need to force quite sublime text.

I can provide more information if you need. On startup, I have the following in my log:

``
startup, version: 3059 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/andrew.eisenberg/Library/Application Support/Sublime Text 3/Packages
state path: /Users/andrew.eisenberg/Library/Application Support/Sublime Text 3/Local
hardware concurrency: 8
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/andrew.eisenberg/Library/Application Support/Sublime Text 3/Installed Packages
found 8 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 6 files for base name Main.sublime-menu
loading bindings
loading pointer bindings
found 1 files for base name Default.sublime-theme
theme loaded
app ready
startup cache, total files: 171 cache hits: 171
pre session restore time: 0.19474
using gpu buffer for window
using gamma: 2 (err: 6.9282)
first paint time: 0.270349
startup time: 0.294589
launching: /Applications/Sublime Text.app/Contents/MacOS/plugin_host
reloading plugin Default.block
reloading plugin Default.comment
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.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_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 Emmet.emmet-plugin
reloading plugin JsFormat.js_formatter
reloading plugin Package Control.Package Control
reloading plugin TernJS.tern
reloading plugin JSHint Gutter.JSHint
plugins loaded
TernJS: No need to update PyV8
Syncing project/xxx/foobar..sublime-project
Starting TernJS server for /xxx/foobar.sublime-project with 1 libs and 3064 files
Syncing project empty
Starting TernJS server for empty with 1 libs and 0 files
loaded 2010 snippets
Emmet: No need to update PyV8
Package Control: Skipping automatic upgrade, last run at 2013-12-27 10:04:12, next run at 2013-12-27 11:04:12 or after

controller.js has bug!

tern.py call the startServer ,the params project is

{"config": {"libs": ["jquery"], "files": ["/Users/inwoo/work/FrontEnd_Git/ibary-mobile/dist/**/*.js"]}, "id": "/Users/inwoo/Library/Application Support/Sublime Text 3/Packages/User/Projects/project.sublime-project", "dir": "/Users/inwoo/Library/Application Support/Sublime Text 3/Packages/User/Projects", "files": []}

but the controller.js line 15 is: var files = project && project.files ? project.files : [];

must be var files = project && project.config ? project.config.files : [];

Failing on "Unrecognized type spec"

I may be reading this incorrectly but it seems that PyV8 is failing when trying to throw error for "Unrecognized type spec".

Starting TernJS server for /blah/blah/.sublime-project with 2 libs and 123 files

calling inside

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 451, in run reload_ternjs()
  File "./tern.py", line 383, in reload_ternjs sync_all_projects()
  File "./tern.py", line 368, in sync_all_projects sync_project(p)
  File "./tern.py", line 348, in sync_project ctx.js().locals.startServer(json.dumps(p, ensure_ascii=False), resolved_libs)
PyV8.JSError: JSError: Error: Unrecognized type spec: [$0.✖] (at 4) ( js/env.js @ 42 : 12 )  ->       throw new Error("Unrecognized type spec: " + this.spec + " (at " + this.

Also, my ternjs settings should only be requiring 1 type spec / lib (jquery).

"ternjs": {
  "libs": [ "jquery" ]
}

Thanks for the great work!

AttributeError: '[object Object]' object has no attribute 'file'

on macox 10.8.4
sublime 2.0.2 build 2221

fresh install

on nodejs express project
while trying to jump to definition get the next output:

TernJS: No need to update PyV8
Syncing project empty
Starting TernJS server for empty with 1 libs and 0 files
reloading /Users/Oleg/Library/Application Support/Sublime Text 2/Packages/User/Fetch.sublime-settings
loaded 2055 snippets
Package Control: Skipping automatic upgrade, last run at 2013-08-13 20:03:57, next run at 2013-08-13 21:03:57 or after
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 473, in run
    target_file = dfn['file']
AttributeError: '[object Object]' object has no attribute 'file'

what can it be? any thought?

errror with sublime 3

Hi..I'm getting an error when try install it inside sublime 3...I've not installed emmet,only 2 or 3 packages (I just download it)

this is the error

TernJS: Loading PyV8 binary from https://raw.github.com/emmetio/pyv8-binaries/master/pyv8-linux64-p3.zip
Exception in thread Thread-674:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "./threading.py", line 1142, in run
  File "/home/yo/.config/sublime-text-3/Installed Packages/TernJS.sublime-package/ternjs/pyv8loader.py", line 268, in run
    return self.trigger('error', exit_code=self.thread.exit_code, progress=self)
  File "/home/yo/.config/sublime-text-3/Installed Packages/TernJS.sublime-package/ternjs/pyv8loader.py", line 287, in trigger
    c(*args, **kwargs)
TypeError: on_error() got an unexpected keyword argument 'progress'

I hope you can help me..thanks

Segfault / freeze with circular symlink

If a circular symlink is not excluded in ternjs, a segfault or (forkbomb-like) freeze will occur.

Obviously, this should not occur, but non-circular symlinks should still be traversed. A stop-gap measure could be adding a config option to not traverse symlinks at all.

Troubles accessing the pyv8 over a proxy

Hi!

I have an issue with this plugin, I'm using sublime at work, and we have a proxy. Initially I could not get the packages for sublime, after I set the proxy settings for the package manager, I was able to retrieve the list.
But it seems that in the TernJS package you are getting pyv8 without using those settings..
I guess Emmet plugin also has this issue..

Thanks

ps: I'm using Sublime 2, the error I'm getting is

a lot of this
ternjs.pyv8loader: Downloading https://api.github.com/repos/emmetio/pyv8-binaries/contents timed out, trying again

and then

Exception in thread Thread-5352:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 736, in run
    self.function(*self.args, **self.kwargs)
  File "./ternjs/pyv8loader.py", line 268, in run
    return self.trigger('error', exit_code=self.thread.exit_code, progress=self)
  File "./ternjs/pyv8loader.py", line 287, in trigger
    c(*args, **kwargs)
TypeError: on_error() got an unexpected keyword argument 'progress'

Error renaming variable

I get the following error in the console when trying to rename a variable

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 362, in run_
  File ".\tern.py", line 518, in run
    view.add_regions(rename_region_key, regions, 'string', flags=sublime.HIDDEN)
Boost.Python.ArgumentError: Python argument types in
    View.add_regions(View, str, list, str)
did not match C++ signature:
    add_regions(class SP<class TextBufferView>, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class boost::python::list, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)
    add_regions(class SP<class TextBufferView>, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class boost::python::list, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, int)
    add_regions(class SP<class TextBufferView>, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class boost::python::list, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >)
    add_regions(class SP<class TextBufferView>, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class boost::python::list, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >, int)

support sublime text 3

It appear that it doesn't support sublime text 3 yet, is there any chance of it happening?

ValueError: No JSON object could be decoded

I'm running Sublime Text 2 v2.0.1, Build 2217 on OS X 10.8.4. I can't seem to get code completion working. Below you will find the console message from boot. I re-ran the TernJS: Reload command after boot.

Here is the console output:

startup, version: 2217 osx x64 channel: stable
executable: /Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2
working dir: /
packages path: /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages
settings path: /Users/larrygordon/Library/Application Support/Sublime Text 2/Settings
PackageSetup not required
catalogue loaded
found 31 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 22 files for base name Main.sublime-menu
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Alignment/Alignment.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/ApplySyntax/ApplySyntax.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/ApplySyntax/is_rails_file.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_core.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_plugin.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_remove.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_swapping.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/bh_wrapping.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/BracketHighlighter/ure.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/CSS/css_completions.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/CSScomb Alpha Sort/CSScomb.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Can I Use/useIt.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Clientside/Clientside.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Clientside/cssmin.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Clientside/jsbeautifier.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Clientside/jsmin.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/comment.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/copy_path.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/delete_word.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/detect_indentation.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/duplicate_line.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/echo.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/exec.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/fold.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/font.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/goto_line.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/indentation.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/kill_ring.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/mark.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/new_templates.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/open_file_settings.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/open_in_browser.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/paragraph.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/save_on_focus_lost.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/scroll.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/side_bar.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/sort.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/swap_line.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/switch_file.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/transform.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/transpose.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Diff/diff.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/DocBlockr/jsdocs.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/EditorConfig/EditorConfig.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/FindKeyConflicts/find_key_conflicts.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/git_gutter.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/git_gutter_change.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/git_gutter_events.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/git_gutter_handler.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/git_helper.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/GitGutter/view_collection.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Grunt/main.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/HTML/encode_html_entities.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/HTML/html_completions.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Insert Nums/insert_nums.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/JsFormat/js_formatter.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./js_formatter.py", line 34, in <module>
    import jsbeautifier, jsbeautifier.unpackers
ImportError: No module named unpackers
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/JsRun/JsRun.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Markdown Preview/MarkdownPreview.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Markdown Preview/markdown2.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Origami/origami.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Package Control/Package Control.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Print to HTML/PrintToHTML.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Quick File Creator/SublimeQuickFileCreator.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SCSS/scss_completions.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SFTP/SFTP.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SVN/SVN.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SideBarEnhancements/SideBar.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SideBarEnhancements/StatusBarFileSize.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SideBarEnhancements/StatusBarModifiedTime.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SublimeLinter/SublimeLinter.py
imported capp_lint
imported pep8
imported pyflakes
imported pyflakes.api
imported pyflakes.checker
imported pyflakes.messages
imported pyflakes.reporter
SublimeLinter: C loaded
SublimeLinter: c_cpplint loaded
SublimeLinter: CoffeeScript loaded
SublimeLinter: CSS loaded
SublimeLinter: Git Commit Message loaded
SublimeLinter: Ruby Haml loaded
SublimeLinter: haskell loaded
SublimeLinter: HTML loaded
SublimeLinter: Java loaded
SublimeLinter: JavaScript loaded
SublimeLinter: Lua loaded
SublimeLinter: Annotations loaded
SublimeLinter: Objective-J loaded
SublimeLinter: Perl loaded
SublimeLinter: PHP loaded
SublimeLinter: Puppet loaded
SublimeLinter: Python loaded
SublimeLinter: ruby-lint loaded
SublimeLinter: Ruby loaded
SublimeLinter: pylint loaded
SublimeLinter: XML loaded
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/SublimeStringEncode/string_encode.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/Tag.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_close_tag.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_close_tag_on_slash.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_indent.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_insert_as_tag.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_lint.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_remove.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/Tag/tag_remove_attributes.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/TagWrapper/tag_wrapper.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/TernJS/tern.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/TidyHTML5/TidyHTML.py
Reloading plugin /Users/larrygordon/Library/Application Support/Sublime Text 2/Packages/tern_for_sublime/tern.py
plugin init time: 1.98915
loading bindings
loading pointer bindings
found 2 files for base name Soda Dark.sublime-theme
theme loaded
app ready
pre session restore time: 2.14712
using gamma: 2 (err: 6.9282)
wrote startup cache, added files: 2 orphaned files: 0 total files: 279 cache hits: 277
startup time: 2.31346 (package setup was not run)
TernJS: No need to update PyV8
Traceback (most recent call last):
  File "./tern.py", line 83, in init
    sync_all_projects()
  File "./tern.py", line 373, in sync_all_projects
    for p in all_projects():
  File "./tern.py", line 316, in all_projects
    proj = copy(project.all_projects())
  File "./ternjs/project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "./ternjs/project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "./ternjs/project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
ApplySyntax: Syntax file for INI does not exist at Packages/INI/INI.tmLanguage
Traceback (most recent call last):
  File "./sublime_plugin.py", line 175, in on_load
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 174, in <lambda>
  File "./tern.py", line 414, in on_load
    p = project.project_for_view(view)
  File "./ternjs/project.py", line 148, in project_for_view
    projects = all_projects()
  File "./ternjs/project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "./ternjs/project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "./ternjs/project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Traceback (most recent call last):
  File "./sublime_plugin.py", line 175, in on_load
  File "./sublime_plugin.py", line 154, in run_timed_function
  File "./sublime_plugin.py", line 174, in <lambda>
  File "./tern.py", line 414, in on_load
    p = project.project_for_view(view)
  File "./ternjs/project.py", line 148, in project_for_view
    projects = all_projects()
  File "./ternjs/project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "./ternjs/project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "./ternjs/project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
loaded 1052 snippets
Package Control: Skipping automatic upgrade, last run at 2013-06-28 16:57:28, next run at 2013-06-28 17:57:28 or after
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./tern.py", line 462, in run
    reload_ternjs()
  File "./tern.py", line 387, in reload_ternjs
    reset_all_projects()
  File "./tern.py", line 383, in reset_all_projects
    for p in all_projects():
  File "./tern.py", line 316, in all_projects
    proj = copy(project.all_projects())
  File "./ternjs/project.py", line 130, in all_projects
    result = [info(p) for p in projects_from_opened_files()]
  File "./ternjs/project.py", line 136, in info
    config = get_ternjs_config(project_id)
  File "./ternjs/project.py", line 63, in get_ternjs_config
    conf = json.load(open(project))
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Here is a copy of my .sublime-project file

{
  "folders": [{
    "path": ".",
    "folder_exclude_patterns": [
      "API",
      "App_Data",
      "bin",
      "Certificates",
      "Content",
      "Controllers",
      "Infrastructure",
      "Models",
      "nlog",
      "node_modules",
      "obj",
      "Properties",
      "Reporting",
      "Resources",
      "Service References",
      "ste-root",
      "Web References"
    ],
    "file_exclude_patterns": [
      "*.dll",
      "._*",
      ".png",
      "*.ashx*",
      "nlog.config",
      "packages.config",
      "*.asax*",
      "*.ico",
      "deploy.xml",
      "Error.htm",
      "*.csproj*",
      "*.sublime-workspace",
      "robots.txt"
    ]
  }],
  "ternjs": {
    "exclude": [
      "API/**",
      "App_Data/**",
      "bin/**",
      "Certificates/**",
      "Content/**",
      "Controllers/**",
      "Infrastructure/**",
      "Models/**",
      "nlog/**",
      "node_modules/**",
      "obj/**",
      "Properties/**",
      "Reporting/**",
      "Resources/**",
      "Service References/**",
      "ste-root/**",
      "Web References/**"
    ],
    "libs": [
      "browser",
      "jquery"
    ],
    "plugins": {
      "requirejs": {
        "baseURL": "./js"
      }
    }
  }
}

No Completion - No Project Files Found

Issue:
It seems like the "include" setting only narrows the lsit of files scanned by tern, rather than expanding it. I would expect the "include" setting to actually add the directories specified to the list of directories scanned.

Details:
I prefer to keep my .sublime-project and .sublime-workspace files in their own, completely unrelated directories, rather than with the source code, in order to keep the repo space cleaner. Consequently, Tern is unable to find any files in my project (since they're in a completely different directory), and is unusable.

Here's my .sublime-project's ternjs section:
"ternjs":
{
"include": ["/Users/username/source/project1/subprojectA/**"],
"libs": ["browser", "jquery"],
"plugins": {
}
}

TernJS.sublime-package crashes Sublime Text 3

Hello,
I just installed TernJS.sublime-package crashes Sublime Text 3 and now Sublime crashes as soon as it is opened.

I attempted to remove it by first using remove package, but I cannot get access because the program is frozen.

Closing and opening the program does not work, it only freezes up right away.

Navigating to /Library/Application Support/Sublime Text 3/Installed Packages and removing the package does not work, as soon as I open Sublime everything is fine, but it automatically repopulates in Finder, and then freezes the prorgam, deleting it again does not make the program return to normal either...

Please help,
Thanks!

Improve completions

  1. Completions should allow default snippets and word completions
  2. Do not ask for completions inside strings

Autocompletion in HTML - tag issue

Hello!
I would like to share the way i make TernJS work correctly in HTML file.

The issue: after make TernJS working in HTML ("syntax_scopes": "source.js, text.html") we have very strange thing with tags autocompletion (script autocompletion inside <script>...</script> works fine) - there are no tag names in autocomplete suggestion:

pic1

Solution: i've disabled default trigger on "<" character (removed {"selector": "text.html", "characters": "<"} from preferences)

now i have:
{
"auto_complete_triggers": [ {"selector": "source.js", "characters": "."} ]
}

and everything works excellent:
pic2

Maximum call stack size exceeded

On sublime start-up I get following error from ternjs (version: 3022 windows x64 channel: dev)


TernJS: No need to update PyV8
Syncing project D:\78Digital_projects\alliance\contests\eone-tarantino\eone-tarantino.sublime-project
Staring TernJS server for D:\78Digital_projects\alliance\contests\eone-tarantino\eone-tarantino.sublime-project with 1 libs and 45 files
Traceback (most recent call last):
File "D:\Program Files\Sublime Text 3\sublime_plugin.py", line 156, in on_api_ready
m.plugin_loaded()
File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 528, in plugin_loaded
init()
File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 82, in init
sync_all_projects()
File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 368, in sync_all_projects
sync_project(p)
File "D:\Program Files\Sublime Text 3\Data\Installed Packages\sublime-tern.sublime-package\tern.py", line 348, in sync_project
ctx.js().locals.startServer(json.dumps(p, ensure_ascii=False), resolved_libs)
IndexError: RangeError: Maximum call stack size exceeded ( js/infer.js @ 0 : -1 ) -> // Main type inference engine

autocompletion on dot?

(Maybe this is a sublime text feature I haven't discovered) is there a way to do this? The blog post mentions ST preference. Thanks.

TypeError: Object #<Object> has no method 'trace'

While opening a simple js file:

Writing file /Users/niko/Sites/foo/static/js/foo.js with encoding UTF-8
None not /Users/niko/Sites/foo/static/js/foo.js
Traceback (most recent call last):
  File "./tern.py", line 421, in <lambda>
    sublime.set_timeout(lambda: ctx.js().locals.forceFileUpdate(view, p['id']), 1)
TypeError: TypeError: Object #<Object> has no method 'trace' ( js/tern.js @ 184 : 23 )  ->     if (depth) console.trace("calling inside");

Sublime Text 2 build 2220, OSX ML

Disabling TernJS on a specific file type

Hello there Sergey,

short question
I'd like to know how I specifically turn TernJS scan for other *.js in a specific file type (this case, .cshtml).

On the emmet.io blog post ( emmet.io/blog/sublime-tern/ ) says this:

Otherwise, if you’re editing file outside project, code completion and other actions will work for this file only.

Seems it's still trying to load other *.js even outside a project, thus crashing ST2.


long explanation of why

Let me explain the problem i have:

I use projects like it's suggested on emmet.io blog post but sometimes I need to edit files that are inside a Visual Studio Project (no ST project). So I only open the .cshtml file inside ST2 without any project only to edit it (because has Emmet, ternjs, jshint, etc etc and VS is bad) but it has sometimes calls to .js files like so <script type="text/javascript" src="/Content/Resources/something/something.js"></script>.

I don't know exactly why but everytime there are scripts included on the .cshtml files, ST2 crashes when I'm writing javascript. I've tested and crashed twice when I tried write the same thing (just a $(selector).val() crashes after pressing v of val). I've removed ternJS and ST stopped crashing. I redownloaded pyV8 but still crashes.

So I think that in this case, the ternJS script that tries to load and analyse other .js files is somewhat 'dying'.

The "exclude": [ /**/ ], seems to only accept folders, since i tried "exclude": ["**/*.cshtml"] and had no luck.

Thanks alot for another awesome plugin and your time reading.

Best Regards,
RaphaelDDL

TypeError: TypeError: Cannot read property 'fnType' of undefined

Sublime Text 2 build 2220, latest TernJS package from PC:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 236, in on_query_completions
  File "./tern.py", line 430, in on_query_completions
    completions = ctx.js().locals.ternHints(view, proj.get('id', 'empty'))
TypeError: TypeError: Cannot read property 'fnType' of undefined ( lib/infer.js @ 842 : 45 )  ->       var inner = node.body.scope, fn = inner.fnType;

Is the project abandoned?

I am currently evaluating Sublime autocomplete plugins and i would like to know the status of Sublime-Tern.

TernJS: Reload causes crashing

Hi, when tern server starts - all is working very well. However if I modify tern settings for my project and try to do 'TernJS: Reload' sublime always crashes.

Additional info


startup, version: 3038 windows x64 channel: dev

no attribute 'ternHints'

What's going on here?
Latest SublimeTern on win, ST ver 2.0.1

Traceback (most recent call last):
File ".\sublime_plugin.py", line 236, in on_query_completions
File ".\tern.py", line 430, in on_query_completions
completions = ctx.js().locals.ternHints(view, proj.get('id', 'empty'))
AttributeError: '[object global]' object has no attribute

Memory usage continuously increasing

I'm using TernJS with THREE.js. My memory usage without TernJS is ~50,000K. With TernJS, it starts at 500,000K, which isn't /too/ bad, but then as time passes by it just keeps going up, until around 2,000,000 where it just crashes.

I tried updating PyV8 and that wasn't the issue. The known issues talks about problems with larger libraries, but I'm not sure if slowly increasing memory is part of that. I'm not getting any errors in my console either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.