Giter Club home page Giter Club logo

Comments (7)

p-bakker avatar p-bakker commented on July 28, 2024

I assume this should say "When editor is saved" instead of "When completion is done"?

from tern.java.

angelozerr avatar angelozerr commented on July 28, 2024

I assume this should say "When editor is saved" instead of "When completion is done"?

No. Today when completion, hyperlink, hover is done, the full JS content coming from the editor is posted to the tern server ("full" type is used for that).

With tern it's possible to post a "partial" JS content to execute completion, hyperlink, hover. This feature is interesting when the editor has a big JS. See http://ternjs.net/doc/manual.html and search "part"

from tern.java.

angelozerr avatar angelozerr commented on July 28, 2024

The completion with big file file like ember.js doesn't work because timeout is every time thrown because it takes too time to analyze the file.

If you take the demo http://ternjs.net/doc/demo/#simple and you copy/paste ember.js, teh first time completion is slow and teh second time it is fast, because it uses "part" file.

To add this feature inside tern.java, we need to know the start and end offset where update was done. To do that we must add a listener for IDocument to track sart + end offset.**My idea is to use TernDocumentFile and have ONE instance per editor of TernDocumentFile to add adocument listener to track start/end offset of the update (today we create an instance each time for completion, hyperlink)

@piotrtomiak are you OK to have ONE instance of TernDocumentFile per editor?

from tern.java.

piotrtomiak avatar piotrtomiak commented on July 28, 2024

@angelozerr - I have done support for part files through comparison. I will update you on whether we can contribute this.

from tern.java.

angelozerr avatar angelozerr commented on July 28, 2024

@piotrtomiak I'm sorry I have not understood? You have already implemented tern file "part" (see http://ternjs.net/doc/manual.html) instead of "full" (like today?). If it that and you can contribute it, it should really fantastic, otherwise I will implement it and are you OK to have ONE instance of TernDocumentFile per editor?

from tern.java.

piotrtomiak avatar piotrtomiak commented on July 28, 2024

@angelozerr yeah, exactly. Not much coding :) I will create PR soon, today or tomorrow morning.

from tern.java.

angelozerr avatar angelozerr commented on July 28, 2024

@angelozerr yeah, exactly. Not much coding :) I will create PR soon, today or tomorrow morning.

Wow, very cool! I'm very exciting with your PR:) Thanks!

from tern.java.

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.