davidrjenni / lsif-php
Language Server Indexing Format (LSIF) generator for PHP
v0.0.6
2023-04-04 17:37 UTC
Requires
- php: ^8.0
- composer-runtime-api: ^2.2
- ext-json: *
- nikic/php-parser: ^4.13
- phpstan/phpdoc-parser: ^1.4
Requires (Dev)
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.4
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-php-parser: ^1.1
- phpstan/phpstan-phpunit: ^1.0
- phpstan/phpstan-strict-rules: ^1.1
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
README
Language Server Indexing Format (LSIF) generator for PHP
This repository is indexed using itself and available on Sourcegraph.
Requirements
lsif-php
needs the composer.json
and composer.lock
file of
the project to index present in the current directory. It uses the
autoload
and
autoload-dev
properties to determine which directories to scan.
Usage
To use a self-hosted Sourcegraph instance, set the
SRC_ENDPOINT
and SRC_ACCESS_TOKEN
environment
variables.
GitHub Actions
Add the following job to your workflow:
on: - push jobs: lsif-php: runs-on: ubuntu-latest container: davidrjenni/lsif-php:main steps: - uses: actions/checkout@v3 - name: Generate LSIF data run: lsif-php - name: Apply container owner mismatch workaround run: | # FIXME: see https://github.com/actions/checkout/issues/760 git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Upload LSIF data run: src code-intel upload -github-token=${{ secrets.GITHUB_TOKEN }}
GitLab CI/CD
Add the following job to your pipeline:
code_navigation: image: davidrjenni/lsif-php:main artifacts: reports: lsif: dump.lsif script: - lsif-php - src code-intel upload
Manual
Install lsif-php
with composer
and the
src
binary. Then generate
the LSIF data and upload it:
$ composer require --dev davidrjenni/lsif-php $ vendor/bin/lsif-php $ src code-intel upload