This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213784 - "Cannot refactor XXXXX.php that is defined outside of an open project." being displayed for a File of an open project
Summary: "Cannot refactor XXXXX.php that is defined outside of an open project." being...
Status: RESOLVED INCOMPLETE
Alias: None
Product: php
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-07 22:08 UTC by david.zapata
Modified: 2016-07-01 08:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david.zapata 2012-06-07 22:08:47 UTC
After trying to find a method's usages (or Alt + F7) in a PHP class of an open project, the "Cannot refactor XXXXX.php that is defined outside of an open project." message is displayed. This has no sense, since this file is part of an open project (although not the main project). This has happened many times, for static methods and not static methods.

Product Version = NetBeans IDE 7.2 Beta (Build 201205031832)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_31
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.6-b01
Comment 1 Ondrej Brejla 2012-06-08 09:21:10 UTC
I can't reproduce that. Provide me a project, where the problem occurs a describe step by step how to reproduce that. Than simply reopen. Thanks.
Comment 2 Ondrej Brejla 2012-06-08 09:25:22 UTC
And that's the message from refactoring API (ActionsImplementationFactory). I think that we (PHP) can't handle that, can we?
Comment 3 Ralph Ruijs 2012-06-08 12:00:17 UTC
> And that's the message from refactoring API (ActionsImplementationFactory). I think that we (PHP) can't handle that, can we?

I think org.​netbeans.​modules.​refactoring.​php.​RefactoringActionsProvider.canFindUsages() should return true in the specified case. The message was changed according to #183540.
Comment 4 cjsewell 2015-11-25 19:45:57 UTC
This happens to me in 8.1 when attempting to refactor something that's in a subfolder which contains another composer.json.

Its rather annoying, as I may have one main project with many Composer requirements. If I need to refactor something within a Composer dependecies, Netbeans refuses to do it.

A work around is to right click on the dependency folder, choose open "Project or Folder". Once it is open I can then refactor.
Comment 5 Ralph Ruijs 2015-11-25 19:59:05 UTC
(In reply to cjsewell from comment #4)
> This happens to me in 8.1 when attempting to refactor something that's in a
> subfolder which contains another composer.json.
> 
> Its rather annoying, as I may have one main project with many Composer
> requirements. If I need to refactor something within a Composer dependecies,
> Netbeans refuses to do it.
> 
> A work around is to right click on the dependency folder, choose open
> "Project or Folder". Once it is open I can then refactor.

This sounds like if it is as designed, but I'm not sure. Please create a new issue for this, preferably with a small project where the problem occurs and describe step by step how to reproduce that. Thanks!
Comment 6 teelo 2016-07-01 08:43:21 UTC
Confirming for

Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27
System: Windows 8.1 version 6.3 running on amd64; Cp1252; de_DE (nb)

See also: https://netbeans.org/projects/php/lists/users/archive/2015-12/message/8

In that message Tomas Mysik says that the composer plugin is responsible for the greyed out "Find usages" function. In my eyes this is related. Can you guys confirm that?

Once I've deactivated the composer plugin, both functions ("Find Usages" and "Refactor > Rename") were back.