Invoke SurroundDescriptor without explicitly selected text
When I press Ctrl+Alt+T to surround an expression without having an explicit selection, IDEA always creates a selection of the whole line and gives me this text-range in com.intellij.lang.surroundWith.SurroundDescriptor#getElementsToSurround.
Question: is there any way to tell if surroundWith was invoked with or without selected text?
I would like to implement a different behavior for these two situations and I'm kind of lost here. I could check if the selection is a selection for the complete current line, but this fails if the user indeed selected the complete line.
Cheers
Patrick
请先登录再写评论。
The correct way seems to be to implement and register
The
method there gets the information if a selection was made.