pycscope


Ⅰ. 插件描述

Cscope database generator for Python source code

Ⅱ. 基本信息

创建日期:  2012-02-29
使用用户:  1
Github星:  108
插件作者:  Peter Portante

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'portante/pycscope'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'portante/pycscope'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'portante/pycscope'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/portante/pycscope

Ⅳ. 文档说明

# PyCscope

  • Copyright: Copyright 2019 Peter Portante. See LICENSE for details.
  • Author: Peter Portante
  • Release: 1.2.2
  • Date: 2019/10/17

Purpose

A python script to generate a cscope index from a Python source tree.
pycscope uses Python's own parser and (C)oncrete (S)yntax (T)ree to generate
the index, so it is a bit more accurate than plain cscope.

Usage

    pycscope.py [-D] [-R] [-S] [-V] [-f reffile] [-e path1[,path2,...]] [-i srclistfile] [files ...]

    -D                Dump the (C)oncrete (S)yntax (T)ree generated by the parser for each file
    -R                Recurse directories for files
    -S                Interpret simple strings as symbols
    -V                Print version and exit
    -f reffile        Use 'reffile' as cross-ref file name instead of 'cscope.out'
    -i srclistfile    Use the contents of 'srclistfile' as the list of source files to scan
    -e path1,path2..  Exclude the list of paths from being parse

Example

Rough example using vim as your cscope client:

    pycscope -R .
    # now you have a cscope.out. use it like you would cscope
    vim hello.py
    :cscope add cscope.out
    :cscope find s sys

Install

PyCscope uses Python's distutils package for installation. Use the following
command to install this package:

    % python setup.py install

Features

PyCscope has the following features:

  • Supports both Python 2.7 and Python 3
  • Command line interface
  • Output can be used by the CscopeFinder plugin for jEdit
  • Marks for all files ending in .py
  • Marks for all class definitions
  • Marks for all defined functions
  • Marks for function calls (algorithm is not perfect)
  • Marks for end-of-function (no search uses this mark yet)
  • Marks for imported modules (use the search for #include)
  • Marks for symbol assignment

A mark is an indicator to the cscope utility that something
of interest follows.

History

  • pycscope 0.3a and later are written and copyright Peter Portante.
  • pycscope 0.1 - 0.3 were originally written and copyright Dean Hall.

Status

It works well enough to generate an index file that can be used by the
CscopeFinder plugin for jEdit, emacs cscope support, or vim's cscope

  1. Other editors are not tested.

添加新评论