Context menu options not available #21

Closed
twifty opened this Issue Feb 19, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@twifty

twifty commented Feb 19, 2016

On the latest version of the netbeans dev build, and using this plugin (not the one built into netbeans) several items are missing. The docs say to right click on a file or folder, and there will be 'fix' option listed. Well, there isn't.

Very easy to reproduce, just install the plugin, configure the source and default config "PHP >> Code Analysis >> Coding Standards Fixer", then right click on a file.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 19, 2016

Owner

"PHP >> Code Analysis >> Coding Standards Fixer", then right click on a file.

This is wrong. I'll fix the README file because I noticed that it is old.

Please check PHP > Frameworks & Tools > PHP CS Fixer.

BTW, now I looked at your issue on PHP CS Fixer repo. I understood now, the error message is output to stderr. So we can fix it in NetBeans.

Thanks!

Owner

junichi11 commented Feb 19, 2016

"PHP >> Code Analysis >> Coding Standards Fixer", then right click on a file.

This is wrong. I'll fix the README file because I noticed that it is old.

Please check PHP > Frameworks & Tools > PHP CS Fixer.

BTW, now I looked at your issue on PHP CS Fixer repo. I understood now, the error message is output to stderr. So we can fix it in NetBeans.

Thanks!

@junichi11 junichi11 self-assigned this Feb 19, 2016

@junichi11

This comment has been minimized.

Show comment
Hide comment
Owner

junichi11 commented Feb 19, 2016

@twifty

This comment has been minimized.

Show comment
Hide comment
@twifty

twifty Feb 19, 2016

I've discovered why I'm not seeing 'CS Fixer' in the context menu. It doesn't appear for any projects/folders/files which are under 'git' control. Since my whole project is under 'git' it lead me to believe it wasn't working.

So, to reproduce this bug. Open/create a project. Add a folder with a few files, then add them to git. Those controlled files will not have the 'CS Fixer' in the context menu. The command can be run from a parent directory, but it needlessly parses extra files.

Also, I have assigned a shortcut to the action (which I mentioned on netbeans) and it works flawlessy, even on git controlled files. So, the bug is only related to the context menu.

twifty commented Feb 19, 2016

I've discovered why I'm not seeing 'CS Fixer' in the context menu. It doesn't appear for any projects/folders/files which are under 'git' control. Since my whole project is under 'git' it lead me to believe it wasn't working.

So, to reproduce this bug. Open/create a project. Add a folder with a few files, then add them to git. Those controlled files will not have the 'CS Fixer' in the context menu. The command can be run from a parent directory, but it needlessly parses extra files.

Also, I have assigned a shortcut to the action (which I mentioned on netbeans) and it works flawlessy, even on git controlled files. So, the bug is only related to the context menu.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 19, 2016

Owner

I cannot reproduce it.

nb-cs-fixer-issue21-1

Did you check your options as I wrote the above?(did you set the php-cs-fixer path?)

nb-cs-fixer-issue21-2

If you don't set options, context menu is not shown.

Owner

junichi11 commented Feb 19, 2016

I cannot reproduce it.

nb-cs-fixer-issue21-1

Did you check your options as I wrote the above?(did you set the php-cs-fixer path?)

nb-cs-fixer-issue21-2

If you don't set options, context menu is not shown.

@twifty

This comment has been minimized.

Show comment
Hide comment
@twifty

twifty Feb 20, 2016

I've figured it out, and it's not primarily related to git. I figured out that any project with a 'composer.json' will not show the context menu. Right clicking on the folder and selecting "open project of folder" will open the project, then the context menu becomes available, and will remain available even after closing that project. Try it with any composer package.

I thought 'git' because my projects are also composer controlled.

twifty commented Feb 20, 2016

I've figured it out, and it's not primarily related to git. I figured out that any project with a 'composer.json' will not show the context menu. Right clicking on the folder and selecting "open project of folder" will open the project, then the context menu becomes available, and will remain available even after closing that project. Try it with any composer package.

I thought 'git' because my projects are also composer controlled.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 20, 2016

Owner

I figured out that any project with a 'composer.json' will not show the context menu.

I cannot reproduce it.
nb-cs-fixer-issue21-3

Right clicking on the folder and selecting "open project of folder" will open the project, then the context menu becomes available, and will remain available even after closing that project.

I'm not sure what this means... Can you attach screenshots?

Owner

junichi11 commented Feb 20, 2016

I figured out that any project with a 'composer.json' will not show the context menu.

I cannot reproduce it.
nb-cs-fixer-issue21-3

Right clicking on the folder and selecting "open project of folder" will open the project, then the context menu becomes available, and will remain available even after closing that project.

I'm not sure what this means... Can you attach screenshots?

@twifty

This comment has been minimized.

Show comment
Hide comment
@twifty

twifty Feb 20, 2016

I meant to say, a subproject with a composer.json. In your example above, only your main project has the file, which is open. If you have a subfolder/subproject with a composer, that's where the issue begins. Take for example a simple Symfony project. There will be many 3rd party sources in the 'vendor' directory, each of which has it's own composer.json. These subprojects will not display the menu unless the project is first opened.

In my case, I am working on subprojects in the 'src' directory, which are backed up to github and have a composer.json.

To test this, I recommend using composer to download a symfony shell, just be careful when opening the subprojects. Once netbeans has created the project config for those extra projects, the context menu begins to work.

twifty commented Feb 20, 2016

I meant to say, a subproject with a composer.json. In your example above, only your main project has the file, which is open. If you have a subfolder/subproject with a composer, that's where the issue begins. Take for example a simple Symfony project. There will be many 3rd party sources in the 'vendor' directory, each of which has it's own composer.json. These subprojects will not display the menu unless the project is first opened.

In my case, I am working on subprojects in the 'src' directory, which are backed up to github and have a composer.json.

To test this, I recommend using composer to download a symfony shell, just be careful when opening the subprojects. Once netbeans has created the project config for those extra projects, the context menu begins to work.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 20, 2016

Owner

Just provide a simple reproducible project with exact steps to reproduce it. (e.g. via GitHub public repo.)
It is hard to understand your context if you write only its explanation.
Why don't you provide screenshots, a sample project , e.t.c. ? It is easy to reproduce it.

Owner

junichi11 commented Feb 20, 2016

Just provide a simple reproducible project with exact steps to reproduce it. (e.g. via GitHub public repo.)
It is hard to understand your context if you write only its explanation.
Why don't you provide screenshots, a sample project , e.t.c. ? It is easy to reproduce it.

@twifty

This comment has been minimized.

Show comment
Hide comment
@twifty

twifty Feb 20, 2016

OK, clone and open SimpleProject

The 'SimpleSource' directory and anything under it has the context menu. The 'SubProject' doesn't. This is because 'SubProject' contains a composer.json file. Right clicking on 'SubProject' and selecting "open project of folder" will open a new project. The context menu will now be available in the primary project, even after closing the new project. This can be reset by deleting the 'nbproject' directory.

twifty commented Feb 20, 2016

OK, clone and open SimpleProject

The 'SimpleSource' directory and anything under it has the context menu. The 'SubProject' doesn't. This is because 'SubProject' contains a composer.json file. Right clicking on 'SubProject' and selecting "open project of folder" will open a new project. The context menu will now be available in the primary project, even after closing the new project. This can be reset by deleting the 'nbproject' directory.

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 21, 2016

Owner

Thanks! It's reproducible.
I'll fix it.

Owner

junichi11 commented Feb 21, 2016

Thanks! It's reproducible.
I'll fix it.

junichi11 added a commit that referenced this issue Feb 21, 2016

@junichi11

This comment has been minimized.

Show comment
Hide comment
@junichi11

junichi11 Feb 21, 2016

Owner

I've fixed it.
Please try using the new version :
https://github.com/junichi11/netbeans-php-cs-fixer-plugin/releases/tag/v0.5.3

Thanks!

Owner

junichi11 commented Feb 21, 2016

I've fixed it.
Please try using the new version :
https://github.com/junichi11/netbeans-php-cs-fixer-plugin/releases/tag/v0.5.3

Thanks!

@junichi11 junichi11 closed this Feb 21, 2016

@twifty

This comment has been minimized.

Show comment
Hide comment
@twifty

twifty Feb 21, 2016

It's working like a dream now. Thanks for fixing it so quick.

twifty commented Feb 21, 2016

It's working like a dream now. Thanks for fixing it so quick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment