@@ -14,11 +14,12 @@ my editor grew more and more as IDEs such as Jetbrains
1414[ PhpStorm] ( https://www.jetbrains.com/phpstorm/ ) and Idea platforms offered more
1515and more great features.
1616
17- VIM is a great text editor, but it is essentially dumb. Nevertheless, I still
18- _ felt_ that I could program faster and more efficiently in VIM running in
19- [ Tmux] ( https://github.com/tmux/tmux/wiki ) sessions in a minimal tiling desktop
20- environment such as [ I3] ( https://i3wm.org/ ) . I became extremely good at
21- typing, and developed muscle memory for class constructors and properties.
17+ VIM is a great text editor, but it is essentially ignorant of the meaning of
18+ code. Nevertheless, I still _ felt_ that I could program faster and more
19+ efficiently in VIM running in [ Tmux] ( https://github.com/tmux/tmux/wiki )
20+ sessions in a minimal tiling desktop environment such as
21+ [ I3] ( https://i3wm.org/ ) . I became extremely good at typing, and developed
22+ muscle memory for class constructors and properties.
2223
2324Not having these refactoring tools however also meant that the lack of them would
2425have a direct influence on the quality of my code and architecture (if would
@@ -27,15 +28,16 @@ that).
2728
2829Of course there were a multitude of ways to mitigate this lack of functionality
2930and for some time I had, for example, been using ctags completion (basically
30- regexy dumb completion) and code snippet generators, but a real contextually
31- aware code completion and refactoring tool for PHP was simply not available.
31+ regexy "dumb" completion) and code snippet generators, but a real
32+ contextually aware code completion and refactoring tool for PHP was simply not
33+ available.
3234
3335I was excited to find out about projects like
3436[ Padawan] ( https://github.com/padawan-php/padawan.php ) and other similar
3537efforts, but they all seemed either unstable or sub-optimal (at the time at
3638least) and after a while I thought "how hard can it be"? So in 2014 I wrote the
37- first version of Phpactor. It was terrible . 1 year later I wrote another,
38- again, it sucked. The ongoing third effort is what we have here today.
39+ first version of Phpactor. It was failed . 1 year later I wrote another, it
40+ sucked. The ongoing third effort is what we have here today.
3941
4042One of the things that made Phpactor possible was the Microsoft [ Tolerant PHP
4143parser] ( https://github.com/Microsoft/tolerant-php-parser ) (TPP), a great library
@@ -49,8 +51,8 @@ other projects and they didn't mature.
4951Initially I also used the [ Nickic PHP
5052parser] ( https://github.com/nikic/PHP-Parser ) - the defacto PHP parser in the
5153PHP world today, but I found the TPP much easier to work with as it
52- provides tree-traversal (and was matched to Phpactor's use case - I believe
53- essentially created to support the [ VS
54+ provides node tree-traversal (and was matched to Phpactor's use case - I _ believe _
55+ it was essentially created to support the [ VS
5456Code] ( https://en.wikipedia.org/wiki/Visual_Studio_Code ) eco-system and
5557contribute to Microsoft's efforts to _ take control of the market_ ).
5658
@@ -68,33 +70,32 @@ domain of Phpactor and is subservient to its needs.
6870Why not PHP Language Server?
6971----------------------------
7072
71- No reason - PHP language server is great. Well, there are some differentiators:
72-
73- - ** Phpactor does not index anything** : This is both good and bad, good
74- because it is fast (depending on the operation), doesn't suffer from memory
75- issues and has no start-up penalty. It uses short lived processes, which is
76- what PHP is good at. We locate files quickly by depending on
77- the [ Composer] ( https://getcomposer.org ) autoloader. Bad because
78- it cannot discover non-autoloadable classes or (at time of writing) provide
79- completion for functions in the wild. Phpactor does not work well without Composer.
80- - ** Phpactor is also a refactoring tool** : Phpactor provides [ refactorings] ( refactorings.md ) and
81- procedures to help you code faster and more accurately (such as complete
82- constructor, generate method, implement contracts etc).
73+ No reason - PHP language server is great. But there are some differentiators:
74+
75+ - ** Phpactor is realtime** : It does not index anything. This is both good and
76+ bad, good because it is fast (depending on the operation), doesn't suffer
77+ from memory issues and has no start-up penalty. It uses short lived
78+ processes, which is what PHP is classically good at. We locate files quickly
79+ by depending on the [ Composer] ( https://getcomposer.org ) autoloader. Bad
80+ because it cannot discover non-autoloadable classes or (at time of writing)
81+ provide completion for functions in the wild. Phpactor still works without
82+ composer by traversing your project tree, but it's speed is then relative to
83+ project size.
84+ - ** Phpactor is also a refactoring tool** : Phpactor provides
85+ [ refactorings] ( refactorings.md ) and procedures to help you code faster and
86+ more accurately (such as complete constructor, generate method, implement
87+ contracts etc).
8388- ** Phpactor ships with a VIM plugin** : Phpactor ships with a [ VIM plugin] ( vim-plugin.md ) .
8489
85- … and competition for the eco-system right? "Competing" products allow more
86- independent vectors of discovery.
87-
8890Why not Language Server Protocol?
8991---------------------------------
9092
9193The [ Language Server
9294Protocol] ( https://github.com/Microsoft/language-server-protocol ) defines a
9395standard protocol for an editor to talk to a language server. Phpactor is
94- essentially a language server.
95-
96- Phpactor does not currently support the Language Server protocol, but it does
97- implement its own [ RPC Protocol] ( rpc.md ) . It is not currently aligned with the LSP.
96+ fills the role of a language server, but it's essentially a PHP script.
9897
99- In the future it may happen that Phpactor will implement LSP, or maybe it will
100- be made redundant by the PHP Language Server ` ¯\_(ツ)_/¯ ` .
98+ Phpactor currently implements its own [ RPC Protocol] ( rpc.md ) , this at least
99+ gives it flexibility. But it would be great to eventually either replace this
100+ with LSP or provide an LSP interface and therefore be a generic backend for
101+ all editors with LSP support.
0 commit comments