I checked "Settings > Prefences > Backup/Auto-Completion > Enable Auto-completion on each input" and "Function parameters hint on input" options. I have Notepad++ 5.9 (unicode) version. It auto completes function names but not their arguments. Also i tried re-install. I know it has this feature but not working. Any idea why?
I mean it auto completes print_r when i write "pri" but i want it to work like in the image;
http://i51.tinypic.com/3322auc.jpg
Hmm, this is not an answer to your question but I want to share it anyway.
I have used Notepad++ for years. I didn't like Eclipse and NetBeans is just so damn slow.
I never used the auto complete function for anything.
Notepad++ can't really do any code analysis, it can only give you auto-completion on the known PHP functions.
I've since switched to an IDE that does full code analysis and can do auto-completion for your own code as well.
Notepad++ is great if you just want to write something real quick. It's also a great tool if you want to learn about PHP since it doesn't do auto-completion very well ;) but if you really want to be productive when you're working on a large application I recommend you use an IDE that does code analysis. Productivity is the key here. I spend less time looking through files and more time actually writing code, which is great! :D
Good IDEs for PHP: NetBeans, PHPStorm, Eclipse.
For this feature to work, you need to supply an .xml file which contains the appropriate functions and parameters.
An example for Javascript with installation instructions can be found here.
I have not yet found xml files for PHP (or Python, which I'm looking for). But it seems this can work in npp, you just need to locate the right xml file.
Best of luck!
(Oh, and don't listen to the naysayers who are too quick to give up, npp works fine as an IDE.)
Notepad++ it's very good text editor, but it's not IDE.
Try to use IDE - NetBeans or PhpStorm, and you will get much more than just smart autocomplete.
I have a same question about this, function hint is Ok,but param hints not display until I download a new release of notepad++(a not install release), all is ok. before, I tryed many time, and edit the xml files.
If you will edit you own language, Can copy from a exist language xml ,for cpp.xml in plugins/APIs folder. It's easy to understand its rule.
It is very easy to have a error, if you config file is changed.
Related
I am using Visual Studio Code on a Mac to work on WordPress applications.
Is there a way to make Visual Studio Code recognize HTML and use it's features (mainly autocompletion) inside PHP files?
I've searched for this answer before but just get told to Go to Visual Studio Code Settings: File >> Preferences >> User Settings
// Place your settings in this file to overwrite the default settings
{
// Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed.
"files.associations": {"*.php": "html"}
}
But doing this makes you lose all PHP support and autocompletion.
I wish Microsoft would realize that PHP developers commonly use PHP and HTML together when creating applications/websites. I would love to use VS Code instead of the magnificent but expensive PHP storm if possible.
You can install this plugin:
PHP Intelephense
As far as I can tell, it does. Take a look at this php file I have created in VS Code (no extensions), with HTML inside the file with syntax highlighting for both languages.
There is a button (It should say the word PHP) in the bottom right corner of the screen that allows you to switch the syntax highlighting and autocompletion to another language, and while this does temporarily turn off PHP syntax, it will allow you to code in HTML a lot easier.
You can enable html support in any language by adding the following to your settings.json file:
"emmet.includeLanguages": {
"your-language": "html",
"rust": "html",
"php": "html",
"javascript": "html",
}
Very easy solution
Search emmet in settings and remove php form Emmet: Exclude Languages list
This will definitely work for everyone
I also faced this genuine concern while learning PHP, and the only solution I came up with at the moment is clicking on PHP button on bottom right corner of VS Code screen.
I am attaching the screenshot below with that PHP button highlighted so you would be able to locate it easily. Once clicked it will ask for a language you want autocomplete to work on, select HTML and it would start autocompleting html, click again to enable PHP autocomplete.
I also happened to come across GitHub Pilot Extension, you need to be a student for availing this service for free or you'll have to buy membership, It is a good tool for auto complete although that is not the gist of it's use, It is something great invented for learners and also professional coders.
I used to use PHPEd and it has content-aware autocomplete. It knows the content that your cursor is in: php, html, css, js, etc and suggests tags/attributes/functions/etc based on the language where the cursor is. The entire problem with VSCode is its decidedly unintelligent “intellisense” that relies wholly on what language the document is defined as. Any IDE worth its salt is going to have content aware auto-completion. The only satisfactory answer to your question is make your own snippets and turn off emmet and php auto-completion.
i'm pretty new to php development and want to start using an IDE with syntax checking and autocompletion.
I'm used to programming java with eclipse and thought that the PDT provides similiar functionality.
In java if i type in for example: "new Arr" and press ctrl+space autocomplete suggests a list of possibilities with "new ArrayList()" on top.
but if i try the same in a php project, for example with "new mysq" and ctrl+space i get nothing. I would expect to get "new mysqli()" or similar recommended.
Is the described functionality not included in PDT? Or did i configure something wrong?
I did the "right click on project-> configure-> Add php support" but it didn't change anything.
If you would like to have some basic auto complete feature you can use NotePad++ (download) for a quick and easy starter. This is a really great minimal program that can be used very efficiently to code in many different languages. It provides huge ammount of different functions. It is a must have tool for any developer.
I used Notepad++ to write ten thousands of lines of PHP code, it worked really great for me.
Otherwise PDT also supports autocomplete. Make sure that you have a PHP project added and then your are in a PHP file (.php extension). If you have Java autocomplete working in the same project then I think that you are in a Java project, try adding a PHP project, then a new PHP source file. Then PHP autocomplete should be working well in this source file.
Make sure also that you have PHP perspective selected.
I hope you can get by now starting using PHP! Have luck and good times using this great language!
I found the solution in this question: Why does Eclipse code completion not work on some projects?
I had to manually add this:
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
to the buildpath file of my project.
I have a lot of php code and I'm going through it right now (500+ files). I was hoping to find a program that would let me easily search through the files to see which files contain a specific variable I am editing. Kind of like a super edit -> find from notepad++. Anyone have any suggestions?
Best,
Pavan
One word. ack.
You can also try Agent Ransack
You can use a PHP ide such as NetBeans or your alternative is if you want to stick with notepad++ you can the Find in files which is located in the last tab when you hit CTRL+F
using NetBeans IDE you can lay your project out into a really decent code profiler and be able to see what your code is doing from a visual prospective.
Are there any IDEs on PC which will allow you to view your changes live as you are typing? / Can any IDEs you know of be set up to do that?
For both HTML and PHP ideally?
You could stick a meta refresh in your head, but that will get ugly if you have a lot of php parse errors. You could put the page you want to test inside a frame and have some javascript refresh that frame every few seconds too. Then you could use any IDE and browser you want!
Zend will do this. But be forewarned that seeing a bunch of unfinished PHP code is very ugly. I'd suggest sticking with refreshing your browser.
Oh, and if you actually do anything with that PHP code, like request an RSS feed, you would be making hundreds of calls if it ran the PHP code often.
The PHP PDT has a debugging tool (plus other cool stuff like type hints, auto-complete and etc.) and allow you to preview your code in a browser. Install xampp, host your php files on your localhost, and you should get almost what you want.
I recommend you netbeans .its free. it is available for all platforms, and mostly it is good for editing php, jsp, java, css, html, ...
Good for SVN, mercurial, Plus you can integrate it easyly with kenai.com...
it helps with the IntelliSense kind of pop up.
believe me, i'm using it for php development and its the best suited ide i can find...
Eclipse with PHPEclipse does have live error and syntax highlighting.
Is there a simple way to find the file path to where a function is defined? I currently use dreamweavers FIND in an entire directory. Would be nice to have something that doesn't require downloading the entire site tho.
Any suggestions?
Personally I use an IDE like Netbeans or Eclipse PDT. In the case of Netbeans you can ctrl-click on a function and it'll take you to the definition. Sometimes there is a choice in which case it'll make you select one.
But its generally bad form to reuse a function name within your code in different files. It can lead to hard-to-find bugs because it's hard for any program to figure out exactly which one function is actually getting called since source files can be included dynamically.
Would be nice to have something that doesnt require downloading the entire site tho.
I hope this doesn't mean that you're modifying the site remotely.
Have a local working copy, make the changes, test them locally, then upload the changes.
A simple combo of vim and ctags makes the "go to definition" task a piece of cake.
You can't search for something (and expect to find it) unless you have a copy of all the files it might be in.
A number of IDEs have the ability to click and go from a use of a variable or function to its definition. If not that, then a multi-file searching tool within your editor, or something from a command line (such as ack) that is a little more specialised at searching source code can help. Good naming conventions can also help a lot for consistency.
It's not the question, but why don't you have a copy of the site locally - and while you are at it, keep it in version control as well?
I'd sure like this get_functionPath() ability and anyone that has extensively had to work on other people's code would probably find it incredibly useful. We have function_exists, if that could simply return the file the function is defined in for user defined functions it would save a TON of trouble. No, not all of us use IDEs, and yes some of us have been doing this long enough to code on the production machine. Test boxes and sandboxes are for rookies.
One trick is to purposely trigger an error in the function you are trying to locate. Can save a ton of time.
You'd need to use some kind of tool that could build an index on a remote filesystem that you could download and perform local lookup and search upon. I don't know of anything that can do this and a few moments with Google didn't turn up anything.
Maybe a good idea for an open source project? hinthint
so there is no function that would do this? Something like get_class() which would output the parent class but in the case the file path on the server...