<commit_before>Starscope User Guide
====================

About
-----

Anyone who has done much programming in C (or C++) on a Unix-based OS has come
across the fantastic [Cscope](http://cscope.sourceforge.net/) tool. Sadly, it
only works for C (and sort of works for C++).

Starscope is a similar tool for [Ruby](https://www.ruby-lang.org/) and
[Golang](http://golang.org/), with a design intended to make it easy to add
[support for other languages](LANGUAGE_SUPPORT.md) within the same framework
(thus the name Starscope, i.e. \*scope).

Installation
------------

Starscope is a ruby gem available at https://rubygems.org/gems/starscope.
Install it with:
```
$ gem install starscope
```

This should place a program called `starscope` in your path.

Quick Start
-----------

Build your database by just running it in the project directory:
```
$ cd ~/my-project
$ starscope
```

Ask it things directly:
```
$ starscope -q calls,new # Lists all callers of new
```

Export it to various existing formats for automatic integration with your editor:
```
$ starscope -e ctags
$ starscope -e cscope
```

Editor Integration
------------------

While there aren't any editors (that I know of) which interface natively with
Starscope, that isn't actually a problem. Almost all editors know how to
interface with Cscope and Ctags, and Starscope is able to export to both of
their file formats.

For Vim (which is what I use, so what I'm going to document) you can simply
tell Starscope to export to a cscope database (see the section on
[Exporting](#Exporting) below), then use Vim's [existing Cscope
integration](http://cscope.sourceforge.net/cscope_vim_tutorial.html) and
everything will Just Work :TM:.

Database Options
----------------

The default database is `.starscope.db` in the current directory. If you want
to use another file, specify one with `-f` or `--file`.

The default behaviour is always to read the database (if it exists), update it,<commit_msg>anchors are case-sensitive<commit_after>Starscope User Guide
====================

About
-----

Anyone who has done much programming in C (or C++) on a Unix-based OS has come
across the fantastic [Cscope](http://cscope.sourceforge.net/) tool. Sadly, it
only works for C (and sort of works for C++).

Starscope is a similar tool for [Ruby](https://www.ruby-lang.org/) and
[Golang](http://golang.org/), with a design intended to make it easy to add
[support for other languages](LANGUAGE_SUPPORT.md) within the same framework
(thus the name Starscope, i.e. \*scope).

Installation
------------

Starscope is a ruby gem available at https://rubygems.org/gems/starscope.
Install it with:
```
$ gem install starscope
```

This should place a program called `starscope` in your path.

Quick Start
-----------

Build your database by just running it in the project directory:
```
$ cd ~/my-project
$ starscope
```

Ask it things directly:
```
$ starscope -q calls,new # Lists all callers of new
```

Export it to various existing formats for automatic integration with your editor:
```
$ starscope -e ctags
$ starscope -e cscope
```

Editor Integration
------------------

While there aren't any editors (that I know of) which interface natively with
Starscope, that isn't actually a problem. Almost all editors know how to
interface with Cscope and Ctags, and Starscope is able to export to both of
their file formats.

For Vim (which is what I use, so what I'm going to document) you can simply
tell Starscope to export to a cscope database (see the section on
[Exporting](#exporting) below), then use Vim's [existing Cscope
integration](http://cscope.sourceforge.net/cscope_vim_tutorial.html) and
everything will Just Work :TM:.

Database Options
----------------

The default database is `.starscope.db` in the current directory. If you want
to use another file, specify one with `-f` or `--file`.

The default behaviour is always to read the database (if it exists), update it,
{'fraction_non_alphanumeric': 0.1252222504445009, 'fraction_numerical': 0.0, 'mean_word_length': 3.733173076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '461374', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1081, 'n_words': 531}