1
0
Fork 0
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:
Brian Fiete 2022-06-01 16:36:58 -07:00
parent c523a73860
commit 1cb91c304b
3 changed files with 19 additions and 0 deletions

View file

@ -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