eclipse / lsp4e

Language Server Protocol support in Eclipse IDE
Eclipse Public License 2.0
61 stars 54 forks source link

Support click on inlayhint label parts #923

Closed BoykoAlex closed 5 months ago

BoykoAlex commented 6 months ago

InlayHint may have a number of InlayHintLabelParts. This is necessary support to determine which label part has been clicked on to execute the command corresponding to the clicked label part.

Includes a test for a single label part

BoykoAlex commented 6 months ago

What do you think of this PR @mickaelistria @rubenporras ? I wasn't able to write a proper unit test for the multi part label... However, testing it manually with multi part label from LS each part with its own command - worked very well for me. I've tried to find GEF/GMF DirectEditRequest logic that would find from the click where to place the cursor in the popped up text cell editor (i.e. find char under mouse) but looks like this code is gone... Nevertheless, what I've implemented seem to do the job... GC would only be created if more than one label part present and multi-label clicking seem to perform acceptable.

BoykoAlex commented 6 months ago

Any update on this PR? Shall I indeed use LanguageServerDocumentExecutor.LanguageServerDocumentExecutor(IDocument) to execute a command from inlay label part?

BoykoAlex commented 5 months ago

@mickaelistria @rubenporras am I okay to merge this PR? I see the build is failing but if i run it locally on master it is the same failure :-\

rubenporras commented 5 months ago

@BoykoAlex , if you rebase, it should build again.