Yeah.  That routine is new.  Easy to do.


From: Erik Tierney <notifications@github.com<mailto:notifications@github.com>>
Reply-To: adobe-research/brackets <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, April 8, 2013 4:11 PM
To: adobe-research/brackets <brackets@noreply.github.com<mailto:brackets@noreply.github.com>>
Cc: Adobe <kenton@adobe.com<mailto:kenton@adobe.com>>
Subject: Re: [brackets] Added Goto Definition. (#11)


In src/extensions/default/JavaScriptCodeHints/tern-worker.js:

> +        function buildRequest(dir, file, query, offset){
> +            query = {type:query};
> +            query.start = offset;
> +            query.end = offset;
> +            query.file = file;
> +            query.filter = false;
> +            query.sort = false;
> +            query.depths = true;
> +            query.types = true;
> +            query.lineCharPositions = true;
> +
> +            var request = {query:query, files:[], offset:offset};
> +            request.files.push({type:"full", name:file, text:text});
> +
> +            return request;
> +        }


Can we re-use the existing buildRequest function? It looks almost identical to this. You can always set any additional flags after you call build request, like we do in handleFunctionType(...).

—
Reply to this email directly or view it on GitHub<https://github.com/adobe-research/brackets/pull/11/files#r3701973>.