문제

I am using the Spockframework/Groovy with eclipse(sts) and frequently run my Specs inside the IDE.

What really annoys me is that when I want to jump to a test method it doesn't work.

Does someone know a workaround for this limitation or an alternative?

GoToTest Not Working

도움이 되었습니까?

해결책

It's a known limitation of the Eclipse JUnit plugin. It can only jump to methods whose name does not contain spaces. There exists a long-standing improvement request to fix this (https://bugs.eclipse.org/bugs/show_bug.cgi?id=343129). Meanwhile, your options are to live with the status quo, to only use method names without spaces (not sure about other special characters), to contribute a fix to Eclipse, or to switch to an IDE that doesn't have this problem (such as IntelliJ IDEA).

다른 팁

For now, the quick fix will be that you replace the spaces (' ') by an other character such as underscore ('_'). I just did it with two regEx using Eclipse's find and replace.

Step 1. Remove the whites spaces and replace with underscore

Find: (def "\w*)\s+

Replace with: $1_

(optional) Step 2. Remove method double quotes

Find: (def\s+\w*)"

Replace with: $1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top