apache / apache/grails-intellij-plugin

[Grails] Dynamic finder get confuse with long and similar name.

Open
#335 0 comments 0 reactions 0 assignees View on GitHub
bug imported-from-youtrack
Dominant language
Java
Stars
17
Forks
4
Avg merge
5d 15h
Merged PRs (30d)
4

Description

IDE VERSION: IntelliJ IDEA 2018.1.6 (Ultimate Edition) Build #IU-181.5540.7

What steps will reproduce the issue?
1. Create a simple domain class like:
class Testing {
Integer good1Good2
Integer good1Good2Good3

Integer bad1Bad2Bad3
Integer bad1Bad2Bad3Bad4
static constraints = {
}
}

2. Create a simple controller like:
class TestingController {

def index() {
Testing.findAllByGood1Good2BetweenAndGood1Good2Good3Between(1,2,3,4)
Testing.findAllByBad1Bad2Bad3BetweenAndBad1Bad2Bad3Bad4
}
}

3. While the dynamic finder auto-complete findAllBy... does not have any problem with the shorter one, the auto-complete stop working on the longer one (with 3+ camel-case) with a "No suggestions" pop-up. Sometime even if the code is completed, the IDE will highlight the code with "cannot resolve symbol (findAllBy...) error message." It will run, and compile without any problem though.

What is the expected result?
The expected result would be having an auto-complete selection box pop out for selection.

What happens instead?
No suggestions" pop-up.

Please attach idea.log (go to Help | Show Log in ... to discover it easily). You can use 'Attach File Privately' item to make attachments visible to 'jetbrains-team' group only. If you don't want to share IDE logs even with JetBrains team please at least paste information about IDE build and your environment below (it can be copied from Help | About dialog).

Сonsider attaching a screenshot, screencast, or a code sample when it's hard to articulate the problem. Note that you can easily drag & drop files of any type into the issue.

If you are experiencing performance issues, please also [attach the snapshots](https://intellij-support.jetbrains.com/hc/en-us/articles/207241235).

---

*Imported from [IDEA-195766](https://youtrack.jetbrains.com/issue/IDEA-195766) · Type: Bug · Votes: 0*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the dynamic-finder autocomplete entry point and reproduce the issue using the Testing domain class and TestingController example in the report. Compare completion for the shorter and longer findAllBy... names, then verify that suggestions appear and the unresolved-symbol warning is gone for the long camel-case finder.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.