How do I use phalcon-devtools\ide\phpstorm in phpstorm? - phpstorm

I am trying to integrate the Phalcon developer tools with phpstorm. There is a video here, but I am unable to view it due to my location.
I can't find any other usable reference in the documentation, how can I accomplish this?

Here are the steps.
Make sure you have the phalcon-devtools installed Instructions
Create a project using phalcon-devtools (unless you already have a project)
Launch PHPStorm and create the project there (unless you already did that).
Click File-Settings (Ctrl+Alt+S) (or PHPStorm-Preferences for Mac)
Click the second option "Command Line Tool Support"
Click the + icon and a new popup comes up. Make sure you have "Custom Framework" selected
In the new popup type:
Framework: Phalcon
Tool path: /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/phalcon.sh
Alias: phalcon
Description: Phalcon Developer Tools
This assumes that your phalcon-tools have been installed under:
/Applications/MAMP/htdocs/phalcon-tools/
Also if you use a Windows environment, you should use phalcon.bat instead of phalcon.sh (see Tool Path line above)
Click Apply and then OK.
Click Tools - Run Command (Ctrl+Shift+X)
In the Commands output window, type:
phalcon commands
You should be able to see output. If there is an error check your path. Type any of the phalcon-tools commands to generate components for your project.
In PHPStorm you should see in the project explorer "External Libraries". Right mouse click and select "Configure PHP Include Paths"
In the new dialog click the + and navigate to the /Applications/MAMP/htdocs/phalcon-tools/ide/phpstorm/0.5.0 folder and click OK.
Now as you type code, the relevant helper popup will appear with all the relevant functions.
2012-09-07: There is a beta implementation of the Phalcon PHPStorm support for 0.5.0 here. In the upcoming weeks the code will become part of the framework and included with the 0.5.0 version.

I had some problems with the execution of the phalcon.bat file on my Windows Dev machine, no PHP installed, so i research a much simpler solution for phpstorm.
Simply do following:
click on "External Libraries"
click on "Configure PHP Includes Paths..."
click on add
add "phalcon-devtools\ide\[YOUR_VERSION_DIRECTORY]"
Than you have code completion for phalcon:-)

If you see the Phalcon module loaded in phpinfo page in your WAMP server, do the following to get loaded the module in CLI mode too.
Copy <WAMP INSTALATION >\bin\apache\<APACHE VERSION >\bin\php.ini to \bin\php\<PHP VERSION>\
Set php PATH to <WAMP INSTALATION>\bin\php\<PHP VERSION>\
That should solve the problem.

It has since been changed,
"As part of our restructuring and working towards a better more robust framework in terms of features as well as organization, we have removed the IDE stubs from the Phalcon DevTools repository and moved to its own repository."
The new instructions are located here:
https://blog.phalconphp.com/post/phalcon-ide-stubs-repository

Related

Goland showing Unresolved type (Instance, in GCE library specifically), but core/tests run fine ("invalidate and restart" solution not working here)

I'm using the GCE library in Go, along with go modules.
I'm finding that, while it happily compiles and runs unit tests, it's not resolving those types (e.g. compute.Instance) in the Goland IDE. I'm using 2020.2.
I first added this dependency by hand-coding (adding "google.golang.org/api/compute/v1" to my imports, and letting the module handler load whatever it needs). It added google.golang.org/api v0.50.0 to my go.mod file.
I've tried the old "Invalidate and Restart" approach, and it didn't do anything. I have another project where a different version of that module happens to be loaded, and it works fine on that one.
I've even tried a more nuclear version (Invalidate (no restart), close project, close IDE, delete the .idea directory, and delete the contents of ~/.cache/JetBrains). Still no dice.
FWIW my go module's version is go 1.15
You can navigate to the package sources by pressing Command/CTRL+Click on the import statement (or via External Libraries menu in Project View) and find compute-gen.go file and size limit warning. The IDE behaves as expected.
As a workaround, you can invoke Help | Edit Custom Properties... and add the following line idea.max.intellisense.filesize=8500000 (depends on the original file size), restart GoLand. Please, keep in mind that the IDE can be slow when dealing with large files even if they are not open in the editor.
You can read more about the idea.properties file here.

How to change Active configuration in monodevelop?

I'm following these steps to build sdrsharp on stable Debian. So fr, everything went without a hitch, but I can't figure out this step:
cd into the new sdrsharp directory and then load monodevelop and open the sdrsharp.sln project. If the .sln doesn't open use a text editor to open the .sln file and at the end of the first line change the 12.00 to 11.00. Older versions of monodevelop don't understand the VS2012 header.
Set the Active Configuration from Debug|x86 to Release|x86.
The first one is just given for context, monodevelop has no problem opening the file. But how do I change the Actove Configuration?
Monodevelops internal help is broken, I have no experience with monodevelop or similiar tools as I'm no coder, hence asking here.
Edit to add
The same question was asked and answered here, there should be an option under the "project" tab. But in my case, working from the downloaded .sln, all options under project are grayed out. What to do?
Fixed! The Version had to be changed back to 11 (first bullet point above, relevant to my special case), then reopen file, then it's opened as a project, not as a text file and all the options work.
Take home lessen: That a progeam opens a file without complaining does noit mean there's no error.

