mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed fixit location for usings when file has scoped usings
This commit is contained in:
parent
c523a73860
commit
1cb91c304b
3 changed files with 19 additions and 0 deletions
|
@ -55,17 +55,34 @@ public:
|
|||
class BfUsingFinder : public BfFixitFinder
|
||||
{
|
||||
public:
|
||||
int mFromIdx;
|
||||
int mLastIdx;
|
||||
|
||||
public:
|
||||
BfUsingFinder()
|
||||
{
|
||||
mLastIdx = 0;
|
||||
mFromIdx = -1;
|
||||
}
|
||||
|
||||
virtual void Visit(BfUsingDirective* usingDirective) override
|
||||
{
|
||||
mLastIdx = FindLineStartAfter(usingDirective->GetSourceData(), usingDirective->GetSrcEnd());
|
||||
}
|
||||
|
||||
virtual void Visit(BfNamespaceDeclaration* namespaceDecl) override
|
||||
{
|
||||
if (mFromIdx != -1)
|
||||
{
|
||||
if ((mFromIdx < namespaceDecl->mSrcStart) || (mFromIdx >= namespaceDecl->mSrcEnd))
|
||||
{
|
||||
// Not inside
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BfFixitFinder::Visit(namespaceDecl);
|
||||
}
|
||||
};
|
||||
|
||||
NS_BF_END
|
Loading…
Add table
Add a link
Reference in a new issue