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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/.phpactor/*

# docs
/.couscous
/doc/_build

# php-cs-fixer
/.php_cs.cache
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?= -W
SPHINXBUILD ?= sphinx-build
SOURCEDIR = doc
BUILDDIR = doc-build
BUILDDIR = doc/_build

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

livehtml:
@sphinx-autobuild -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@config/bin/watchdocs.sh

.PHONY: help Makefile

Expand Down
6 changes: 6 additions & 0 deletions config/bin/watchdocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
make html
while RES=$(inotifywait -e modify doc -r); do
echo $RES
make html
done
50 changes: 0 additions & 50 deletions config/travis/build-dashboard.php

This file was deleted.

Empty file added config/vim/vimrc
Empty file.
8 changes: 0 additions & 8 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@ div.document {
border-style: none;
padding: 0px;
}

#contents > ul > li {
}
.toctree-wrapper > ul > li {
}

#contents > ul, .toctree-wrapper > ul {
}
9 changes: 1 addition & 8 deletions doc/_templates/about.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{% if theme_logo %}
<p class="logo">
<a href="{{ pathto(master_doc) }}">
<a href="{{ pathto('index') }}">
<img class="logo" src="{{ pathto('_static/' ~ theme_logo, 1) }}" alt="Logo"/>
{% if theme_logo_name|lower == 'true' %}
{% endif %}
</a>
<h2 class="logo logo-name">{{ project }}</h2>
</p>
{% else %}
<h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
{% endif %}

{% if theme_description %}
<p class="blurb">{{ theme_description }}</p>
{% endif %}
1 change: 1 addition & 0 deletions doc/_templates/navigation.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<hr/>
{{ toctree(collapse=False,includehidden=False) }}
{% if theme_extra_nav_links %}
<hr />
Expand Down
20 changes: 20 additions & 0 deletions doc/_templates/searchbox.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{#
basic/searchbox.html
~~~~~~~~~~~~~~~~~~~~

Sphinx sidebar template: quick search box.

:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
#}
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<div class="searchformwrapper">
<form class="search" action="{{ pathto('search') }}" method="get">
<input placeholder="Search..." type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="{{ _('Go') }}" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
# -- Project information -----------------------------------------------------

project = 'Phpactor'
copyright = '2020, Daniel Leech'
author = 'Daniel Leech'
copyright = '2020, Phpactor Community'
author = 'Phpactor Community'

# The full version, including alpha/beta/rc tags
release = '15'

master_doc = 'index'
master_doc = 'contents'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index has the "home" page on it, the contents (TOC) live a separate life.



# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -64,9 +64,9 @@
html_sidebars = {
'**': [
'about.html',
'searchbox.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
]
}
Expand Down
19 changes: 19 additions & 0 deletions doc/contents.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Contents
========

.. toctree::
:maxdepth: 2

usage
reference
extensions
other

.. toctree::
:hidden:

index
vim
adr
integrations/drupal8
screenshots
19 changes: 0 additions & 19 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,3 @@ it's own RPC protocol and as a :ref:`language_server`:
Phpactor can be used in a limited way as a **standalone application**,
but its full power can only be utilized through its :doc:`other/rpc` protocol or
through its :doc:`usage/language-server`.

Find out more about Phpactor:

.. toctree::
:maxdepth: 2

home
usage
reference
extensions
other

.. toctree::
:hidden:

vim
adr
integrations/drupal8
screenshots
12 changes: 12 additions & 0 deletions doc/language-server.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Language Server
===============

See :ref:`language_server` for getting started instructions.

.. toctree::
:maxdepth: 2

lsp/clients
lsp/watcher
lsp/running
lsp/support
5 changes: 4 additions & 1 deletion doc/lsp/clients.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Clients
=======

.. toctree::
:maxdepth: 1
:maxdepth: 2

vim
sublime
Expand Down
35 changes: 35 additions & 0 deletions doc/lsp/running.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Manually Running the Server
---------------------------

Typically you should never need to run the Language Server yourself, the
following methods are useful for development.

STDIO
~~~~~

STDIO is typically used by clients and it the default mode.

.. code:: bash

$ phpactor language-server

This is the method you should use when configuring an LSP client.

Run with TCP Server
~~~~~~~~~~~~~~~~~~~

The TCP server is useful for debugging:

.. code:: bash

$ phpactor language-server --address=127.0.0.1 -vvv

You should see something like:

::

Starting TCP server, use -vvv for verbose output
[2018-09-30 17:15:25] phpactor.INFO: listening on address 127.0.0.1:8888 [] []
[2018-09-30 17:15:25] phpactor.INFO: starting language server with pid: 9286 [] []

.. _Language Server Protocol: https://microsoft.github.io/language-server-protocol/specification
2 changes: 2 additions & 0 deletions doc/lsp/sublime.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _lsp_client_sublime:

Sublime Text
============

Expand Down
54 changes: 54 additions & 0 deletions doc/lsp/support.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
LSP Support
===========

See the `Language Server Specification`_ for details.

+-------------------------+---+-------------------------------------+
| Feature | | |
+=========================+===+=====================================+
| Completion | ✔ | See :ref:`completion` |
+-------------------------+---+-------------------------------------+
| Completion Resolve | ✘ | |
+-------------------------+---+-------------------------------------+
| Hover | ✔ | |
+-------------------------+---+-------------------------------------+
| Signature Help | ✔ | |
+-------------------------+---+-------------------------------------+
| Goto Declaration | ✔ | |
+-------------------------+---+-------------------------------------+
| Goto Type | ✔ | |
+-------------------------+---+-------------------------------------+
| Goto Implementation | ✔ | |
+-------------------------+---+-------------------------------------+
| Find References | ✘ | Supported by RPC [#rpc]_ [#nav]_ |
+-------------------------+---+-------------------------------------+
| Document Highlight | ✘ | |
+-------------------------+---+-------------------------------------+
| Document Symbol | ✘ | |
+-------------------------+---+-------------------------------------+
| Code Action | ✘ | Supported by RPC [#rpc]_ [#code]_ |
+-------------------------+---+-------------------------------------+
| Code Lens | ✘ | |
+-------------------------+---+-------------------------------------+
| Document Link | ✘ | |
+-------------------------+---+-------------------------------------+
| Document Color | ✘ | |
+-------------------------+---+-------------------------------------+
| Color Presentation | ✘ | |
+-------------------------+---+-------------------------------------+
| Formatting | ✘ | |
+-------------------------+---+-------------------------------------+
| Range Formatting | ✘ | |
+-------------------------+---+-------------------------------------+
| Rename | ✘ | Supported by RPC [#rpc]_ [#rename]_ |
+-------------------------+---+-------------------------------------+
| Folding/Selection Range | ✘ | |
+-------------------------+---+-------------------------------------+

.. _Language Server Specification: https://microsoft.github.io/language-server-protocol/specification

.. [#rpc] Available through RPC (i.e. non-LSP client) LSP support should be added soon.
.. [#code] Code actions translate to :ref:`refactoring` actions in Phpactor, and should be available in the next release.
added soon.
.. [#nav] RPC supports :ref:`navigation_class_references` and :ref:`navigation_class_member_references`
.. [#rename] RPC supports :ref:`refactoring_rename_variable`, :ref:`refactoring_rename_class`, :ref:`refactoring_rename_member`,
2 changes: 2 additions & 0 deletions doc/lsp/vim.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
VIM / NeoVim
============

.. _lsp_client_vim_coc:

CoC
---

Expand Down
44 changes: 44 additions & 0 deletions doc/lsp/watcher.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Watcher
=======

When the language server starts Phpactor will index all the PHP files in your
working directory, and then *watch* for changes.

The type of watcher used depends on your system. Currently the following
watchers will be used, in order of priority:

1. ``inotifywait``: **Linux** only, react immediately[1] to file changes.
2. ``find``: **Linux/Mac/POSIX** Poll the system for changes every 5 seconds.
3. ``php``: **Any system**: Poll system using PHP (slow) every 5 seconds.

To contribute to the available watchers see `amp-fswatch
<https://github.com/phpactor/amp-fswatch>`_.

If you want to find out which watcher your system is using, enable _`logging`.

Troubleshooting
---------------

Inotify: Why isn't ``inotifywait`` used when I'm on Linux?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It may not be installed, on Debian/Ubuntu

.. code:: sh

$ sudo apt-get install inotify-tools

Inotify: ``inotify`` limit reached
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The default number of watchers is quite low by default, try increasing the
number of watchers:

.. code:: sh

$ sudo sysctl fs.inotify.max_user_watches=100000

Note this still may not be sufficient, so increase as necessary, make the
change permanent by writing to ``/etc/sysctl.conf``

.. _Watchman: https://facebook.github.io/watchman/
2 changes: 2 additions & 0 deletions doc/other/rpc.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _rpc_protocol:

RPC Protocol
============

Expand Down
1 change: 1 addition & 0 deletions doc/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Reference
:glob:

reference/*
language-server
Loading