Add new array format support #10

Closed
fanphp opened this Issue Dec 19, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@fanphp

fanphp commented Dec 19, 2015

Hi,
actually this plugin does not work with new PHP array notation []; do you think it is possible to fix this "issue" ?

Example: $a = [ 'bar' => 'baz']; //This does not work

@junichi11 junichi11 added the defect label Dec 20, 2015

@junichi11 junichi11 self-assigned this Dec 20, 2015

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Dec 20, 2015

Owner

Does it mean a typing hook feature?

Owner

junichi11 commented Dec 20, 2015

Does it mean a typing hook feature?

@fanphp

This comment has been minimized.

Show comment
Hide comment
@fanphp

fanphp Dec 21, 2015

yes, something like that!
Actually, if I type

$work = array( 'bar' => .... );    << plugin recognizes the array structure and works well

$dontWork = [ 'bar' => ....] ;    << plugin does not recognize the new PHP array notation  and does not work
?>

Thanks in advance!

fanphp commented Dec 21, 2015

yes, something like that!
Actually, if I type

$work = array( 'bar' => .... );    << plugin recognizes the array structure and works well

$dontWork = [ 'bar' => ....] ;    << plugin does not recognize the new PHP array notation  and does not work
?>

Thanks in advance!

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Dec 21, 2015

Owner

Okay, I'll fix it. Thanks.

Owner

junichi11 commented Dec 21, 2015

Okay, I'll fix it. Thanks.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Dec 22, 2015

Owner

Fixed.

@fanphp Could you please test it? (Please try testing some cases if possible)
https://github.com/junichi11/netbeans-php-enhancements/releases/tag/v0.9.0 (0.9.0.1-dev)
If there is no problem, I'll update version number. Then, create a new nbm.

NOTE

Now, It works inside of both array() and [].
It means it works also array access cases. e.g.

$array = ["foo" => "bar"];
$array[|]; // here

But I think that "=" is not used there. If you know the case using it, please let me know.

Thanks.

Owner

junichi11 commented Dec 22, 2015

Fixed.

@fanphp Could you please test it? (Please try testing some cases if possible)
https://github.com/junichi11/netbeans-php-enhancements/releases/tag/v0.9.0 (0.9.0.1-dev)
If there is no problem, I'll update version number. Then, create a new nbm.

NOTE

Now, It works inside of both array() and [].
It means it works also array access cases. e.g.

$array = ["foo" => "bar"];
$array[|]; // here

But I think that "=" is not used there. If you know the case using it, please let me know.

Thanks.

@junichi11 junichi11 added this to the 0.9.1 milestone Dec 22, 2015

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Dec 22, 2015

Owner

The following is valid:

$array1 = ["foo" == "bar"];
$array2 = ["foo" === "bar"];

So, I'll implement as the following:

  • just remove ">" before "=" is inserted when the caret position is here "=>|" (i.e. "=>" => "==")
  • just do nothing when the caret position is here "==|" (i.e. "==" => "===")
Owner

junichi11 commented Dec 22, 2015

The following is valid:

$array1 = ["foo" == "bar"];
$array2 = ["foo" === "bar"];

So, I'll implement as the following:

  • just remove ">" before "=" is inserted when the caret position is here "=>|" (i.e. "=>" => "==")
  • just do nothing when the caret position is here "==|" (i.e. "==" => "===")
@fanphp

This comment has been minimized.

Show comment
Hide comment
@fanphp

fanphp Dec 22, 2015

Hi,
it works well now, I've downloaded and tested the new plugin version. Thanks at all!!!!

fanphp commented Dec 22, 2015

Hi,
it works well now, I've downloaded and tested the new plugin version. Thanks at all!!!!

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Dec 22, 2015

Owner

Thanks for testing it 👍
I'll update version after I committed the above changes.

Owner

junichi11 commented Dec 22, 2015

Thanks for testing it 👍
I'll update version after I committed the above changes.

@junichi11

This comment has been minimized.

Show comment
Hide comment

@junichi11 junichi11 closed this Dec 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment