Re: [CEDET-devel] Adding new language to CEDET
Brought to you by:
zappo
From: Arun <aru...@gm...> - 2012-06-07 12:00:52
|
Cool . Completion works thus , which is great. Just one more question . Is there any way to implement javascript jump . According to me most of the javascript code will be either a JSON or a prototype inheritence. Currently I have ctags installed and jump works on php. Do you know how to add a new language to ctags . I can write some regexp but I just need to know where to start. Again thank you for your help. Bless Emacs.! On Tue, Jun 5, 2012 at 12:37 AM, David Engster <de...@ra...> wrote: > Eric M. Ludlam writes: > > On 05/29/2012 04:58 AM, Arun wrote: > >> Hi, > >> > >> I am not able to see any tags for jquery javascript. Whereas I am able > >> to see the same for plain javascript and php. How do I generate tags for > >> jquery javascript > > > > Hi Arun, > > > > Is the mode for jquery different than that of a javascript file? If so, > > you probably need to add a like like this to your .emacs file: > > > > (add-hook 'jquery-mode-hook 'semantic-javascript-setup-parser) > > > > though I don't know what the jquery mode or mode-hook might be. > > > > If jquery is not pure javascript, the parser might run into trouble. > > jQuery is a framework written in Javascript; there's no special mode for > it. > > jQuery is usually included through <script src=...> tags in the head of > the HTML page. Semantic currently does not support that. But even if it > did, it probably wouldn't help much, since Javascript is a very dynamic > language. It does not have classes but only objects, which can be > changed and extended on the fly almost anywhere. This is why frameworks > like jQuery usually use factory methods to generate objects; it makes > parsing through static analysis very hard. > > The easy solution is to simply load your current code into a browser and > let Semantic query it for information on currently existing objects. > This is what I've written for Firefox and mozrepl. See > > http://www.randomsample.de/dru5/node/147 > > on how to set this up. > > -David > |