Aptana Studio
  1. Aptana Studio
  2. APSTUD-3446

Syntax for user-defined PHP functions are under the wrong scope

    Details

      Description

      User-defined functions or any functions for matter which aren't recognized by Aptana are given a scope of constant.other.php. There doesn't seem to be a difference between the following:

      <?php
          //User-defined constant
          FOOBAR;
      
          //User-defined function
          foobar();
      
          //User-defined function with white-space between name and parentheses
          foobar ();
      ?>
      

      I'm guessing that the regex doesn't take into consideration the parentheses following the function name? I'm not really fluent in regex, correct me if I'm wrong/off, but something like this should do the job?

      ([a-zA-Z_][a-zA-Z0-9_]*)\s*(\()
      

        Activity

        Hide
        Ingo Muschenetz added a comment -

        Need to confirm against the scopes returned by TextMate.

        Show
        Ingo Muschenetz added a comment - Need to confirm against the scopes returned by TextMate.
        Hide
        Aziz added a comment -

        Aptana vs Textmate scopes:

        <?php
            // User-defined constant
                // Aptana scope:   constant.other.php
                // TextMate scope: constant.other.php
            FOOBAR;
        
            // User-defined function
                // Aptana scope:   constant.other.php
                // TextMate scope: meta.function-call.php
            foobar();
        
            // User-defined function with white-space between name and parentheses
                // Aptana scope:   constant.other.php
                // TextMate scope: meta.function-call.php
            foobar ();
        ?>
        
        Show
        Aziz added a comment - Aptana vs Textmate scopes: <?php // User-defined constant // Aptana scope: constant.other.php // TextMate scope: constant.other.php FOOBAR; // User-defined function // Aptana scope: constant.other.php // TextMate scope: meta.function-call.php foobar(); // User-defined function with white-space between name and parentheses // Aptana scope: constant.other.php // TextMate scope: meta.function-call.php foobar (); ?>
        Hide
        Ingo Muschenetz added a comment -

        Thank you very much! We were expecting to do that, but you doing it was extremely helpful.

        Show
        Ingo Muschenetz added a comment - Thank you very much! We were expecting to do that, but you doing it was extremely helpful.
        Hide
        Aziz added a comment -

        Glad to have helped. Figured you guys had your hands full with all those open tickets.

        Show
        Aziz added a comment - Glad to have helped. Figured you guys had your hands full with all those open tickets.
        Hide
        Chris Williams added a comment -

        Pushed test and fix to development.

        Show
        Chris Williams added a comment - Pushed test and fix to development.
        Hide
        Joel Witt (Inactive) added a comment -

        Aptana Studio 3, build: 3.0.7.201111151549
        Windows Virtual Machine with Windows XP
        OSX 10.6.8
        TextMate 1.5.10 r1631

        Confirmed TextMate and Studio scopes are now in alignment :

        <?php
        // User-defined constant
        // Aptana scope :
        // constant.other.php
        // source.php.embedded.block.html
        // constant.other.php
        // TextMate scope :
        // constant.other.php
        // source.php.embedded.block.html
        // constant.other.php

        FUN;
        // User-defined function
        // Aptana scope :
        // constant.other.php
        // source.php.embedded.block.html
        // meta.function-call.php
        // TextMate scope :
        // constant.other.php
        // source.php.embedded.block.html
        // meta.function-call.php
        fun();

        // User-defined function with white-space between name and parentheses
        // User-defined function
        // Aptana scope :
        // constant.other.php
        // source.php.embedded.block.html
        // meta.function-call.php
        // TextMate scope :
        // constant.other.php
        // source.php.embedded.block.html
        // meta.function-call.php
        fun ();
        ?>

        Show
        Joel Witt (Inactive) added a comment - Aptana Studio 3, build: 3.0.7.201111151549 Windows Virtual Machine with Windows XP OSX 10.6.8 TextMate 1.5.10 r1631 Confirmed TextMate and Studio scopes are now in alignment : <?php // User-defined constant // Aptana scope : // constant.other.php // source.php.embedded.block.html // constant.other.php // TextMate scope : // constant.other.php // source.php.embedded.block.html // constant.other.php FUN; // User-defined function // Aptana scope : // constant.other.php // source.php.embedded.block.html // meta.function-call.php // TextMate scope : // constant.other.php // source.php.embedded.block.html // meta.function-call.php fun(); // User-defined function with white-space between name and parentheses // User-defined function // Aptana scope : // constant.other.php // source.php.embedded.block.html // meta.function-call.php // TextMate scope : // constant.other.php // source.php.embedded.block.html // meta.function-call.php fun (); ?>

          People

          • Assignee:
            Chris Williams
            Reporter:
            Aziz
          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development