It's done so we can match up with the names that Tern uses. Tern puts the origin of each hint returned. Using this be can distinguish between "builtin" definitions and user definitions and give user definitions priority.

Hints that come from JSON files have the name of the library as the origin, those names do not have an extension.


From: Kevin Dangoor <notifications@github.com<mailto:notifications@github.com>>
Reply-To: adobe/brackets <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Thursday, April 18, 2013 11:05 AM
To: adobe/brackets <brackets@noreply.github.com<mailto:brackets@noreply.github.com>>
Cc: Darrell Loverin <dloverin@adobe.com<mailto:dloverin@adobe.com>>
Subject: Re: [brackets] Switch js code hinting to be powered by tern. (#3439)


In src/extensions/default/JavaScriptCodeHints/Session.js:

> -     * @param {Object} scopeInfo - scope information, including the scope and
> -     *      lists of identifiers, globals, literals and properties, and a set
> -     *      of associations
> -     */
> -    Session.prototype.setScopeInfo = function (scopeInfo) {
> -        this.scope = scopeInfo.scope;
> -        this.identifiers = scopeInfo.identifiers;
> -        this.globals = scopeInfo.globals;
> -        this.literals = scopeInfo.literals;
> -        this.properties = scopeInfo.properties;
> -        this.associations = scopeInfo.associations;
> -    };
> +            return builtin;
> +        });
> +
> +        this.builtins.push("requirejs.js");     // consider these globals as well.


Why is the ".js" removed from the others but included for require?

—
Reply to this email directly or view it on GitHub<https://github.com/adobe/brackets/pull/3439/files#r3855439>.