Closed Bug 116020 Opened 23 years ago Closed 16 years ago

LXR does not cross-reference Javascript

Categories

(Webtools Graveyard :: MXR, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adamf, Assigned: adamf)

Details

(Keywords: helpwanted)

Attachments

(1 file, 3 obsolete files)

LXR does not cross reference javascript, so doing searches for identifiers in
javascript is a pain, and this slows down work for XUL/UI development (at least,
it does at my company :) )
Attaching patches to genxref and to Common.pm

patches are made with diff -C 2 newfile originalfile

Know issues: Identifiers with the same name in C/C++ and JS are indexed between

both langauges, with the C/C++ instance taking priority. For example, if the
C/C++ has:

int bobsYourUncle;

and the JS has:

var bobsYourUncle;

LXR will tell the user it is declared in the C/C++ and make all other
occurances
of bobsYourUncle link to the C/C++ declaration.


Also, I had to remove fileidx and xref before I ran the new genxref.
Patch as per above comment.
um. your patch is against genxref 1.2. tip is 1.5, there are conflicts.
also, your patch is -Reversed and not a cvs diff.  I'll try to rehab.

beyond that, some of your changes will conflict with my idl patch.
the other file was against Common.pm 1.12 or older (Current is 1.23)
Attachment #62208 - Attachment is obsolete: true
Attachment #62209 - Attachment is obsolete: true
Timeless - I didn't checkout the mozilla version, instead went with the 0.3
version from the lxr distro site. My bad. Thanks for the cleanup - this is my
first patch and wasn't sure the proper methods.

My patch was against unmodified lxr-0.3, the current stable release. The current
development release is lxr-0.9, which my patch would do nothing but harm to. :)

lxr-0.9 doesn't support javascript either, but it looks to be a much simpler
addition then 0.3. It appears that mozilla.org is running a modified 0.3, so the
patch remains vaild, but the features added in 0.9 are amazing - languages are
based on whatever ectags supports (including perl, make, java), the backend is
database driven and the updates to the xref database is done incrementaly (sp?).
Just a FYI.


Switching to the latest LXR (dev version) and latest ctags should make it easy
to support JS. ctags 5.5 brought support for JS according to ctags changelog. We
have several languages in the Mozilla tree and it would be really nice to do
something about LXR to support them...
sorry for the amazing delay, not sure what's going on, but afaik since running
with this patch, i get problems relating to ident results.

http://landfill.mozilla.org/mxr-test/mozilla/search?string=InitLiveConnectClasses&regexp=on&find=%5C.c%2Ap%2Ah%2A%24&filter=InitLiveConnectClasses.%2A%2C
http://landfill.mozilla.org/mxr-test/mozilla/ident?i=InitLiveConnectClasses

i've finally started to half understand the corruption in mxr-test ident
i'm looking for soneone who can try to figure out what's going wrong
http://landfill.mozilla.org/mxr-test/webtools/source/mxr-test/ident
is the ident code, and the other related files are siblings. if someone
needs the db, it's of course on landfill, but probably not exposed by apache.

it's quite possible that the bad output is my fault, but, i don't have real time
to look into this problem (it's taken me well over a year to get around to
at least recognizing half of what's going wrong...).
Keywords: helpwanted
Attached patch fixedSplinter Review
here are the main problems that i ran into with adam's patch:
file numbers were stomped on, which resulted in C identifiers pointing to random js files
#defines were busted
typedefs didn't work

I've fixed file references and defines. and I think most of typedefs.

As can probably be seen by this patch, I decided that I didn't like the parsing algorithm used for JS, so I kind of rewrote a portion of it.

This is not live on landfill because my ssh connection to landfill is really hard to reach. I'll stick it up shortly.
Assignee: adamf → timeless
Attachment #62273 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #225362 - Flags: review+
QA Contact: timeless → lxr
So is it fixed now ?
Assignee: timeless → adamf
Status: ASSIGNED → NEW
mozilla/webtools/lxr/genxref 	1.6
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: