-
Notifications
You must be signed in to change notification settings - Fork 874
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
ActionProvider and its Lookup in NbLaunchDelegate #7059
Conversation
The test failure here and in master for the "LSP tests on Linux" branch match. Before anything more is added to master, that needs to be resolved. Either by reverting the commits that introduced the problem or by adding a real fix. |
VSCode Extension Tests on JDK 17 were green prior 4d448c0 ... but with 4d448c0 there is a timout failure and lsp server tests fail too... maybe it is random... |
I am more than little nervous about introducing all FileObject's Lookup's contents - that is all services provided by the FO (editor, ...) into the (temporary) default Lookup ( |
These services are available anyway. One just needs to 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 |
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 services originally meant to be just local (i.e. bound to a file) are not broadcasted to everyone. |
97e6e1e
to
fb0fa22
Compare
Actions in regular NetBeans UI (menu or toolbar) observe global context which at the end delegates to The lookup passed to Passing different lookup to
Are you referring to my change that passes I need the At the end I'd like to point that that the change to pass |
fb0fa22
to
e639aa1
Compare
I've just forced pushed from fb0fa22 to d07364e and changed the target to |
e639aa1
to
d07364e
Compare
So, trying to understand the change here. The summary only speaks about ensuring missing ActionProvider does not cause NPEs, which certainly sounds correct - it is OK for projects to not have any particular service in their Lookup. Besides that, this change appears to modify the Lookup used for
|
...est/unit/src/org/netbeans/modules/java/lsp/server/debugging/launch/NbLaunchDelegateTest.java
Outdated
Show resolved
Hide resolved
I am pretty sure the
I thought they are required to contain
I hope it matches the original spirit more. On the other hand I admit I was ready to remove the change, if it was the reason why the tests were failing (but it wasn't). |
The corresponding GUI lookup would be probably |
Sorry, but I don't see this in the code. I may be reading the code wrong, but what I see, the In addition to that, I've added this log:
and ran a source file outside of a project, and got this output:
To me, it seems clear the
I wonder what's the purpose of flattening the whole Project's Lookup into the context. Is that done anywhere else? What do we expect the And, if both Project and FileObject Lookup are flattened, what about their order? And what about duplicities? I don't think the Project Lookup must contain anything
From my view - I'd say that |
Sorry, I don't see this in the code. I see this Lookup is only sent to |
I stand corrected, that Lookup does not escape |
Good. I was just about to write some test. To prevent misunderstandings, can you and Lahváč state exactly what you don't like at current state of affairs? So I can address exactly what you believe is unbearable? Thank you. |
So, from me: a) as far as I can tell, the current enhanced lookup is only used for b) I would like to hear rationale for including I personally don't have so strong opinion for including |
Please retarget the PR to the master.
|
Now I see where the problem is: It was consistent once: f5954a9 - but it is not consistent in the overall state of this PR. I guess I messed something up when merging or re-targeting to Putting the code back with 483b658 - now the lookup sent to |
No, probably it is not done. In fact it not even a project instance is being sent in NetBeans IDE. The lookup I am seeing in
E.g. it contains |
I haven't found a way to re-target this PR to |
Looks like it got automatically closed and locked when Anyway, short answer is please don't target |
I was aiming to get the fix into a close release. I just haven't got the approvals soon enough as there was a discussion around some of my changes. Now I need to wait (at least) next three months before I can merge enso-org/enso#9041 |
@jtulach at no point was merging this for release discussed in review, and #7011 was merged into master rather than delivery anyway?! After release branching, if you want something in the release it needs to follow the process outlined at https://cwiki.apache.org/confluence/display/NETBEANS/Pull+requests+for+delivery |
Second attempt to integrate #7011. Makes sure the
FileObject
(and itsgetLookup()
) are sent even in case ofCOMMAND_RUN
andCOMMAND_DEBUG
. As a result even "project oriented actions" can find out what's the currently selected file and operate on it.My Enso projects don't have
ActionProvider
in their lookup. That misleadsNbLaunchDelegate.java
to create aCollection
withnull
element that yieldsNullPointerException
as soon as one tries to iterate over the collection and invoke a method on individualActionProvider
.