Community
Participate
Working Groups
20030211 It would be helpful for me if in cases that i just have to get a single variable name, i can simply take the first element of the proposals returned by the NamingConvention. In particular the 'Assign expression to field' just needs a single name proposal. See bug 31230 I know that the suggested solution is just a small hack, because with the current intrastructure we can't offer the user to really choose what his favourite field name convention it. But I think we still win when we apply our personal preference. My preference would be to take the first prefix of the prefix list (together with the full name). If the prefix list is empty, take the first of the suffix list.
Could you sort the expected proposals for the following tests case ? 1) type name : OneName prefixes : {no prefix} suffixes : {no suffix} 2) type name : OneName prefixes : p1, p2 suffixes : s1, s2 3) type name : OneName prefixes : p1, p2 suffixes : {no suffix} 4) type name : OneName prefixes : {no prefix} suffixes : s1, s2 I need to know what you really want. Your previous comment is not very specific.
Another question: This is the result of NamingConvention.suggestXXXnames that must be sorted or the result of code completion ?
The sorting of what suggestXXXnames returns. But the code assist could take this order to use in relevance. Not that I really care about the first being the best choice. This what I would do 1) type name : OneName prefixes : {no prefix} suffixes : {no suffix} -> oneName, name 2) type name : OneName prefixes : p1, p2 suffixes : s1, s2 -> p1OneName, p1Name, p2OneName, p2Name, oneNames1, names1, oneNames2, names2, oneName, name 3) type name : OneName prefixes : p1, p2 suffixes : {no suffix} p1OneName, p1Name, p2OneName, p2Name, oneName, name 4) type name : OneName prefixes : {no prefix} suffixes : s1, s2 oneNames1, names1, oneNames2, names2, oneName, name
Martin, in case 2), what about suffixes ?
It's a pure personal choice. As I said, the current setup doesn't allow the user to really specify its preference about the favourite name. Insetad of two lists (prefix, suffix), meybe it would have been better to have one list with entries like f*, *_m, * ... ect So even we can't solve the problem, we improrve the situation by having our personal favourite at first position. My argumentation is, if somebody specified prefixes, he probably uses them (but of course there are use cases where this is not the case)
I think, if somebody specified a prefix and a suffix then this suffix is as important as the prefix. So the first proposal should be p1OneNames1. But this proposal is not in your list for case 2). My suggestion is to propose the names in th following order {0}-name with the first prefix and the first suffix {1}-names with prefix and suffix {2}-names with prefix {3}-names with suffix {4}-others For completion the names {0} are more relevant than {1}, {1} are more relevant than {2}, {2} are more relevant than {3} and {3} are more relevant than {4}.
Even I would never use prefix and suffix together, it's fine with me.
CodeAssist : - Variable name proposal is more relevant if this proposal contains a prefix - Variable name proposal is more relevant if this proposal contains a suffix - variable name proposal is more relevant if this proposal contians the first prefix. - variable name proposal is more relevant if this proposal contians the first suffix. So a name with a prefix and a suffix is more relevant than a proposal with a prefix and no suffix. A name with the first prefix is mor relevant than a name with another prefix. NamingConventions: suggestions are given in the following order (it is the same order as relevance for code assist) - names with first prefix and first suffix - names with first prefix and a suffix - names with a prefix and the first siffix - names with a prefix and a suffix - names with the first prefix - names with a prefix - names with the first suffix - names with a suffix - other names Fixed.
Martin - Becareful, this change could break your test. ;)
Thanks for the warning! It should be no problem, I disabled the tests that relied on the order.
Verified.