eclipse-jdt / eclipse-jdt/eclipse.jdt.core

[feature request] "Expand selection to enclosing element" on string without quotes

Open
#947 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
49

Description

I am not sure if this is a missing feature or if I'm just not finding the right shortcut.

I have the following Java code:
```
String s = "this is a long string";
```
or
```
String s = """
this is a long string""";
```

What I want is to click anywhere inside the string and select the whole string, but without the quotes. I already know I can use "Edit -> Expand Selection To -> Enclosing Element", but this selects the text including the quotes.

My use case: I have a test class and I need to change the expected string for several tests. It would be super-easy if I could just select the string without quotes and paste the new text.

Any ideas?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.