Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

CC toolbar enhancement

<< < (2/5) > >>

sbezgodov:

--- Quote from: MortenMacFly on March 18, 2010, 02:32:50 pm ---
--- Quote from: oBFusCATed on March 18, 2010, 02:17:24 pm ---Do you sort the Visual Assist style combo? If not please do it, because it is very helpful :)

--- End quote ---
But make it configurable :D. Because often methods are sorted/grouped by functionality which would get lost if always sorted alphabetically.

--- End quote ---
Yes, combos are sorted alphabetically case insensitive.
Do you mean to add a toolbar menu button, where you can choose how to display items in comboboxes?

sbezgodov:

--- Quote from: ollydbg on March 18, 2010, 03:13:42 pm ---I'm thinking about parsing: using namespace statement like:

ParserThread::ParseBufferForNamespaces

I personally think: we can hold these information when we doing the batch parsing, so, these information can be directly retrieved from the Tokentree.

Any body can understand my idea??, sorry if I'm not explain well.

--- End quote ---

I thought about it, but fear to change anything in Token or TokenTree. :) Is it good idea to store token implementation start/end lines in array or better hold this information in tokens tree? Multiple impl. start/end lines used only for namespaces.

ollydbg:

--- Quote ---Is it good idea to store token implementation start/end lines in array or better hold this information in tokens tree? Multiple impl. start/end lines used only for namespaces.
--- End quote ---
Sorry, I'm not quite understand your idea. Currently, a Token structure is something like:


--- Code: ---class Token : public BlockAllocated<Token, 10000>
{
    friend class TokensTree;
    public:
        Token();
        Token(const wxString& name, unsigned int file, unsigned int line);
        ~Token();

        void AddChild(int child);
        void RemoveChild(int child);
        wxString GetNamespace() const;
        bool InheritsFrom(int idx) const;
        wxString DisplayName() const;
        wxString GetTokenKindString() const;
        wxString GetTokenScopeString() const;
        wxString GetFilename() const;
        wxString GetImplFilename() const;
        inline unsigned long GetTicket() const { return m_Ticket; }
        bool MatchesFiles(const TokenFilesSet& files);

        bool SerializeIn(wxInputStream* f);
        bool SerializeOut(wxOutputStream* f);
        int GetSelf()         { return m_Self; } // current index in the tree
        wxString GetParentName();
        Token* GetParentToken();
        TokensTree* GetTree() { return m_pTree; }

        wxString      m_Type;       // this is the return value (if any): e.g. const wxString&
        wxString      m_ActualType; // this is what the parser believes is the actual return value: e.g. wxString
        wxString      m_Name;
        wxString      m_Args;
        wxString      m_StrippedArgs;
        wxString      m_AncestorsString; // all ancestors comma-separated list
        wxString      m_TemplateArgument;
        unsigned int  m_FileIdx;
        unsigned int  m_Line;
        unsigned int  m_ImplFileIdx;
        unsigned int  m_ImplLine;      // where the token was met
        unsigned int  m_ImplLineStart; // if token is impl, opening brace line
        unsigned int  m_ImplLineEnd;   // if token is impl, closing brace line
        TokenScope    m_Scope;
        TokenKind     m_TokenKind;
        bool          m_IsOperator;
        bool          m_IsLocal;       // found in a local file?
        bool          m_IsTemp;        // if true, the tree deletes it in FreeTemporaries()
        bool          m_IsConst;       // the member method is const (yes/no)

        int           m_ParentIndex;
        TokenIdxSet   m_Children;
        TokenIdxSet   m_Ancestors;
        TokenIdxSet   m_DirectAncestors;
        TokenIdxSet   m_Descendants;

        wxArrayString m_Aliases; // used for namespace aliases

        void*         m_pUserData; // custom user-data (the classbrowser expects it to be a pointer to a cbProject)

    protected:
        TokensTree*   m_pTree;
        int           m_Self; // current index in the tree
        unsigned long m_Ticket;

        static unsigned long GetTokenTicket();
};

--- End code ---

So, You means that the same Tokens(used form, especially they used have different imp start line and end line) can be merged to one Token?

sbezgodov:

--- Quote from: ollydbg on March 18, 2010, 04:07:08 pm ---So, You means that the same Tokens(used form, especially they used have different imp start line and end line) can be merged to one Token?

--- End quote ---

Yes, i mean merging exactly to one token. Or make special container  in tokentree for additional namespaces information.

Loaden:
Great, works well.
Thanks!
----------------------
Oh, I found a bug: can not find the global functions.

--- Code: ---#include <iostream>

using namespace std;

class A
{
public:
    void func1() {}
    void func2() {}
    void func3() {}
};

class B
{
public:
    void func1() {}
    void func2() {}
    void func3() {}
};

class C
{
public:
    void func1() {}
    void func2() {}
    void func3() {}
};

// can not jump to here
void func1() {}
void func2() {}
void func3() {}

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version