Code Monkey home page Code Monkey logo

Comments (13)

angelozerr avatar angelozerr commented on June 16, 2024

Could you explain more your need?

Perhaps you should see https://github.com/angelozerr/CodeMirror-XQuery/blob/master/codemirror-javascript/addon/hint/tern/tern-extension.js (CodeMirror.ternHint = function(cm, c) {
function c1(data) { => line 43), I have extended the éofficial" CodeMirror tern addon to add "templates" hint.

from codemirror-xquery.

ayush-jayaswal avatar ayush-jayaswal commented on June 16, 2024

I am actually working on a project and we have created a JS editor which provides auto completion. So i have used your add ons. But on using this add on it displays only JavaScript functions in autocompletion. Since my project contains many infra files also and i need to show functions of that infra files through autocompletion feature.
So how can i achieve that?

P.S i need autocompletion with method parameters too..

from codemirror-xquery.

angelozerr avatar angelozerr commented on June 16, 2024

To add your own completion with tern, the best mean is to create defs file like I have done here https://github.com/angelozerr/CodeMirror-XQuery/tree/master/codemirror-javascript/addon/hint/tern/defs

But perhaps you wish to use directly your js file and your file should be added to tern server (I must modify my addon to do that).

For parameter completion, I would like to manage that too (eg: show only number vars after str.slice(
but I must study if it's possible with tern.

from codemirror-xquery.

ayush-jayaswal avatar ayush-jayaswal commented on June 16, 2024

If i have multiple functions in multiple Js files then what can i do?
Can i simply directly declare all these function signature in a global array and with tern it could automatically detect all the functions with method parameters.
Can you provide code of this?

from codemirror-xquery.

angelozerr avatar angelozerr commented on June 16, 2024

Creating your own Tern def (see https://github.com/angelozerr/CodeMirror-XQuery/tree/master/codemirror-javascript/addon/hint/tern/defs ) could help you no?

from codemirror-xquery.

ayush-jayaswal avatar ayush-jayaswal commented on June 16, 2024

So i will have to write my own def but seems a quite lengthy process to declare all the functions..
Is there any way by which i could import the Js files and the code could automatically detect all the functions inside that Js File.

from codemirror-xquery.

angelozerr avatar angelozerr commented on June 16, 2024

I'm not a big expert with Tern, but I think you could define use getFile function to add your own JS file. Never played with that.

from codemirror-xquery.

ayush-jayaswal avatar ayush-jayaswal commented on June 16, 2024

Can you provide the function through which we can import JS files directly.

from codemirror-xquery.

angelozerr avatar angelozerr commented on June 16, 2024

I suggest you to post your question on CodeMirror forum.

from codemirror-xquery.

as3boyan avatar as3boyan commented on June 16, 2024

@ayush-jayaswal Tern demo uses something like server.addFile and Tern demo shows completion for custom function as you may seen in Tern demo

from codemirror-xquery.

ayush-jayaswal avatar ayush-jayaswal commented on June 16, 2024

How do i configure tern server to include user-defined .js files so as to provide method auto complete.

from codemirror-xquery.

angelozerr avatar angelozerr commented on June 16, 2024

As I said you, I suggest you to post your question on CodeMirror forum.

from codemirror-xquery.

sebasmoyano avatar sebasmoyano commented on June 16, 2024

Any chance to re-open this requirement?

from codemirror-xquery.

Related Issues (12)

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.