Skip to content

Commit 300f3d0

Browse files
author
Marcel Gerber
authored
Merge pull request adobe#12734 from adobe/marcel/fix-tern-linux-mac
Monkeypatch ternServer.normalizeFilename so it doesn't break Mac/Linu…
2 parents 2e43c63 + 4e94128 commit 300f3d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/extensions/default/JavaScriptCodeHints/tern-worker.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@ var config = {};
122122
};
123123
ternServer = new Tern.Server(ternOptions);
124124

125+
// Since we don't specify projectDir, Tern will "normalize" file names by
126+
// removing any leading "/" (the default projectDir, which cannot be changed to "").
127+
// This is not a problem on Windows, but on Mac and Linux, it will break
128+
// absolute paths ("/home/" to "home/", for example)
129+
ternServer.normalizeFilename = function (name) {
130+
return name;
131+
};
132+
125133
files.forEach(function (file) {
126134
ternServer.addFile(file);
127135
});

0 commit comments

Comments
 (0)