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

CC toolbar enhancement

<< < (3/5) > >>

Loaden:
I change xrc's size, like:

--- Code: ---<?xml version="1.0" ?>
<resource>
  <object class="wxToolBarAddOn" name="codecompletion_toolbar">
    <object class="wxChoice" name="chcCodeCompletionScope">
      <content/>
  <size>220,-1</size>
    </object>
    <object class="wxChoice" name="chcCodeCompletionFunction">
      <content/>
  <size>690,-1</size>
    </object>
  </object>
</resource>
--- End code ---


[attachment deleted by admin]

sbezgodov:

--- Quote from: Loaden on March 19, 2010, 06:10:02 am ---Oh, I found a bug: can not find the global functions.

--- End quote ---

Seems that this bug related to parser, because these functions are not displayed in symbols browser too. I use svn6178 revision.

Any suggestions how to make toolbar more configurable, please. Which sort orders do we need? Is manual resizing needed? Is item coloring for different token types needed?

Loaden:

--- Quote from: sbezgodov on March 19, 2010, 11:16:30 am ---
--- Quote from: Loaden on March 19, 2010, 06:10:02 am ---Oh, I found a bug: can not find the global functions.

--- End quote ---
Seems that this bug related to parser, because these functions are not displayed in symbols browser too. I use svn6178 revision.

--- End quote ---
Is not the case, in here, this tip is correct!

[attachment deleted by admin]

Loaden:
If I put the top of the global functions, then all functions are normal!

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

using namespace std;

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

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() {}
};

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

--- End code ---
And if change to:

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

// can not jump to here
void func1() {}
void func2() {}
void func3() {}
--- End code ---
Now, it's unwork.

WOW! i see, this is indeed parser problem!
If change global function's name to :

--- Code: ---// can not jump to here
void gfunc1() {}
void gfunc2() {}
void gfunc3() {}
--- End code ---
then, that's work well now.

sbezgodov:
Following patch formally fixes this bug, Loaden.


--- Code: ---Index: token.cpp
===================================================================
--- token.cpp (revision 6178)
+++ token.cpp (working copy)
@@ -521,9 +521,7 @@
         if (!curToken)
             continue;
 
-        if (   (   (parent < 0)
-                || (curToken->m_ParentIndex == parent) )
-            && (curToken->m_TokenKind & kindMask) )
+        if ((curToken->m_ParentIndex == parent) && (curToken->m_TokenKind & kindMask))
         {
             return result;
         }


--- End code ---

But it makes another questions. Can this patch raise another bugs? :) And why we should return first found token if searched token parent is -1 (Global namespace) ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version