Ⅰ. 插件描述
A set of static analysis tools for JavaScriptⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mozilla/doctorjs'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mozilla/doctorjs'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mozilla/doctorjs'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mozilla/doctorjs
Ⅳ. 文档说明
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 filesjs/: support files for the HTML demoslib/: CommonJS-compliant library fileslib/ctags/: the core jsctags codenarcissus/: the Narcissus enginetest/: test cases for the indexer