Is it possible to get code-hinting in JetBrains WebStorm for a non-core node package?

Is it possible to get code-hinting in JetBrains WebStorm for a non-core node package? Specifically, I'd like to get hinting/completion working for buster. I can't seem to find any information on this. Thanks much!
For buster.js, download buster-test.js and save it somewhere the WebStorm/PyCharm project can see it. Hinting should show up immediately.
WebStorm 2020.1
There's a trick to getting "coding assistance" for 3rd party packages that support community stubs (AKA Typescript definition files):
Open the project's package.json
Position the cursor on the package (within the dependencies section)
Press alt+enter (or click the light bulb)
Choose Install '#types/name' (where name is the dependency)
For example:

Playn HTML5 won't run from Eclipse

I am trying to run the Playn example projects. I followed every step in this guide to setup new Playn development environment and then this guide to run sample projects.
it seem to work fine but when I try to run the HTML5 version by right click and then going to Google-> GWT compile, nothing happens. I don't see the development mode view poping up to copy the address and paste it to web browser as the guide says. I just get the following in the console window:
Compiling module playn.showcase.Showcase
Compiling 1 permutation
Compiling permutation 0...
Compile of permutations succeeded
Linking into L:\playn-samples\showcase\html\war\showcase
Link succeeded
Compilation succeeded -- 35.187s
Beyond that nothing happens. If I right click and select run as-> web application, I get the pop out saying
Could not find any hosting pages in the project playn-showcase-html
Anybody know what am I doing wrong ?
What you got from the compilation was all good.
"Beyond that nothing happens." is okay.
When you right click on the "playn-showcase-html" project, select "Run As - (g) Web Application", you should get an output to the "Development Mode" tab as "http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997".
If not, check if you have got the following folder structures under the "playn-showcase-html" project:
playn-showcase-html
|...
|--war
|--Showcase.html
|--WEB-INF
|--web.xml
As far as I know, you can't simply compile (GWT) and run the HTML version. This is because, the HTML version requires a local web server (such as jetty/tomcat) to host the files in order for the project to be 'run'. However, a simpler way around this would be to try using ant via Eclipse.
Window > Show View > Ant
Once the window appears (probably on a sidebar), right-click and select:
Add Buildfiles...
When the list of projects appear, expand the project by clicking the small arrow to the left of the project name in the list. Then select the ant build file:
build.xml
That will add the ant build file to your list of active build files.
Expand similarly to look at the ant tasks provided by the build file.
Double click on the appropriate task; in your case:
run-html
OR
Run ant directly on the command-line to get the same results.
In the current version of PlayN a jetty server is being started automatically. Right click on the xx-html project "Run As"->"maven install". This starts the GWT compiler, and starts a jetty server (default port is 8080), then you can run the HTML5 version by typing "localhost:8080" in yout browser.
I've also wrote a more detailed description about this on my blog getting started with eclipse and PlayN , maybe this could be interesting.

Adding an external jar library to Intellij IDEA

I'm having a silly problem : I'm trying to add the Jsoup library (which is just an external jar) to my android application developed in Intellij Idea and it seems and don't do it right .
I put the library in the libs folder , then I went in Project Structure -> modules and selected dependencies , select add global library , select attach source and click ok.
When I write code it is able to automatically import classes and to compile , but when running I get " java.lang.NoClassDefFoundError: org.jsoup.Jsoup"
Copy the .jar file into your lib/ directory.
Right click the new .jar in the lefthand file browser in IntelliJ / Android Studio
Choose "Add as Library..."
Voila!
-Open the External Libraries node on the Left hand panel.
-Select Open Library Settings
-Project structure dialogue opens up.
Select the Libraries.
Click the "+" to browse the file.
![add external jar1
In IntelliJ IDEA 15 you can also access the Project Structure menu item from "File" item in the menu bar. Select Libraries from the list on the left. Click the "+" to browse the file, select it and you're done. It will be added to the "External Libraries" directory in your project.
Have a look at the newer artifacts section. Perhaps you don't add the JAR into your deployment properly.
UPDATE:
I'd like to update my answer based on lessons learned over the past six years since I first answered this question.
The best way to manage 3rd party JAR dependencies in Java projects is to learn Maven (my preference) or Gradle. IntelliJ has terrific integration with both.
If you combine those with an enterprise repository like Nexus you'll have no problems. Your dependencies and versions will be completely specified. Conflicts will be identified for you. Updates will be relatively simple.