MCPcopy
hub / github.com/ternjs/tern_for_vim / tern_projectDir

Function tern_projectDir

script/tern.py:32–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30 tern_killServer(self)
31
32def tern_projectDir():
33 cur = vim.eval("b:ternProjectDir")
34 if cur: return cur
35
36 projectdir = ""
37 mydir = vim.eval("expand('%:p:h')")
38 if not os.path.isdir(mydir): return ""
39
40 if mydir:
41 projectdir = mydir
42 while True:
43 parent = os.path.dirname(mydir[:-1])
44 if not parent:
45 break
46 if os.path.isfile(os.path.join(mydir, ".tern-project")):
47 projectdir = mydir
48 break
49 mydir = parent
50
51 vim.command("let b:ternProjectDir = " + json.dumps(projectdir))
52 return projectdir
53
54def tern_findServer(ignorePort=False):
55 dir = tern_projectDir()

Callers 3

tern_findServerFunction · 0.85
tern_relativeFileFunction · 0.85
tern_projectFilePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected