GithubHelp home page GithubHelp logo

mozilla / doctorjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evilpie/jsctags

737.0 38.0 67.0 2.68 MB

A set of static analysis tools for JavaScript

License: Other

Makefile 0.08% Shell 0.31% JavaScript 99.50% CSS 0.11%

doctorjs's Introduction

Overview

jsctags is a [ctags] 1-compatible code indexing solution for JavaScript. Its interface and output are essentially identical to [Exuberant Ctags] 2, but, instead of simply parsing the JavaScript, jsctags uses a simple form of abstract interpretation to determine which symbols are exported. This allows jsctags to achieve much better results than Exuberant Ctags. Popular libraries such as jQuery and CommonJS modules can now be meaningfully indexed.

You can use jsctags to create tags files that are usable in many editors, from Vim to TextMate (via the [CodeBrowser] 3 plugin). jsctags is slated to become a key component of the [Bespin] 4 IDE, where it will be used to provide code completion.

jsctags is written entirely in JavaScript, using CommonJS modules, the [node.js] 5 framework, and the [Narcissus] 6 engine.

License

jsctags is tri-licensed under the Mozilla Public License 1.1, the GNU General Public License 2.0, and the GNU Lesser General Public License 2.1.

Requirements

  • node.js
  • make

Building

To install:

  • make install

To uninstall:

  • make uninstall

