home.social

#uctags — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #uctags, aggregated by home.social.

  1. Is there a good `.ctags` content with `--regex-php` that recognizes enums and their cases? It's not included in the latest universal ctags 6.2, and my regex tests have all failed so far. Perhaps someone else has had more success with this.

    My current test `.ctags` looks like this (it's obviously wrong haha):

    ```
    --regex-php=/enum[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]*)[[:space:]]*/\1/e,enum/
    --regex-php=/case[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]*)[[:space:]]*;/\1/case/
    ```

    And it should find enums with the following structure:

    ```php
    enum Foo
    {
    case A;
    case B;
    }
    ```

    And of course also backed enums:

    ```php
    enum Foo: string
    {
    case A = 'a';
    case B = 'b';
    }
    ```

    #ctags #uctags #UniversalCtags #php