Review Request 120086: Fix cursorSpellingNameRange range for out-of-line functions.

Kevin Funk kfunk at kde.org
Sat Sep 13 00:08:38 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120086/#review66385
-----------------------------------------------------------

Ship it!


The problem without the code inside `makeId` is the following:

Consider the file test.cpp:
```cpp
class Foo {
    void myfunction();
};

void Foo::myfunction()
{
}
```

Now running `duchainify test.cpp -f all-declarations-and-uses-and-AST --dump-symboltable` results in:
```
PersistentSymbolTable:
Item in symbol-table: "Foo" - localIndex: 1 - url: "test.cpp" - range: [(0, 6) ,  (0, 9) ]  
Item in symbol-table: "myfunction" - localIndex: 3 - url: "test.cpp" - range: [(4, 10) ,  (4, 20) ]  
Item in symbol-table: "Foo::myfunction" - localIndex: 2 - url: "test.cpp" - range: [(1, 9) ,  (1, 19) ]
```

`myfunction` is obviously wrong here, it should be inside the `Foo` scope. That's why we either need the hack from oldcpp (what I did) or a helper context.

Anyway. Commit this for now, I'll take care of fixing the scoping issue.

- Kevin Funk


On Sept. 12, 2014, 2:36 p.m., Sergey Kalinichev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120086/
> -----------------------------------------------------------
> 
> (Updated Sept. 12, 2014, 2:36 p.m.)
> 
> 
> Review request for KDevelop and Kevin Funk.
> 
> 
> Repository: kdev-clang
> 
> 
> Description
> -------
> 
> This was accidentally broken by:
> f17866db1bc24c198e87c028065796959f6dd135
> Author: Kevin Funk <kfunk at kde.org>
> Date:   Mon Aug 4 16:53:06 2014 +0200
> 
>     Also fix ranges for operator functions
> 
> 
> Diffs
> -----
> 
>   duchain/tuduchain.cpp 7d9b021 
>   tests/files/functiondefinitiondeclarations.cpp fe4050e 
> 
> Diff: https://git.reviewboard.kde.org/r/120086/diff/
> 
> 
> Testing
> -------
> 
> All tests pass.
> 
> 
> Thanks,
> 
> Sergey Kalinichev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140913/003fc7cb/attachment-0001.html>


More information about the KDevelop-devel mailing list