Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign
several completion issues
killerbot:
This is the test code (just your ordinary main.cpp) :
--- Code: ---#include <iostream>
enum enumerA
{
bla_on,
bla_off
};
enum enumerX
{
bla_on_foo,
bla_off_foo
};
class BitA
{
public:
BitA(){}
void Set(enumerA value) {mValue = value;}
enumerA Get() const {return mValue;}
private:
enumerA mValue;
};
enum enumerB
{
enable,
disable
};
class BitB
{
public:
BitB(){}
void Set(enumerB value) {mValue = value;}
enumerB Get() const {return mValue;}
private:
enumerB mValue;
};
template<typename T>
class BitTemplate
{
public:
BitTemplate() {std::cout << "bit template intended for enums" << std::endl;}
void Set(T value) {mValue = value;}
T Get() const {return mValue;}
private:
T mValue;
};
template<>
class BitTemplate<bool>
{
public:
BitTemplate() {std::cout << "bit template intended for bools" << std::endl;}
void Set(bool value) {mValue = value;}
bool Get() const {return mValue;}
private:
bool mValue;
};
template<>
class BitTemplate<int>
{
public:
BitTemplate() {std::cout << "bit template intended for ints" << std::endl;}
void Set(int value) {mValue = value;}
int Get() const {return mValue;}
private:
int mValue;
};
int main()
{
BitA a;
BitB b;
BitTemplate<enumerA> Bta;
BitTemplate<enumerB> Btb;
BitTemplate<bool> Btbool;
BitTemplate<int> Btint;
return 0;
}
--- End code ---
Carry out all experiments on the line before "return 0;"
killerbot:
Issue 1 :
type :
--- Code: ---a.Set(bla_
--- End code ---
You will see it offers 4 possibilities, but it should only be 2, only the 2 from "enumerA", and not the ones from "enumerX"
killerbot:
Issue 2 :
Type :
--- Code: ---Bta.Set(
--- End code ---
It give in the tooltip 3 entries. But the following ones should not be there :
Set(bool value)
Set(int value)
It should only be : Set(T value) (see more on this in Issue3 below)
killerbot:
Issue 3.
Closely related to Issue2, assume the 2 entries that should not be there would be gone, then it would show :
Set(T value)
But we already know it is a template instantiated with enumerA, so ultimately it should show in the tooltip :
Set(enumerA value)
killerbot:
Improvement :
In case the parameter in a method whose turn it is to be entered is an enumeration, it might be interesting to directly show the completion drop down with the possible enum values, now you first need to type some first characters before the completion is going to help you.
a.Set( --> show the drop down with the 2 enum possibilities instead of the tooltip saying it is an enumerA.
What do you think ?
Navigation
[0] Message Index
[#] Next page
Go to full version