(cmd)
| 286 | if data: tern_echoWrap(data.get("type", ""),name=fname) |
| 287 | |
| 288 | def tern_lookupDefinition(cmd): |
| 289 | data = tern_runCommand("definition") |
| 290 | if data is None: return |
| 291 | |
| 292 | if "file" in data: |
| 293 | lnum = data["start"]["line"] + 1 |
| 294 | col = data["start"]["ch"] + 1 |
| 295 | filename = data["file"] |
| 296 | |
| 297 | if cmd == "edit" and filename == tern_relativeFile(): |
| 298 | vim.command("normal! m`") |
| 299 | vim.command("call cursor(" + str(lnum) + "," + str(col) + ")") |
| 300 | else: |
| 301 | vim.command(cmd + " +call\ cursor(" + str(lnum) + "," + str(col) + ") " + |
| 302 | tern_projectFilePath(filename).replace(u" ", u"\\ ")) |
| 303 | elif "url" in data: |
| 304 | vim.command("echo " + json.dumps("see " + data["url"])) |
| 305 | else: |
| 306 | vim.command("echo 'no definition found'") |
| 307 | |
| 308 | def tern_projectFilePath(path): |
| 309 | return os.path.join(tern_projectDir(), path) |
nothing calls this directly
no test coverage detected