fernando88to opened a new pull request, #35:
URL: https://github.com/apache/grails-intellij-plugin/pull/35
## Problem
`GoToTestAction` looked up the artefacts sharing the current name with the
strict
package-scoped `GrailsArtifact.getInstances(module, packageName,
artefactName)`, so
a sibling in another package was invisible:
```
grails-app/domain/com/example/model/Book.groovy
grails-app/controllers/com/example/web/BookController.groovy
test/unit/com/example/model/BookSpec.groovy
```
From `BookController`, "Go To Test" never offered `BookSpec` — even though
"Go To Domain" reaches `com.example.model.Book`, since
`GrailsGoToArtefactActionBase` falls back to a name-only lookup. The two
actions
disagreed about which artefacts belong together.
## Change
Extract that fallback into `GrailsArtifact#getInstancesPreferringPackage` —
same-package matches win when there are any, otherwise every artefact with
the name
— and use it from both actions. Co-located projects keep the narrower
result, so
their behaviour is unchanged.
New `GoToTestActionTest` covers the layout above and the same-package
precedence.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]