tmysik commented on code in PR #8196:
URL: https://github.com/apache/netbeans/pull/8196#discussion_r1929795157
##########
php/php.project/src/org/netbeans/modules/php/project/ComputeTestMethodAnnotations.java:
##########
@@ -82,52 +82,88 @@ public void unregister() {
@Override
public void propertyChange(PropertyChangeEvent event) {
- assert SwingUtilities.isEventDispatchThread() : "UI thread expected
but is: " + Thread.currentThread().getName();
-
+ assert SwingUtilities.isEventDispatchThread() : "UI thread expected
but is: " + Thread.currentThread().getName(); // NOI18N
+ Document document = getLastFocusedDocument();
+ if (document == null) {
+ return;
+ }
+ PhpTestingProvider testingProvider = getFirstTestingProvider(document);
+ if (testingProvider == null) {
+ return;
+ }
+ // don't add the listener if this document is not a test file
Review Comment:
Just a note - hopefully not a big performance hit here. I mean, if you can,
please verify that test provider detection is _fast_ (enough). Thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists