File: 20-use-home-tern.patch

package info (click to toggle)
ycmd 0%2B20240823%2Bgit8b61f19%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,040 kB
  • sloc: python: 44,018; cpp: 6,138; java: 486; sh: 378; cs: 207; javascript: 150; ansic: 82; makefile: 45; xml: 18; objc: 10
file content (31 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
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
Description: Debian doesn't have node-tern. This patch is making ycmd to
 use locally installed tern with `npm install tern` command.
Forwarded: not-needed

--- a/ycmd/completers/javascript/tern_completer.py
+++ b/ycmd/completers/javascript/tern_completer.py
@@ -30,18 +30,13 @@
 
 HTTP_OK = 200
 
-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.FindExecutable( 'node' )