Notepad++ PHP Syntax Autocomplete - php

I have added following lines at start of %PRPOGRA~%\Notepad++\plugin\APIs\php.xml
<KeyWord name="$_GET"></KeyWord>
<KeyWord name="$_POST"></KeyWord>
<KeyWord name="$_SERVER"></KeyWord>
CTRL+Space to generate autocomplete syntax list for
$_GET
$_POST
$_SERVER
List should be appeared on pressing $ (shift + 4).

I found a hint for my own question.
Notepad++ generate AutoCompletion list of syntax, only on keypress event of
A-Z or a-z.
You can modify it behavior by modifying files at
NotePad++ > plugin > APIs > *.xml
<keyword name="anything"> keyword tags must be sort by attribute value "name" and this sorting is ASCII code wise,

Related

Formatting in netbeans?

I want to know how can I configure my netbeans ide to format my code in my specific need.
I need all my assignment in same line to easily distinguish it.
for eg:
$a = 1;
$b = 1;
$c = 1;
$a++;
some code
$d = 1;
Based on your sample code, I'm assuming that you want to do this for PHP. If so, then you can do it as follows:
Select Tools > Options > Editor, then click the Formatting tab.
Select PHP from the Language drop list, then Alignment from the Category drop list.
A code sample will be displayed in the Preview window on the right side of the screen which includes some variable assignments near the end of the code:
Under Group Multiline Alignment check the Assignment box. Note that the assignment operators (=) in the code preview are now aligned:
Notes:
The column position used for aligning the assignment operators is dynamic, based on the length of the longest variable name. I don't think it is possible to place the assignment operator in a specific column as suggested by your code example.
This approach is specific to PHP, and can't be used for formatting code in other languages such as Java or JavaScript.
Formatting in NetBeans can be configured under "Tools / Options / Editor / Formatting", but I don't think that you can configure NetBeans to use your desired format.

How to show "open" and "close" PHP tags in Netbeans?

Netbeans shows corresponding braces like { and } with a different color. Is there a way in Netbeans to find the corresponding PHP close Tag (?>) to an existing PHP open Tag (<?php or <?)?
Currently (in NetBeans 7.3 Beta), you cannot change or customize the Highlighting through the Tools > Options menu by adding a matching category for the tag. Best you can do is change the color of the syntax color for PHP Open/Close Tag (in screenshot 2)

php. neatbeans. adding whihte space before and after functions argument

I want configure netbeans for PHP. how to make that it automatically put white spaces before and after function argument:
myfunction($arg1) {...
But whant:
myfunction( $arg1 ) {...
It's ugly to have spaces around args... Anyway you can customize formatting options in:
Tools > Options > Editor > Formatting
Here you have to select PHP Language and you can customize all coding styles (there's more than only Tabs and Indents).

Netbeans autocomplete not following style guide

I like to have a space after function names, arrays, that sort of thing, so a function declaration would look like:
function myfunction ($param)
{
$a = array ('a', 'b');
callfunction ($a);
}
And although I have set the style guide in Netbeans to correspond to this whenever it does autocomplete/suggestions it always misses out the space and gives me something like callfunction($a) even though when I go source->format (alt+shift+f) it then formats the code properly.
Any way to get autocomplete to add the space?
UPDATE:
Just to make things clear, I have set up Netbeans to correspond to my coding preferences, as indicated by the ability to use auto format. The problem is auto complete (or whatever the hint thing is called) does not respect these settings, leading to the missing space.
Go in Tools->Options.
In pane Editor -> choose pane Formatting.
In language choose PHP and in Category choose Spaces.
Check all in Before Keywords, Before Parenthesis, Before left braces, and you can choose other properties if you want.
Then when you will use auto-complete or Alt+Shift+F to reformat it will put the spaces correctly.
EDIT :
In the OP case it seems an other configuration prevents the auto-complete to works.
This is my config :
Do this:
Goto Options > Formatting
Scroll down to "Spaces Before Parenthesis"
Check the option called "Function Declaration"

autocomplete in eclipse

I have been using gvim for a while and now im trying eclipse and a feature that I really miss is the auto complete. Not just typing pre and getting preg_replace as a suggestion, but if I have a variable name that I have been using like $_POST['confirm_delete'] then confirm_delete comes up as a suggestion if I type con.
Can I get this feature with eclipse?
Yes, Eclipse does have autocomplete. But not for unknown array indices like $_POST['myindex']. Autocomplete works for all your normal variables and classes/methods.
This might help : once you have already typed confirm_delete in your file somewhere, you can use eclipse's global autocomplete feature Alt + /. For example if you type con and Alt + / it will complete it with confirm_delete if it is the only word in the file that starts with "con" (otherwise type a few extra letters to be sure).
This works everywhere in the file, even in comments.
Eclipse (also Netbeans) cant auto complete array indexes.

Categories