This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Change The Hint Order Of Unknown Variables | ||
---|---|---|---|
Product: | java | Reporter: | abien <abien> |
Component: | Hints | Assignee: | markiewb |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | markiewb, sdedic |
Priority: | P3 | Keywords: | PATCH_AVAILABLE |
Version: | 7.4 | ||
Hardware: | Macintosh | ||
OS: | Mac OS X | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
Proposed patch
Patch in action |
Description
abien
2013-06-12 12:10:52 UTC
@Svata: Could be solved via https://netbeans.org/bugzilla/show_bug.cgi?id=125577 Created attachment 146510 [details] Proposed patch @Svata: I like to propose a patch to solve this issue. Hints can be sorted by implementing EnhancedFix#getSortText(). See its usage at org.netbeans.modules.editor.hints.FixData.getSortText(org.netbeans.spi.editor.hints.Fix):java.lang.CharSequence a) So I updated AddParameterOrLocalFix and CreateFieldFix to implement EnhancedFix. b) I also introduced a new default ordering with hackish "hardcoded prefix string" approach. * create local variable * create field * create parameter If you do not want the ordering of the "create XXX" fixes (because [1] will be implemented soon?) then simply return getText() in getSortText(). [1] https://netbeans.org/bugzilla/show_bug.cgi?id=125577 Created attachment 146511 [details]
Patch in action
I think that #125577 is not a good solution here, as the parameter/field/variable decision highly depends on the exact context and may vary. Using ranking is a good choice for fix alternatives, which respect different code styles. IMHO the fixes should be grouped into scope groups (local text fixes, environment fixes (like imports), project fixes, hint configuration), then maybe even more grouped so the infrastructure gets a clue what are really alternatives. Integrated as jet-main#f4404bba495a; Thanks, markiewb :) Integrated into 'main-silver', will be available in build *201404240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f4404bba495a User: Svata Dedic <sdedic@netbeans.org> Log: #231133: increased priority of create* fixes over imports |