mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Update symbols docs
Summary: Refs T7977. Test Plan: spellcheck. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7977 Differential Revision: https://secure.phabricator.com/D12688
This commit is contained in:
parent
57c8dc2cff
commit
ec22df5e17
1 changed files with 13 additions and 18 deletions
|
@ -9,7 +9,8 @@ Phabricator can maintain a symbol index, which keeps track of where classes
|
||||||
and functions are defined in the codebase. Once you set up indexing, you can
|
and functions are defined in the codebase. Once you set up indexing, you can
|
||||||
use the index to do things like:
|
use the index to do things like:
|
||||||
|
|
||||||
- link symbol uses in Differential code reviews to their definitions
|
- link symbol uses in Differential code reviews and Diffusion code browsing
|
||||||
|
to their definitions
|
||||||
- allow you to search for symbols
|
- allow you to search for symbols
|
||||||
- let the IRC bot answer questions like "Where is SomeClass?"
|
- let the IRC bot answer questions like "Where is SomeClass?"
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ other languages.
|
||||||
To populate the index, you need to write a script which identifies symbols in
|
To populate the index, you need to write a script which identifies symbols in
|
||||||
your codebase and set up a cronjob which pipes its output to:
|
your codebase and set up a cronjob which pipes its output to:
|
||||||
|
|
||||||
./scripts/symbols/import_project_symbols.php
|
./scripts/symbols/import_repository_symbols.php
|
||||||
|
|
||||||
Phabricator includes a script which can identify symbols in PHP projects:
|
Phabricator includes a script which can identify symbols in PHP projects:
|
||||||
|
|
||||||
|
@ -61,34 +62,28 @@ write such a script, and run this command to see its output:
|
||||||
$ find . -type f -name '*.php' | ./scripts/symbols/generate_php_symbols.php
|
$ find . -type f -name '*.php' | ./scripts/symbols/generate_php_symbols.php
|
||||||
|
|
||||||
To actually build the symbol index, pipe this data to the
|
To actually build the symbol index, pipe this data to the
|
||||||
`import_project_symbols.php` script, providing the project name:
|
`import_repository_symbols.php` script, providing the repository callsign:
|
||||||
|
|
||||||
$ ./scripts/symbols/import_project_symbols.php yourproject < symbols_data
|
$ ./scripts/symbols/import_repository_symbols.php rREPO < symbols_data
|
||||||
|
|
||||||
Then just set up a cronjob to run that however often you like.
|
Then just set up a cronjob to run that however often you like.
|
||||||
|
|
||||||
You can test that the import worked by querying for symbols using the Conduit
|
You can test that the import worked by querying for symbols using the Conduit
|
||||||
method ##differential.findsymbols##. Some features (like that method, and the
|
method ##diffusion.findsymbols##. Some features (like that method, and the
|
||||||
IRC bot integration) will start working immediately. Others will require more
|
IRC bot integration) will start working immediately. Others will require more
|
||||||
configuration.
|
configuration.
|
||||||
|
|
||||||
= Configuring Differential Integration =
|
= Advanced Configuration =
|
||||||
|
|
||||||
To configure Differential integration, you need to tell Phabricator which
|
You can configure some more options by going to {nav Diffusion > (Select
|
||||||
projects have symbol indexes you want to use, and which other projects they
|
repository) > Edit Repository > Edit Symbols}, and filling out these fields:
|
||||||
should pull symbols from. To do this, go to
|
|
||||||
{nav Repositories > Arcanist Projects > Edit} as an administrator. You need to
|
|
||||||
fill out these fields:
|
|
||||||
|
|
||||||
- **Repository**: Associate the project with a tracked repository.
|
|
||||||
- **Indexed Languages**: Fill in all the languages you've built indexes for.
|
- **Indexed Languages**: Fill in all the languages you've built indexes for.
|
||||||
- **Uses Symbols From**: If this project depends on other projects, add the
|
You can leave this blank for "All languages".
|
||||||
other projects which symbols should be looked for here. For example,
|
- **Uses Symbols From**: If this project depends on other repositories, add
|
||||||
|
the other repositories which symbols should be looked for here. For example,
|
||||||
Phabricator lists "Arcanist" and "libphutil" because it uses classes and
|
Phabricator lists "Arcanist" and "libphutil" because it uses classes and
|
||||||
functions from these projects.
|
functions from these repositories.
|
||||||
|
|
||||||
Once you've configured a project, new revisions in that project will
|
|
||||||
automatically link symbols in Differential.
|
|
||||||
|
|
||||||
NOTE: Because this feature depends on the syntax highlighter, it will work
|
NOTE: Because this feature depends on the syntax highlighter, it will work
|
||||||
better for some languages than others. It currently works fairly well for PHP,
|
better for some languages than others. It currently works fairly well for PHP,
|
||||||
|
|
Loading…
Reference in a new issue