code: function handleTernCompletions(response) {
  
          var file = response.file,
              offset = response.offset,
              completions = response.completions,
              properties = response.properties,
              fnType  = response.fnType,
              type = response.type,
              error = response.error,
              $deferredHints = getPendingRequest(file, offset, type);
  
          if ($deferredHints) {
              if (error) {
                  $deferredHints.reject();
              } else if (completions) {
                  $deferredHints.resolveWith(null, [{completions: completions}]);
              } else if (properties) {
                  $deferredHints.resolveWith(null, [{properties: properties}]);
              } else if (fnType) {
                  $deferredHints.resolveWith(null, [fnType]);
              }
          }
      }
docs: Handle the response from the tern node domain when
  it responds with the list of completions
  
  @param {{file: string, offset: {line: number, ch: number}, completions:Array.<string>,
  properties:Array.<string>}} response - the response from node domain