Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PHPStrom #40

Closed
Nyholm opened this issue Jun 19, 2013 · 20 comments
Closed

Support for PHPStrom #40

Nyholm opened this issue Jun 19, 2013 · 20 comments

Comments

@Nyholm
Copy link

Nyholm commented Jun 19, 2013

At the plugin page (http://plugins.jetbrains.com/plugin?pr=idea&pluginId=7168) it says that PHPStorm is not supported. At the list of all plugins to PHPStorm (http://plugins.jetbrains.com/search/index?pr=phpStorm&search=sonar) you cant find this plugin.

I tried to install the plugin by placing the plugn folder (sonar-intellij-plugin-1.0.7) in my PHPStrom.app/plugins. PHPStorm recognise the plugin and I get no errors. But I can't use it according to usage instructions.

Is there support for PHPStrom? How can I make it work?

@aheusingfeld
Copy link
Collaborator

Hi @Nyholm,

thanks for the bug report. Which exact version of PHPStorm are you using?

The plugin should show up in the project settings dialog of the IDE. There should be an entry called "Sonar Configuration". Can you see this entry?

Cheers
Alex

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

Im using the latest version. PHPStorm 6.0.2 build #PS-129.487.

There is not an entry called "Sonar Configuration" in the IDE settings dialog nor under project settings.

@aheusingfeld
Copy link
Collaborator

Thanks again for pointing this out, @Nyholm. I guess I found the problem.

This wiki page describes that our plugin.xml is missing plugin dependency declaration:

If a plugin does not include any module dependency tags in its plugin.xml, it's assumed to be a legacy plugin and it's loaded only in IntelliJ IDEA.

I will add the tags later today and test it with these.

/cc @gshakhn FYI

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

Thank you. Please let me know if I can assist with testing or anything else.

aheusingfeld added a commit to aheusingfeld/sonar-intellij-plugin that referenced this issue Jun 19, 2013
* added <depends> tags to plugin.xml
* modified plugin description in pom.xml

Issues: 40
@aheusingfeld
Copy link
Collaborator

I added a downloadable version of the plugin here. https://github.com/aheusingfeld/sonar-intellij-plugin/tree/issue-40-download/download

@Nyholm would you mind to test it and provide some feedback? Thanks in advance

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

I'm on it.

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

@aheusingfeld I see the settings entry now and the config test passes. When I open a new file I can see the sonar window loading but it does not fetch any data. The problem might be with my sonar installation... I don't know.

@aheusingfeld
Copy link
Collaborator

Open the module settings and check that the Sonar settings for the modules have been applied. This happens when you hit the "Apply to all modules" button in the project settings after entering the correct URL + credentials.
BTW: the host field will only take IP + port. For example: "192.168.172.14:9000"
The action behind the "Test" button actually tries to fetch the module names from Sonar. Afterwards you will have to hit "Apply to all modules" to make the changes effective. Are the module settings for Sonar set?

You can also try to right-click a file and choose "Open in Sonar ...". This will open the file in your Sonar installation's webUI

BTW: the host field will only take IP + port. For example: "192.168.172.14:9000"

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

Hm.. then I think it is an error when fetching the modules.

screen shot 2013-06-19 at 3 29 15 pm

I've pressed Test Connection and I didn't get any errors..

@gshakhn
Copy link
Owner

gshakhn commented Jun 19, 2013

I'm pretty sure the plugin only supports Java code at the moment. Search for references to PsiJavaFile.

We could make the plugin be installable on PHPStorm, but I don't think it'll work with PHP files.

@aheusingfeld
Copy link
Collaborator

Yes. "sonar.r" is probably not a valid sonar URL. Try to specify Hostname/ IP + Port.
If sonar is available via "http://sonar.mydomain.com:9300/sonar/" then you will have to specify "sonar.mydomain.com:9300".

@aheusingfeld
Copy link
Collaborator

@gshakhn Seems you are right. We limit our tooling to PsiJavaFile at the moment but as far as i can see we could try to use the same approach with PsiFile.

@Nyholm
Copy link
Author

Nyholm commented Jun 19, 2013

sonar.r is a valid URL. I access my sonar dashboard with http://sonar.r. (I've done some changes in my /etc/hosts file)

I'm not familiar with PsiJavaFile what's that?

@gshakhn
Copy link
Owner

gshakhn commented Jun 19, 2013

Try putting in the port as well.

PsiJavaFile is how the plugin looks at project files and grabs the info from sonar for them. I'm guessing it will prevent it from working with PHP files. We'll need to look into making it more generic if we want to support more languages.

@Nyholm
Copy link
Author

Nyholm commented Jun 22, 2013

Adding port does not make any difference. I do get authorisation errors if I give a false username/password. I don't believe it's anything wrong with the connection.

I think @gshakhn is right. Is it a big change to make it work with PHP files? I browsed the source code of the plugin and it seams that you could be using PsiClassOwner instead of PsiJavaFile. But I don't know if there is a "PsiPhpFile" or something similar in the Intellij api..

@aheusingfeld
Copy link
Collaborator

We should even be fine with a PsiFile. I'm currently looking into this but I don't know whether I can finish it this weekend!

@Nyholm
Copy link
Author

Nyholm commented Jun 22, 2013

Thank you for your efforts.

@aheusingfeld
Copy link
Collaborator

@Nyholm I just wanted to get back to you and let you know that the change will take a little because I want to wait for @ggili's work on #10. Thanks for your patience

@Nyholm
Copy link
Author

Nyholm commented Jun 27, 2013

No worries. I appreciate that you are willing to implement this feature.

@aheusingfeld
Copy link
Collaborator

Our new plugin at https://github.com/sonar-intellij-plugin/sonar-intellij-plugin/ already supports PhpStorm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants