jtulach commented on PR #7059: URL: https://github.com/apache/netbeans/pull/7059#issuecomment-1941817214
> > Of course, should there be any performance consequences, I can write the longer complex lookup code. However I doubt there is any performance slowdown. The services are registered _lazily_ (I hope) and moreover the selected `FileObject` is probably opened in VSCode editor and most of its services is initialized anyway... > > I am not that concerned by performance, but rather by the pollution of the contextual default Lookup. I would prefer to have some boundaries, so ... Actions in regular NetBeans UI (menu or toolbar) observe global context which at the end delegates to `Node.getLookup()`. For a node representing a (Java) file that lookup is equivalent to `FileObject.getLookup()`. As such I find using `FileObject.getLookup()` as context passed to `ActionProvider` natural. The lookup passed to `ActionProvider` implementations already contained `FileObject`, but that was more a shortcut than a properly thoughtout design. At least that's what I got from a discussion with Martin @entlicher. Passing different lookup to `isEnabled` and `invokeAction` would be bad - passing as similar lookup as possible is better. > ... services originally meant to be just local (i.e. bound to a file) are not broadcasted to everyone. Are you referring to my change that passes `FileObject` to `ActionProvider.COMMAND_RUN` and `ActionProvider.COMMAND_DEBUG` (and not only `_SINGLE`)? I need the `FileObject` even in this case as I still want to execute only a single file (btw. I had to modify Enso action provider to [support `COMMAND_RUN` and `COMMAND_DEBUG`](https://github.com/enso-org/enso/pull/9041/files) - otherwise I don't get callback from `NbLaunchDelegate` at all. I could possibly modify the code in `NbLaunchDelegate` to fallback to `COMMAND_DEBUG_SINGLE` when the provider doesn't support `COMMAND_DEBUG` and then I wouldn't need to pass `FileObject` into the `Lookup` at all. But the [current state seemed](https://github.com/apache/netbeans/pull/7059/commits/4d448c06fbe809a88054b7c7640f2594f96f5879) like a smaller change. At the end I'd like to point that that the change to pass `FileObject.getLookup()` has already been approved in #7011 - so I hope at least @dbalek is still fine with it. -- 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: notifications-unsubscr...@netbeans.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org For additional commands, e-mail: notifications-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists