code: function initTernServer(dir, files) {
              initTernModule();
              numResolvedFiles = 0;
              numAddedFiles = 0;
              stopAddingFiles = false;
              numInitialFiles = files.length;
  
              ternPromise.done(function (ternModule) {
                  var msg = {
                      type        : MessageIds.TERN_INIT_MSG,
                      dir         : dir,
                      files       : files,
                      env         : ternEnvironment,
                      timeout     : PreferencesManager.get("jscodehints.inferenceTimeout")
                  };
                  _ternNodeDomain.exec("invokeTernCommand", msg);
              });
              rootTernDir = dir + "/";
          }
docs: Create a new tern server.