Giter VIP home page Giter VIP logo

netbeans-php-enhancements's Introduction

NetBeans PHP Enhancements Plugin

Support for some small features.

Features

  • Smart delete (Ctrl + Shift + BACK_SPACE)
  • Generate dummy text (Alt + Insert > Dummy Text)
  • Generate dummy image
  • Convert to PHP short array syntax
  • Typing hooks
  • Code completion
  • Convert String to Html entities (name entities)
  • Convert Html eltities to String

Smart delete

This feature delete string between "" or '', variable name.

delete string

e.g.

<?php echo "your message";?> -> <?php echo "";?>

delete variable name

e.g.

<?php $somethingVariable;?> -> <?php $;?>

Generate dummy text

We can use this feature on PHP and Html editors. Please set base text on the Dialog. It will be looped with option.

options

  • loop count
  • text length

Generate dummy image

We can generate a dummy image with this feature to specific folder. Please right-click a folder > Generate dummy image

Convert to PHP short array syntax

Convert array() to []. Right-click (file|directory) > Convert to php short array syntax

Typing hooks

If you want to enable this feature, Please check Options(Tools > Options > PHP > Enhancements).

This is avaible with the following operators:

  • Object operator ->
  • Double arrow operator =>

e.g. type $this- => $this->, type array('key' =) => array('key' =>)

$this->property;
$array = array('key' => 'value');
$a = ["foo" => "bar"];
$f = fn() => "arrow function";
$result = match ($condition) {
    1, 2 => foo(),
    default => bar(),
};

Note:

  • If you want to type ==, please type = after =>.
  • If you want to type =, please delete >. (It's difficult to handle all cases correctly...)

Code completion

Constant

Please check Tools > Options > PHP > Enhancements

  • Change name for define, defined and const to uppercase name

Function and method parameter

  • multibyte functions (e.g. mb_convert_encoding())
  • header
  • ini_set, ini_get, ini_alter, ini_restore
  • date_default_timezone_set
  • date, date_format
  • Datetime::format, DateTimeImmutable::format
  • htmlentities, htmlspecialchars
  • session_cache_limiter

Please run code completion (Ctrl + Space) inside quotes.

e.g.

<?php
ini_get('here');
date("here");

Download

Donation

License

Apache License, Version 2.0

netbeans-php-enhancements's People

Contributors

junichi11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netbeans-php-enhancements's Issues

Bracket Pair Colorizer

Hello, first of all thank you for your great plugins, that very useful for php developers.
And I just want to ask, what about add this features to php-enhancements plugin
On visual studio it's one of most popular extensions -

This extension allows matching brackets to be identified with colours. The user can define which characters to match, and which colours to use.

It's make a code review more convenient, not only for PHP developers, so maybe it's better to write general netbeans plugin

Double arrow for match expressions and arrow functions

PHP7.4 brought a new feature with a new snytax, called arrow functions.

$func = fn() =>  'example return value';

PHP8's new match expression also uses an array...ish/like syntax for defining patterns.

match (true) {
    firstCondition() => $something,
    secondCondition() => $otherThing
}

As a user of this plugin I got used to typing double arrows with only the equal sign when it is appropriate, so I noticed that I always missed the > sign.

Match expressions can have a lot more complex syntax for the patterns, so I don't really know whether it is solvable, but it would be awesome.

Netbeans 12.2 : cannot install

Dear @junichi11,

thanks for your nice job.
Unfortunately I cannot install this module on NetBeans 12.2, please see the error message:
netbeans-php-enhancements-error

Here are my NetBeans version information:
netbeans-version-info

Is there something I can do on my side?

Thanks

"=>" is added when a caret position is after "="

Steps to reproduce

  • Set the caret position("|") like the following:
$a = ["foo" =| ];
  • Type "="
  • "=>" is added. i.e.
$a = ["foo" ==> ];

Actual results

$a = ["foo" ==> ];

Expected results

$a = ["foo" == ];

Add typing hooks

Add typing hooks for object operator(->) and double arrow operator(=>).

e.g. type $this- => $this->, type array('key' =) => array('key' =>)

$this->property;

array('key' => 'value');

Add new array format support

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

Disable displaying errors from Vendor

All PHP frameworks have folder Vendor, but Netbeans always find errors here

If add vendor in Properties-> Ignored Folders, errors is not displayed, but after that you can't use autocomplete for code or jump to definition class, functions. This also removes the folder from the project view.

Can you add option to exclude vendor directory from code analysis in your plugin?

netbeans

Array convert in current file by hostkey

Can you make hotkey for convert array to short syntax in current editing file?
I don't use projects, use netbeans as editor, and i very need this cool function.

Add Netbeans 10 support

Do you have any plans to support Netbeans 10?
Or
Is this plugin allready support Netbeans 10?

Can not install on Netbeans 12.2 :: The plugin PHP Editor is required in implementation version 2

Hi
Can not install on Netbeans 12.2
The plugin PHP Editor is required in implementation version 2

Product Version: Apache NetBeans IDE 12.2
Java: 11.0.9.1; OpenJDK 64-Bit Server VM 11.0.9.1+1-Ubuntu-0ubuntu1.20.04
Runtime: OpenJDK Runtime Environment 11.0.9.1+1-Ubuntu-0ubuntu1.20.04
System: Linux version 5.4.0-56-generic running on amd64; UTF-8; ru_RU (nb)
User directory: /home/uran1980/.netbeans/12.2
Cache directory: /home/uran1980/.cache/netbeans/12.2

2020-12-09-01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.