code: function getFileInfo(session, preventPartialUpdates) {
          var start = session.getCursor(),
              end = start,
              document = session.editor.document,
              path = document.file.fullPath,
              isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html",
              result;
  
          if (isHtmlFile) {
              result = {type: MessageIds.TERN_FILE_INFO_TYPE_FULL,
                  name: path,
                  text: session.getJavascriptText()};
          } else if (!documentChanges) {
              result = {type: MessageIds.TERN_FILE_INFO_TYPE_EMPTY,
                  name: path,
                  text: ""};
          } else if (!preventPartialUpdates && session.editor.lineCount() > LARGE_LINE_COUNT &&
                  (documentChanges.to - documentChanges.from < LARGE_LINE_CHANGE) &&
                  documentChanges.from <= start.line &&
                  documentChanges.to > end.line) {
              result = getFragmentAround(session, start);
          } else {
              result = {type: MessageIds.TERN_FILE_INFO_TYPE_FULL,
                  name: path,
                  text: getTextFromDocument(document)};
          }
  
          documentChanges = null;
          return result;
      }
docs: Get an object that describes what tern needs to know about the updated
  file to produce a hint. As a side-effect of this calls the document
  changes are reset.
  
  @param {!Session} session - the current session
  @param {boolean=} preventPartialUpdates - if true, disallow partial updates.
  Optional, defaults to false.
  @return {{type: string, name: string, offsetLines: number, text: string}}