To play with Narcissus' parser:

  • make serve
  • Navigate to [http://localhost:8080/html/parser.html] parser.

Usage

Simply go to your project root and invoke jsctags lib (replacing lib with the directory in which your JavaScript source files are stored). The tags file will be placed in the current directory.

For more options, try jsctags -h.

Directory structure

The directory structure mostly follows the CommonJS packaging scheme:

  • bin/: tools runnable from node.js (should be directly executable in Unix)
  • html/: in-browser demo files
  • js/: support files for the HTML demos
  • lib/: CommonJS-compliant library files
  • lib/ctags/: the core jsctags code
  • narcissus/: the Narcissus engine
  • test/: test cases for the indexer

doctorjs's People

Contributors

cmaxo avatar dimvar avatar espadrine avatar ianks avatar int3 avatar oryband avatar pcwalton avatar sergioramos avatar taxilian avatar zmmbreeze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doctorjs's Issues

Project still alive?

I'm getting errors trying to run jsctags:

TypeError: util.puts is not a function

After replacing all of them to console.log:

jsctags.js:195
*                 throw e;
                  ^
SyntaxError: ..../file/...:1: Illegal Token

Support for harmony generators

Currently it throws syntax error if you try run jsctags over ES6 generators code.

Any information when this will be available?

Make Install Error 71

I get the following error when running make install.

install -d /usr/local/bin
install bin/jsctags.js /usr/local/bin/jsctags
install -d /usr/local/lib/jsctags
install lib/jsctags/getopt.js lib/jsctags/log.js lib/jsctags/paperboy.js lib/jsctags/traits.js lib/jsctags/underscore.js /usr/local/lib/jsctags
install -d /usr/local/lib/jsctags/ctags
install lib/jsctags/ctags/index.js lib/jsctags/ctags/interp.js lib/jsctags/ctags/nativefn.js lib/jsctags/ctags/reader.js lib/jsctags/ctags/writer.js /usr/local/lib/jsctags/ctags
install -d /usr/local/lib/jsctags/narcissus
install lib/jsctags/narcissus/index.js lib/jsctags/narcissus/jscfa.js lib/jsctags/narcissus/jsdefs.js lib/jsctags/narcissus/jslex.js lib/jsctags/narcissus/jsparse.js /usr/local/lib/jsctags/narcissus
install: lib/jsctags/narcissus/index.js: No such file or directory
make: *** [install] Error 71

Question: Outputting CFG?

Does doctorjs allow outputting of a CFG and a visualization of it? I'm having trouble compiling it so I cant tell.

spurious \r in tags files on windows

lib/cfa2/jscfa.js, function getTags, function regexify

On windows, for files with CRLF line terminators, this will generate tag search patterns ending in \r, which will then fail to match in the editor.

workaround: drop \r at the end of tag search patterns (line 3648)

    return "/^" + str.replace(/[\\/$\n\r\t]/g, subst).replace(/\\r$/,'') + "$/"; // double end

A proper fix would avoid splitting CRLF when splitting files into lines.

Running jsctags on the js files in the doctorjs repository fails

If I attempt to run find . -name '*.js' | xargs jsctags from the root of the doctorjs repository, I receive the following error:


/usr/local/bin/jsctags:195
                throw e;
                      ^
SyntaxError: ./bin/dr.js:1: Illegal token
    at Object.Narcissus.lexer.Tokenizer.newSyntaxError (/usr/local/narcissus/lib/jslex.js:546:21)
    at Object.Narcissus.lexer.Tokenizer.get (/usr/local/narcissus/lib/jslex.js:527:28)
    at Object.Narcissus.lexer.Tokenizer.peek (/usr/local/narcissus/lib/jslex.js:176:27)
    at Object.done (/usr/local/narcissus/lib/jslex.js:149:25)
    at Statements (/usr/local/narcissus/lib/jsparse.js:394:22)
    at Script (/usr/local/narcissus/lib/jsparse.js:180:9)
    at parse (/usr/local/narcissus/lib/jsparse.js:1841:17)
    at Object.exports.Tags.Object.create.Trait.compose.Trait.scan (/usr/local/lib/jsctags/ctags/index.js:101:19)
    at processPath (/usr/local/bin/jsctags:189:18)
    at Object.<anonymous> (/usr/local/bin/jsctags:207:5)```

Granted, this means that there is invalid javascript in the file. But jsctags should not bomb out because one line fails.  

Even if it is too much trouble for the parser to throw out bad input and continue, jsctags should at least run the rest of it's arguments. 

Process multiple files together

Right now, doctorjs treats every file individually. This means that if a namespace is declared in a separate file, it won't understand anything in that namespace in other files.

It would be nice to build one AST from all files instead of processing file-by-file.

Error: Cannot find module 'underscore' when invoking jsctags

Just pulled the latest changes and also git submodule update, and got the following error when executing jsctags.

OSX Snow Leopard 10.6.8
Node 0.4.11

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Cannot find module 'underscore'
    at Function._resolveFilename (module.js:317:11)
    at Function._load (module.js:262:25)
    at require (module.js:346:19)
    at Object.<anonymous> (/usr/local/bin/jsctags:42:9)
    at Module._compile (module.js:402:26)
    at Object..js (module.js:408:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at Array.<anonymous> (module.js:421:10)
    at EventEmitter._tickCallback (node.js:126:26)

Should Underscore be a submodule of doctorjs or something?

Makefile: configurable narcissus, don't mess with ~/.profile

  • With narcissus now a proper submodule, it can be useful to take sources for make install from an existing repo.
  • keep make install from messing with ~/.profile: it isn't nice, it does not achieve the purpose of setting an environment variable (eg, when running node from a shell that doesn't process ~/.profile), it might overwrite existing .profile.bak, ..

patch is here.

This might need further refinement, eg when NODE_PATH is empty, setting it to "somepath:" isn't quite right. But that is now just a message, so it is an improvement.

Notify user he should add jsctags to $NODE_PATH after installation.

This isn't stated clearly. I had to search the issues pages to figure that out myself.

After make install you can add /usr/local/lib/jsctags to your current session's $NODE_PATH manually by executing . ~/.profile. However, it is not stated anywhere you should add it to your .bashrc / .bash_profile in order for it to work from everywhere.

It's not apparent for people who are not experienced with doctorjs or Node.

See issues #18 & #20 for examples.

Object #<EventEmitter> has no method 'uptime'

Today I clone doctorjs and install it. So I have some errors here:

$ node --version
v0.4.9

$ jsctags -f - test/static/test.js
Object #<EventEmitter> has no method 'uptime'
Trace: 
  at cfa2 (/usr/local/lib/cfa2/jscfa.js:3686:15)
  at getTags (/usr/local/lib/cfa2/jscfa.js:3750:3)
  at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
  at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
  at processPath (/usr/local/bin/jsctags:189:18)
  at Object.<anonymous> (/usr/local/bin/jsctags:207:5)
  at Module._compile (module.js:402:26)
  at Object..js (module.js:408:10)
  at Module.load (module.js:334:31)
  at Function._load (module.js:293:12)
Object #<EventEmitter> has no method 'uptime'

node.js:134
    throw e; // process.nextTick error, or 'error' event on first tick
    ^
TypeError: Object #<EventEmitter> has no method 'uptime'
  at evalFun (/usr/local/lib/cfa2/jscfa.js:3467:15)
  at evalToplevel (/usr/local/lib/cfa2/jscfa.js:3639:7)
  at cfa2 (/usr/local/lib/cfa2/jscfa.js:3678:5)
  at getTags (/usr/local/lib/cfa2/jscfa.js:3750:3)
  at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
  at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
  at processPath (/usr/local/bin/jsctags:189:18)
  at Object.<anonymous> (/usr/local/bin/jsctags:207:5)
  at Module._compile (module.js:402:26)
  at Object..js (module.js:408:10)

`make install` error (another one)

Just fetched the latest master branch and make install. Here's the output:

~/Documents/dotfiles/doctorjs$ make install
install -d /usr/local/bin
install bin/jsctags.js /usr/local/bin/jsctags
install -d /usr/local/lib/jsctags
install lib/jsctags/getopt.js lib/jsctags/log.js lib/jsctags/paperboy.js lib/jsctags/traits.js lib/jsctags/underscore.js /usr/local/lib/jsctags
install -d /usr/local/lib/jsctags/ctags
install lib/jsctags/ctags/index.js lib/jsctags/ctags/interp.js lib/jsctags/ctags/nativefn.js lib/jsctags/ctags/reader.js lib/jsctags/ctags/writer.js /usr/local/lib/jsctags/ctags
install -d /usr/local/lib/jsctags/narcissus
install lib/jsctags/narcissus/index.js lib/jsctags/narcissus/jscfa.js lib/jsctags/narcissus/jsdefs.js lib/jsctags/narcissus/jslex.js lib/jsctags/narcissus/jsparse.js /usr/local/lib/jsctags/narcissus
install: lib/jsctags/narcissus/index.js: No such file or directory
make: *** [install] Error 71

can't install doctorjs

as title said, when i run make install on my machine, it will fail as following: narcissus is empty. go to narcissus repository but found its file names are totally different from the ones listed below. any ideas??

install: cannot stat ‘narcissus/lib/jsbrowser.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsdecomp.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsdefs.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsdesugar.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsexec.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jslex.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsparse.js’: No such file or directory
install: cannot stat ‘narcissus/lib/jsresolve.js’: No such file or directory
make: *** [install] Error 1

bin/jsctags directory recursion does not work on windows

processPath uses fs.statSync's st.ino to avoid looping. That component tends to be zero on windows, so recursive processing stops as all paths look the same to idFor.

workaround 1 (might loop): don't check for link cycles

    var id = 'path:'+p; // idFor(st); // ino always zero?

workaround 2 (requires hacking): try using FileIndex from [GetFileInformationByHandle](http://msdn.microsoft.com/en-us/library/aa363788(v=vs.85\).aspx)

GetFileInformationByHandle() is the Win32 equivalent for the _fstat() C Run-time function.
Win32 Equivalents for C Run-Time Functions

Further info:

The inode, and therefore st_ino, has no meaning in the FAT, HPFS, or NTFS file systems.
[_stat, _wstat Functions](http://msdn.microsoft.com/de-de/library/14h5k7ff(VS.90\).aspx)

jsctags should be able to generate tags for itself. I had to check the sources to figure out how that is supposed to work, and why it doesn't work on windows atm (there is also a line ending problem, and bin/jsctags will not be processed at all due to lack of .js ending). It appears that noone is using jsctags on windows?

Error: require.paths is removed.

When running most of the JS files in doctorjs, they yield the following error. 'make serve' for instance:
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.

Object #<EventEmitter> has no method 'uptime'

~ jsctags cache.js

Object # has no method 'uptime'
Trace:
at cfa2 (/usr/local/lib/cfa2/jscfa.js:3692:15)
at getTags (/usr/local/lib/cfa2/jscfa.js:3756:3)
at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
at processPath (/usr/local/bin/jsctags:189:18)
at Object. (/usr/local/bin/jsctags:207:5)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)
at Module.load (module.js:343:31)
at Function._load (module.js:302:12)
Object # has no method 'uptime'

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object # has no method 'uptime'
at evalFun (/usr/local/lib/cfa2/jscfa.js:3472:15)
at evalToplevel (/usr/local/lib/cfa2/jscfa.js:3644:7)
at cfa2 (/usr/local/lib/cfa2/jscfa.js:3683:5)
at getTags (/usr/local/lib/cfa2/jscfa.js:3756:3)
at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
at processPath (/usr/local/bin/jsctags:189:18)
at Object. (/usr/local/bin/jsctags:207:5)
at Module._compile (module.js:411:26)
at Object..js (module.js:417:10)

Cannot read property 'type' of undefined

I have had a problem running jsctags on underscore.js and backbone.js both of them reporting Cannot read property 'type' of undefined. The entire error looks like the following:

Cannot read property 'type' of undefined

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Cannot read property 'type' of undefined
    at Object.<anonymous> (/usr/local/lib/cfa2/jscfa.js:1168:12)
    at Object.recur (/usr/local/lib/cfa2/jscfa.js:578:41)
    at /usr/local/lib/cfa2/jscfa.js:588:13
    at Array.forEach (native)
    at Object._haskids (/usr/local/lib/cfa2/jscfa.js:586:8)
    at Object.recur (/usr/local/lib/cfa2/jscfa.js:578:41)
    at /usr/local/lib/cfa2/jscfa.js:588:13
    at Array.forEach (native)
    at Object._haskids (/usr/local/lib/cfa2/jscfa.js:586:8)
    at Object.recur (/usr/local/lib/cfa2/jscfa.js:578:41)

The error message didn't seem to point me towards the source of the error. However in both of these libraries I was able to track down the source of the error to the following.

In backbone.js:

  if (typeof exports !== 'undefined') {

and

  if (!_ && (typeof require !== 'undefined')) _ = require('underscore');

In underscore.js:

 if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {

It appears this method of checking if we are in node.js is causing problems.

Any suggested workaround for this?

Range Error

When I try to run jsctags on a directory with jquery.js in it, I get a "Range Error" from node.js, telling me that the stack limit was exceeded.

Is there a way to set the stack limit to a higher number?

node.js:201 error when output to stdout

output to file is fine
$ jsctags -f tag helloworld.js

but if try to output to stdout (which is default behavior by tagbar) node.js throw an error
$ jsctags -f - helloworld.js
!_TAG_FILE_FORMAT 2 /extended format/
!_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Patrick Walton /[email protected]/
!_TAG_PROGRAM_NAME jsctags //
!_TAG_PROGRAM_URL http://github.com/pcwalton/jsctags /GitHub repository/
!_TAG_PROGRAM_VERSION 0.1 //
start helloworld.js /^helloworld.start = function(){$/;" f lineno:18 type:void function()
%anonymous_function helloworld.js /^ goog.events.listen(target,['mousedown','touchstart'],function(e){$/;" f lineno:41 type:void function(any)
%anonymous_function helloworld.js /^ e.swallow(['mouseup','touchend'],function(){$/;" f lineno:55 type:void function()


node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: process.stdout cannot be closed
    at WriteStream.<anonymous> (node.js:284:15)
    at Object.<anonymous> (/usr/bin/jsctags:273:5)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:470:10)
    at EventEmitter._tickCallback (node.js:192:40)

Fix broken Makefile

There were some changes in the repo's dir structure, relating to narcissus subrepo. The Makefile needs to be updated to reflect this changes.

Right now the application can't be installed, and people have to add the repo's bin/ dir to their $PATH as a temporary workaround.

See issue #7 for details.

Skip `#!` in the beginning of a file

I'm not sure if it's a bug, but following code is valid in nodejs, however it causes exception when it's parsed by narcissus.

#!/usr/local/bin/node
console.log(1)

I'm leaving here the fix in case someone want to edit a file with #! construction:
Edit /usr/local/narcissus/lib/jslex.js:210:

if (this.lineno == 1 && ch === '#' && next === '!') {
    for (;;) {
        ch = input[this.cursor++];
        next = input[this.cursor];
        if (ch === '\r') {
            if (next !== '\n') ch = '\n';
        }
        if (ch === '\n') {
            if (this.scanNewLines) {
                this.cursor--;
            } else {
                this.lineno++;
                break;
            }
        }
    }
} else

I'm sorry that I'm doing it here, just because https://github.com/mozilla/narcissus has no bug-tracker, and I think the fix might help someone.

support the sha-bang syntax

When using javascript as a command line script language, I want to add the #!/usr/bin/env node at the first line to make bash use node.

But jsctags doesn't recogize it:

examples/coercion.js:1: Illegal token

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
SyntaxError: examples/coercion.js:1: Illegal token
    at Object.newSyntaxError (/usr/local/narcissus/lib/jslex.js:546:21)
    at Object.get (/usr/local/narcissus/lib/jslex.js:527:28)
    at Object.peek (/usr/local/narcissus/lib/jslex.js:176:27)
    at Object.done (/usr/local/narcissus/lib/jslex.js:149:25)
    at Statements (/usr/local/narcissus/lib/jsparse.js:394:22)
    at Script (/usr/local/narcissus/lib/jsparse.js:180:23)
    at parse (/usr/local/narcissus/lib/jsparse.js:1841:17)
    at Object.scan (/usr/local/lib/jsctags/ctags/index.js:101:19)
    at processPath (/usr/local/bin/jsctags:189:18)
    at Object.<anonymous> (/usr/local/bin/jsctags:207:5)

Could you consider this syntax?

jsctags no longer reports scope of tags

Hi,

I'm the author of Tagbar (http://majutsushi.github.com/tagbar/), a Vim plugin that can use jsctags to show an overview of the current file in a separate window. One useful aspect is that it can show the tags properly nested, and this worked fine with jsctags sometime in April. However, the current version doesn't report the tag scopes via extension fields like namespace anymore, which results in all tags being reported as top-level tags. It would be really useful if this functionality could be restored again.

'Didn't find a name for constructor' Error on tags genratation

Hi

I have tried to generate the tags using "jsctags ." command in folder with .js files, but I got an error:

$ jsctags .
Didn't find a name for constructor

/usr/local/bin/jsctags:195
                throw e;
                      ^
Error: Didn't find a name for constructor
    at errorWithCode (/usr/local/lib/cfa2/jscfa.js:157:11)
    at Array.toType (/usr/local/lib/cfa2/jscfa.js:1574:11)
    at /usr/local/lib/cfa2/jscfa.js:1994:18
    at Aval.forEachObj (/usr/local/lib/cfa2/jscfa.js:2020:5)
    at Aval.toType (/usr/local/lib/cfa2/jscfa.js:1993:8)
    at funToType (/usr/local/lib/cfa2/jscfa.js:3736:31)
    at getTags (/usr/local/lib/cfa2/jscfa.js:3786:24)
    at Object.interpret (/usr/local/lib/jsctags/ctags/interp.js:54:21)
    at Object.scan (/usr/local/lib/jsctags/ctags/index.js:104:16)
    at processPath (/usr/local/bin/jsctags:189:18)

My system info:

$ echo $NODE_PATH
/usr/local/lib/jsctags/:
$ node --version
v0.6.19
doctorjs$ git log -1
commit 96793072fb43cb0baca6025a187aeaf9f7cdfd79
Author: Dimitris Vardoulakis <[email protected]>
Date:   Sat Apr 14 15:45:09 2012 -0400

    Bugfix for exports in commonJS mode.

jsctags does not work with nodejs 0.10.0

Hi.
I'm on Ubuntu. and I found a problem yesterday.
Ubuntu package manager provides nodejs 0.6.x.
I'm trying grunt 0.4.* and grunt 0.4.x needs nodejs >= 0.8.
So I've downloaded and built nodejs 0.10.x (which is official new stable version.)

Then, jsctags has broke and issued some error message complaining about

Array.prototype.push called on null or undefined

/usr/local/bin/jsctags:195
throw e;
^
TypeError: Array.prototype.push called on null or undefined
at Object.exports.Tags.Object.create.Trait.compose.Trait.add (/usr/local/lib/jsctags/ctags/index.js:71:30)
at Object.exports.Tags.Object.create.Trait.compose.Trait.scan (/usr/local/lib/jsctags/ctags/index.js:105:14)
at processPath (/usr/local/bin/jsctags:189:18)
at Object. (/usr/local/bin/jsctags:207:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

at startup (node.js:119:16)

I figured a workaround for this situation.

  1. sudo -H npm install -g n : Install 'n' to use as node version management tool.
  2. sudo n 0.10.0 : to recognize 0.10.x that i've already installed
  3. sudo n 0.8.22 : to install 0.8.x, which works fine for jsctags and grunt.

maybe you need to sudo n use 0.8.22 to make 0.8.22 default. I'm not quite familiar with 'n'.

and when you get "node -v" "0.8.22". All problem solved for me.

Still, I think it would be better for jsctags work with node 0.10.x.

Thank you.

Analyzing jquery does not end.

I'm not sure this issue is new one. It might be the same issue as issue #5.
If I'm doing wrong, please forgive me. It's my first day at github.

When I try jsctags where jquery-1.6.2.min.js,
It never ends. CPU goes up to 100%....

I've tried about 5 times, I got an error message only once. The other times, I got no message at all.
The error message I've got was......

Maximum call stack size exceeded

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
RangeError: Maximum call stack size exceeded

So, is it possible to have more call stacks?

support emacs tag files

It looks like jsctags only ouputs vim style tag files. It would be awesome if it outputed emacs style tags files given the -e flag.

jsctags gives env: node: error

When running, jsctags, jsctags -h, or any other jsctags command, I get the following error:

env: node: No such file or directory

Anyone else having this problem?

Wiki changes

FYI: The following changes were made to this repository's wiki:

  • defacing spam has been removed

  • the wiki has been disabled, as it was not used

These were made as the result of a recent automated defacement of publically writeable wikis.

Make install error

Trying to make install doctorjs - I get the following error:

[example@example doctorjs]$ sudo make install
install -d /usr/local/bin
install bin/jsctags.js /usr/local/bin/jsctags
install -d /usr/local/lib/jsctags
install lib/jsctags/getopt.js lib/jsctags/log.js lib/jsctags/paperboy.js lib/jsctags/traits.js lib/jsctags/underscore.js /usr/local/lib/jsctags
install -d /usr/local/lib/jsctags/ctags
install lib/jsctags/ctags/index.js lib/jsctags/ctags/interp.js lib/jsctags/ctags/nativefn.js lib/jsctags/ctags/reader.js lib/jsctags/ctags/writer.js /usr/local/lib/jsctags/ctags
install -d /usr/local/lib/jsctags/narcissus
install lib/jsctags/narcissus/index.js lib/jsctags/narcissus/jscfa.js lib/jsctags/narcissus/jsdefs.js lib/jsctags/narcissus/jslex.js lib/jsctags/narcissus/jsparse.js /usr/local/lib/jsctags/narcissus
install: cannot stat `lib/jsctags/narcissus/index.js': No such file or directory
install: cannot stat `lib/jsctags/narcissus/jscfa.js': No such file or directory
install: cannot stat `lib/jsctags/narcissus/jsdefs.js': No such file or directory
install: cannot stat `lib/jsctags/narcissus/jslex.js': No such file or directory
install: cannot stat `lib/jsctags/narcissus/jsparse.js': No such file or directory
make: *** [install] Error 1

Any ideas?

Cannot find module 'ctags'

Hi,

I have some difficulties installing doctorjs (jsctags).

$ git clone https://github.com/mozilla/doctorjs.git
$ cd doctorjs/
$ git submodule update --init --recursive
$ sudo make install
$ jsctags ~/jsProject/lib/

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'ctags'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
at require (module.js:346:19)
at Object. (/usr/local/bin/jsctags:45:13)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)

$ node --version
v0.4.11

$ uname -a
Linux romain 3.0-ARCH #1 SMP PREEMPT Tue Aug 30 07:32:23 UTC 2011 i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz GenuineIntel GNU/Linux

Help is welcomed.

Cheers
Romain

TypeError: Cannot call method 'sort' of undefined

Hi! I'm using vim + tagbar plugin and this use jsctags for generate a tags explorer.

For configure it I folllow this:
https://github.com/majutsushi/tagbar/wiki#javascript

But, when I try to open the panel, vim reports this error:

Executed command: "'/usr/bin/jsctags'  -f -  '/tmp/v2XOofL/28.js'"
Command output:
Array.prototype.push called on null or undefined
/usr/lib/node_modules/jsctags/jsctags/ctags/writer.js:89
        this.tags = this.tags.sort(sortfunc);
                              ^
TypeError: Cannot call method 'sort' of undefined
    at Object.exports.TagWriter.Trait.write (/usr/lib/node_modules/jsctags/jsctags/ctags/writer.js:89:31)
    at Object.<anonymous> (/usr/lib/node_modules/jsctags/bin/jsctags.js:269:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

I trayed to run this manually:

jsctags -f - gui.js

And the error is the same.

More info:

$ node -v 
v0.10.26
$ npm info jsctags | grep version
npm http GET https://registry.npmjs.org/jsctags
npm http 304 https://registry.npmjs.org/jsctags
  versions: '0.1.0',
  version: '0.1.0',

File with I tryed working: http://paste.kde.org/pfnchcp0f

Sorry my poor english :)

Backbone.js class style not recognized

I can't tell for sure whether this is a usage pattern problem, but if I feed jsctags the source of the [Todos example][http://documentcloud.github.com/backbone/examples/todos/todos.js] featured in the Backbone.js documentation, I get a sequence of function tags back out. Top-level names like window.Todo and window.Todolist aren't generating tags, and neither are non-function properties like model or events. I can understand why the backbone-style classes aren't recognized as classes, but as a consequence, none of the functions are identified as part of the classes, either.

I'm not sure if there's a usage pattern that I'm not familiar with, or a way of indicating dependencies, or a flag for turning on output of variables. I'm also not sure if maybe this is fixed downstream of where I'm working (commit f63c1e0), to work around the problems I've been having with the narcissus submodule not responding properly to the submodule init/update commands (it wants SSH access) and the follow-on build problems reported elsewhere.

Despite my uncertainty, I did want to make sure someone was aware of the issue.

doctorjs on node_modules of a node.js/express project

Hi
In this stackoverflow question:
http://stackoverflow.com/questions/23707611/doctorjs-on-node-modules-of-a-node-js-express-project

I've described a couple of issues with drjs (jsctags.js) running on node_modules folder:

  1. It fails. Given that the express project is proven and vastly used, maybe this is not desired behavior?
  2. With the files causing the failure removed, the tagging process takes very long and doesn't seem to ever end.

My question:
Is doctorjs designed to tag the node_modules folder?

documentation, status, mailinglist?

What is the status of jsctags? From occasional blog posts, I gather that it is actively being used as a basis for prototyping, and that enthusiasm is still there, but available development time less so. But what about its use as development tool? Accidentally losing core functionality is somewhat worrying, especially if combined with long response times. Is there a mailing list?

Given that the main contributors seem to have a lot less time for this project than they would like to have, it would be good to have some high-level documentation (how are things supposed to work; to pick a random example: how do I run jsctags over its own sources while making sure that exports objects are handled specially?) and a discussion medium (would it be acceptable to intrude on the narcissus list?). Then many small contributions from tool users might sum up to progress (for the "I just want the tool" users;-) again?

I'm working on a patch to generate scoped tags (tags for local variables and parameters) in such a way that Vim can figure out which of those local declarations is in scope, and it would be helpful to have a community to talk to, to clear up issues arising (how to arrange a pull request, given that the patch affects the narcissus submodule as well? why is the treatment of export objects linked to the presence of package files? how do I distinguish scripts from modules, if not via the commonJS option?).

npm package

Packaging jsctags or doctorjs in npm would be great.

Website out of order

I get "Oh dear, something went wrong. Please try again in a moment." when I try doctorjs

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.