adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.25k stars 7.62k forks source link

[js code hints] code hints are affected by a javascript loading a module with require. #4192

Open jodyzhang opened 11 years ago

jodyzhang commented 11 years ago

1.open folder brackets/src/extensions/default/JavaScriptCodeHints/unittest-files/non-module-test-files into bracket

2.check code hints for app.js file by putting a cursor at app. ->you will see code hints:a,b,c,d,b1

3.under the folder, create a module file called MyModule.js with contents:

define(function (require, exports, module) {
    "use strict";
    exports.TestA = function (a, b) {};
    exports.TestB = function () {
        return "a string";
    };
    exports.j = "hi";
});

4.create another js file under same directory called test.js with content:

/*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, indent: 4, maxerr: 50 */
/*global brackets, require */

require(["MyModule"], function (myModule) {
    'use strict';
    var x = myModule.TestA;
});

5.reload the app.js and repeat step 1 for app. for code hint ->there is only d left for code hint.

Expect: step 5, code hint should be same.

njx commented 11 years ago

To @eztierney for prioritization and assignment.

redmunds commented 10 years ago

Was assigned to tern team, so marking "Needs Review".