Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
# php-cs-fixer
/.php_cs.cache
./.php_cs
/build
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- config/travis/testexts
- name: Docs
before_script:
- sudo apt-get -y install python3-pip
- sudo apt-get -y install python3-pip python3-setuptools
- pip3 install -r requirements.txt
script:
- make html
- make docs
31 changes: 25 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,35 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = doc
BUILDDIR = doc/_build

.PHONY: help sphinx

build:
mkdir build

build/vimdoc:
git clone https://github.com/google/vimdoc build/vimdoc

build/vimdoc/build: build/vimdoc
cd build/vimdoc; python3 setup.py config
cd build/vimdoc; python3 setup.py build

build/bin/vimdoc: build/vimdoc/build
cd build/vimdoc; python3 setup.py install --user

vimdoc: build/bin/vimdoc
vimdoc .

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

livehtml:
sphinxwatch:
@config/bin/watchdocs.sh

.PHONY: help Makefile
sphinx:
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs: sphinx vimdoc

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
clean:
rm -Rf build
4 changes: 2 additions & 2 deletions config/bin/watchdocs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
make html
make sphinx
while RES=$(inotifywait -e modify doc -r); do
echo $RES
make html
make sphinx
done
82 changes: 44 additions & 38 deletions doc/lsp/vim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,67 @@ VIM / NeoVim

.. _lsp_client_vim_coc:

CoC
---
Client Guides
-------------

Install Phpactor with :ref:`installation_global` then:

::
.. tabs::

Plug 'neoclide/coc.nvim', {'branch': 'release'}
.. tab:: CoC

Restart VIM and type ``:CocConfig`` to edit the CoC configuration, enter
the follwing:

::
Install Phpactor with :ref:`installation_global` then install `CoC
<https://github.com/neoclide/coc.nvim>`_:

{
"languageserver": {
"phpactor": {
"trace.server": "verbose",
"command": "phpactor",
"args": ["language-server"],
"filetypes": ["php","cucumber"],
"initializationOptions": {
::

Plug 'neoclide/coc.nvim', {'branch': 'release'}

Restart VIM and type ``:CocConfig`` to edit the CoC configuration, enter
the follwing:

::

{
"languageserver": {
"phpactor": {
"trace.server": "verbose",
"command": "phpactor",
"args": ["language-server"],
"filetypes": ["php","cucumber"],
"initializationOptions": {
},
"settings": {
}
}
},
"settings": {
}
}
},
}

You can pass Phpactor :ref:`configuration` in the
``initializationOptions``.
You can pass Phpactor :ref:`configuration` in the
``initializationOptions``.

Autozimu
--------
.. tab:: Autozimu

Install Phpactor with :ref:`installation_global` then:
Install Phpactor with :ref:`installation_global` then:

::
::

Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }

And let it know about Phpactor:
And let it know about Phpactor:

::
::

let g:LanguageClient_serverCommands = {
\ 'php': [ 'phpactor', 'server:start', '--stdio']
\}
let g:LanguageClient_serverCommands = {
\ 'php': [ 'phpactor', 'server:start', '--stdio']
\}

See the `github
repository <https://github.com/autozimu/LanguageClient-neovim>`__ for
more details.
See the `github
repository <https://github.com/autozimu/LanguageClient-neovim>`__ for
more details.

Troubleshooting
---------------
Expand Down
49 changes: 35 additions & 14 deletions doc/other/developing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,52 @@ Documentation
Phpactor Documentation
~~~~~~~~~~~~~~~~~~~~~~

Phpactor uses `couscous <https://github.com/CouscousPHP/Couscous>`__. In
order to develop the documentation (located in ``doc/``) download the
PHAR:
Phpactor uses `Sphinx <https://www.sphinx-doc.org>`_ (RST) for doucmentation.

.. code:: bash
Docs are located in the ``docs``.

$ curl -OS http://couscous.io/couscous.phar
A useful primer on RST can be found `here <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_.

and run:
.. tabs::

.. tab:: Debian/Ubuntu

::

apt-get install python3-sphinx

You can then build the docs with:

::

$ php couscous.phar preview
::

make sphinx

To run serve the documentation locally.
Or, to watch for changes (requires ``inotifywait``):

::

make sphinxwatch

VIM Help
~~~~~~~~

The VIM plugin is documented in the *generated* ``doc/phpactor.txt``
file.
file using `vimdoc <https://github.com/google/vimdoc>`_.

Install the `vimdoc <https://github.com/google/vimdoc>`__ tool, followw
the installation instructions and then run:
In order to add documentation just annotate properties / methods with
comments, for example:

.. code:: bash
.. code:: vim

""
" Extract the selected expression and assign it to a variable before
command! -buffer -range=% PhpactorExtractExpression call phpactor#ExtractExpression('v')

See `vimdoc <https://github.com/google/vimdoc>`_ for more information.

Use the following command to both install vimdoc and build the documentation:

.. code:: sh

$ vimdoc .
make vimdoc
11 changes: 11 additions & 0 deletions doc/usage/language-server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@ Language Server
Phpactor implements the `Language Server Protocol`_
which is supported by many text editors and IDEs.

.. note::

Note that the Language Server is a new feature, and should be treated as
ALPHA software

Features
--------

See :doc:`/lsp/support` for the list of supported features.

Usage
-----

.. toctree::
:maxdepth: 2
:glob:
Expand Down
4 changes: 2 additions & 2 deletions doc/usage/standalone.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Standalone
==========

.. _installation_global:

Requirements
------------

Phpactor requires PHP 7.3.

.. _installation_global:

Global Installation
-------------------

Expand Down