Package: ycmd / 0+20161219+git486b809-2.1

05-tern-support.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Description: Debian doesn't have node-tern. This patch is making ycmd to
 use locally installed tern with `npm install tern` command.

--- a/ycmd/completers/javascript/tern_completer.py
+++ b/ycmd/completers/javascript/tern_completer.py
@@ -36,20 +36,15 @@
 
 _logger = logging.getLogger( __name__ )
 
-PATH_TO_TERN_BINARY = os.path.abspath(
-  os.path.join(
-    os.path.dirname( __file__ ),
-    '..',
-    '..',
-    '..',
-    'third_party',
-    'tern_runtime',
-    'node_modules',
-    'tern',
+PATH_TO_TERN_BINARY = utils.PathToFirstExistingExecutable( [ 'tern' ] )
+if not PATH_TO_TERN_BINARY:
+  PATH_TO_TERN_BINARY = os.path.join(
+    os.path.expanduser('~'),
+    '.npm-packages',
     'bin',
-    'tern' ) )
+    'tern')
 
-PATH_TO_NODE = utils.PathToFirstExistingExecutable( [ 'node' ] )
+PATH_TO_NODE = utils.PathToFirstExistingExecutable( [ 'nodejs' ] )
 
 # host name/address on which the tern server should listen
 # note: we use 127.0.0.1 rather than localhost because on some platforms