Skip to content

Adding guide for adding code actions - #2167

Merged
dantleech merged 4 commits into
phpactor:masterfrom
mamazu:code_action_documentation
Mar 29, 2023
Merged

dantleech merged 4 commits into
phpactor:masterfrom
mamazu:code_action_documentation

Conversation

@mamazu

@mamazu mamazu commented Mar 26, 2023

Copy link
Copy Markdown
Contributor

This pull request adds a check list for what is needed when wanting to write a new code action. (because I also forgot that myself after writing the generate decorator).

I am not good at writing documentation, if you need any stylistic changes let me know.

Comment thread doc/other/developing.rst Outdated
code action logic and the provider.

And then there is the implementation of the `WorseGenerateDecorator` which contains the logic for generating the
decorator or more generally to apply the code action.

@dantleech dantleech Mar 27, 2023 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this needs to be a new document rather than a section here (it seems much more specific than the other things here), so doc/development/language-server/code-action.rst and indeed this document should be broken up and put there too.

But contentfully this looks OK. I realise that the process for creating a code-action is quite intensive currently and could be simplified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have broken up the documentation and added some more to it, about what a code action is and what kinds there are.

@mamazu

mamazu commented Mar 27, 2023

Copy link
Copy Markdown
Contributor Author

Looks like I broke the docs, but I have no idea of how RST works, could you give me a hint?


Debugging RPC
-------------
=============

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this is h1? this should stay as h2 ---- if there is more than one section in the document, only the first header (h1) should use ===

Comment thread doc/development/developing.rst Outdated
`lib/WorseReflection/Tests`.


Profiling the Language Server

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be in profiling.rst and it's missing the reference note the build failure and the original text:

.. _developing_blackfire_profiling:

Profiling the Language Server
-----------------------------

@dantleech

Copy link
Copy Markdown
Collaborator

if you haven't already you can check the .github code action for how to install Sphinx then do make docs to build locally

@mamazu

mamazu commented Mar 28, 2023

Copy link
Copy Markdown
Contributor Author

I ran it locally and it said that it was fine. Very strange.

@mamazu

mamazu commented Mar 28, 2023

Copy link
Copy Markdown
Contributor Author

Should be fixed now.

@dantleech

Copy link
Copy Markdown
Collaborator

opened a PR against this PR: https://github.com/mamazu/phpactor/pull/2/files :)

* Move debugging

* Update the documentation
@mamazu

mamazu commented Mar 28, 2023

Copy link
Copy Markdown
Contributor Author

I have merged it.

@dantleech
dantleech merged commit 93d219a into phpactor:master Mar 29, 2023
@dantleech

Copy link
Copy Markdown
Collaborator

Thanks @mamazu we certainly need to improve the docs

@mamazu
mamazu deleted the code_action_documentation branch December 27, 2023 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants