code: function (args, callback) {
          if (ternserver) {
            ternserver.request({
                query: {
                  type: "definition",  //$NON-NLS-1$
                  file: args.meta.location,
                  end: args.params.offset,
                  guess: args.guess
                },
                files: args.files
              },
              function (error, decl) {
                if (error) {
                  callback({request: 'definition', error: error.message, message: Messages['failedToComputeDecl']}); //$NON-NLS-1$
                }
                if (decl && typeof decl.start === 'number' && typeof decl.end === "number") {
                  callback({request: 'definition', declaration: decl}); //$NON-NLS-1$
                } else if (decl && decl.origin) {
                  //tern guessed at it when there is no line infos
                  var idx = decl.origin.lastIndexOf(".");
                  if (idx > -1 && decl.origin.slice(idx) === ".js") {
                    decl.guess = true;
                  } else {
                    delete decl.guess;  //sometimes Tern will set the guess flag, we only want the index flag
                    decl.index = true;
                  }
                  callback({request: 'definition', declaration: decl}); //$NON-NLS-1$
                } else {
                  callback({request: 'definition', declaration: null}); //$NON-NLS-1$
                }
              });
          } else {
            callback({request: 'definition', message: Messages['failedToComputeDeclNoServer']}); //$NON-NLS-1$
          }
        }
docs: /* definition message handler