Git Product home page Git Product logo

Comments (2)

jgiles avatar jgiles commented on May 2, 2024

Hmm, this could be really tricky. We don't even know what the properties should be for the second argument for createDom (it's typed as (Object|null|string|undefined)), and even if we did we'd have to map that type onto the argument we're passing in (Tern doesn't support that currently), and I'm guessing we would have trouble with the parser here. In this particular instance, you really could pass any keys in for the properties.
I'm also not sure that that this is common enough to be all that helpful even if we did get it working.

from tern-closure.

angelozerr avatar angelozerr commented on May 2, 2024

Hmm, this could be really tricky.

I know but in AngularJS Eclipse (https://github.com/angelozerr/angularjs-eclipse) I have more and more issues about this feature. More once this feature will be done, I could validate too the parameters with tern-lint (https://github.com/angelozerr/tern-lint/wiki/Validation-Rules)

So I have started to develop this feature for AngularJS (see ternjs/tern#387)

The basic idea is to hard code the JSON schema of the object (ex : createDom has style property, etc) and attach this schema in the objectType retrieved by the function declared with !effect. In this function we search the object litteral and attach the well JSON schema.

After that I use completion hook to search ObjectExpression and test if the current objectType have JSON schema attached. If I have a JSON schema, I populate the tern completion with missing properties.

We don't even know what the properties should be for the second argument for createDom

Yes I know, We need to do that with !effect function

In this particular instance, you really could pass any keys in for the properties.

Sorry I don't understand?

I'm also not sure that that this is common enough to be all that helpful even if we did get it working.

JS framework uses a lot of object litteral and I find it's very hard to know which properties you can use it.I would like to for instance support this feature too for Google Maps Tern plugin https://github.com/angelozerr/tern.java/wiki/Tern-&-Google-Maps-support

As you are very talented, I would like to find a clean mean to support objet litteral inside tern. Hope you will able to help me. Many thank's!

from tern-closure.

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.