AckslD / nvim-trevJ.lua

Nvim-plugin for doing the opposite of join-line (J) of arguments, powered by treesitter
MIT License
170 stars 10 forks source link

Add initial PHP support #14

Closed przepompownia closed 2 years ago

przepompownia commented 2 years ago

Hi @AckslD thank you for creating a promising and fast revJ successor!

przepompownia commented 2 years ago

Sample code on which I manually tested it:

<?php

function x($a, $b, $c)
{
    list($a, $b) = [1, 2];
}

x(1, 2, 3);

class X
{
    public function __construct($x, $y)
    {
    }
}

new X(1, 2);
AckslD commented 2 years ago

Very nice @przepompownia! :heart: Hope it works well for you and glad you like it :)

I really should add some tests in the CI soon but just haven't found the time yet.

przepompownia commented 2 years ago

It's noticeably faster than revJ and free from external dependencies. Currently I have no knowledge about treesitter but existing examples helped me finding places where some names are defined and then to find its analogues for PHP.