Coder Social home page Coder Social logo

Comments (4)

marijnh avatar marijnh commented on August 19, 2024

Definition locations are currently only tracked for variables and function/object types. base.foo is not a variable, and holds a number, so Tern currently doesn't associate a location with it.

I could store locations in property definitions, but I'm not sure how useful that would be. Thoughts?

from tern.

jeffkenton avatar jeffkenton commented on August 19, 2024

Thanks. That was what I was seeing during debugging, but wasn't sure why. Our testers thought it was a natural thing to try.

from tern.

petetronic avatar petetronic commented on August 19, 2024

That would explain another scenario I believe this impacts - module exports... in the code below, usages of this module cannot jump to the exported title var definition because it is assigned a String. If you assign it an Object, jump to definition works.

/*global define */

define(function (require, exports, module) {
    "use strict";

    var title = "Apples";

    function getCompleteTitle() {
        return title + " and Oranges";
    }

    exports.getCompleteTitle = getCompleteTitle;
    exports.title = title;
});

from tern.

marijnh avatar marijnh commented on August 19, 2024

See commit aa3bcb8 , which cleans up the way properties and variables have their definition tracked, and fixes this issue in the process.

from tern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.