3131define ( function ( require , exports , module ) {
3232 "use strict" ;
3333
34- var _ = brackets . getModule ( "thirdparty/lodash" ) ;
35-
36- var CodeMirror = brackets . getModule ( "thirdparty/CodeMirror/lib/codemirror" ) ,
37- DefaultDialogs = brackets . getModule ( "widgets/DefaultDialogs" ) ,
38- Dialogs = brackets . getModule ( "widgets/Dialogs" ) ,
39- DocumentManager = brackets . getModule ( "document/DocumentManager" ) ,
40- EditorManager = brackets . getModule ( "editor/EditorManager" ) ,
41- ExtensionUtils = brackets . getModule ( "utils/ExtensionUtils" ) ,
42- FileSystem = brackets . getModule ( "filesystem/FileSystem" ) ,
43- FileUtils = brackets . getModule ( "file/FileUtils" ) ,
44- LanguageManager = brackets . getModule ( "language/LanguageManager" ) ,
45- PreferencesManager = brackets . getModule ( "preferences/PreferencesManager" ) ,
46- ProjectManager = brackets . getModule ( "project/ProjectManager" ) ,
47- Strings = brackets . getModule ( "strings" ) ,
48- StringUtils = brackets . getModule ( "utils/StringUtils" ) ,
49- NodeDomain = brackets . getModule ( "utils/NodeDomain" ) ,
50- InMemoryFile = brackets . getModule ( "document/InMemoryFile" ) ;
51-
52- var HintUtils = require ( "HintUtils" ) ,
53- MessageIds = require ( "MessageIds" ) ,
54- Preferences = require ( "Preferences" ) ;
34+ var _ = require ( "thirdparty/lodash" ) ;
35+
36+ var CodeMirror = require ( "thirdparty/CodeMirror/lib/codemirror" ) ,
37+ DefaultDialogs = require ( "widgets/DefaultDialogs" ) ,
38+ Dialogs = require ( "widgets/Dialogs" ) ,
39+ DocumentManager = require ( "document/DocumentManager" ) ,
40+ EditorManager = require ( "editor/EditorManager" ) ,
41+ ExtensionUtils = require ( "utils/ExtensionUtils" ) ,
42+ FileSystem = require ( "filesystem/FileSystem" ) ,
43+ FileUtils = require ( "file/FileUtils" ) ,
44+ LanguageManager = require ( "language/LanguageManager" ) ,
45+ PreferencesManager = require ( "preferences/PreferencesManager" ) ,
46+ ProjectManager = require ( "project/ProjectManager" ) ,
47+ Strings = require ( "strings" ) ,
48+ StringUtils = require ( "utils/StringUtils" ) ,
49+ NodeDomain = require ( "utils/NodeDomain" ) ,
50+ InMemoryFile = require ( "document/InMemoryFile" ) ;
51+
52+ var HintUtils = require ( "./ HintUtils" ) ,
53+ MessageIds = require ( "./ MessageIds" ) ,
54+ Preferences = require ( "./ Preferences" ) ;
5555
5656 var ternEnvironment = [ ] ,
5757 pendingTernRequests = { } ,
@@ -64,9 +64,11 @@ define(function (require, exports, module) {
6464 preferences = null ,
6565 deferredPreferences = null ;
6666
67- var _modulePath = FileUtils . getNativeModuleDirectoryPath ( module ) ,
68- _nodePath = "node/TernNodeDomain" ,
69- _domainPath = [ _modulePath , _nodePath ] . join ( "/" ) ;
67+ var _bracketsPath = FileUtils . getNativeBracketsDirectoryPath ( ) ,
68+ _modulePath = FileUtils . getNativeModuleDirectoryPath ( module ) ,
69+ _nodePath = "node/TernNodeDomain" ,
70+ _absoluteModulePath = [ _bracketsPath , _modulePath ] . join ( "/" ) ,
71+ _domainPath = [ _bracketsPath , _modulePath , _nodePath ] . join ( "/" ) ;
7072
7173
7274 var MAX_HINTS = 30 , // how often to reset the tern server
@@ -89,7 +91,7 @@ define(function (require, exports, module) {
8991 * Read in the json files that have type information for the builtins, dom,etc
9092 */
9193 function initTernEnv ( ) {
92- var path = ExtensionUtils . getModulePath ( module , "node/node_modules/tern/defs/" ) ,
94+ var path = [ _absoluteModulePath , "node/node_modules/tern/defs/" ] . join ( " /") ,
9395 files = builtinFiles ,
9496 library ;
9597
0 commit comments