Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Rename symbol dialog not properly scoped to func
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

CypherSignal
Starting Member

1 Posts

Posted - Feb 16 2024 :  09:54:36 AM  Show Profile  Reply with Quote
In C++, I found an issue when I have a variable declaration, inside of a namespace, which includes the string "~(". This seems to break some other parsing of symbols in that namespace, resulting in some malfunctions. For example, when trying to use the Rename Variable UI on a function-local variable, VAX will suggest any usage of that variable in the entire file as candidates to be renamed, and also not automatically select the usages of the variable in the function (as opposed to only suggesting usages of that variable in the function as candidates, and automatically select all usages of the variable in the function).

The following code snippet demonstrates the issue. This can be used in a standalone CPP file, even absent any project or solution (eg open Visual Studio without code) on the latest public build of VAX (2511) and on VS2019 and VS2022:

---
#include <stdint.h>

// Attempt to do a rename of in_uSize or idx in FuncA or FuncB
// Notice that the tool attempts to rename any use of idx or in_usize in the file, instead of just usages of the symbol inside of the function.
// If you remove the "namespace Test" scope, and try again, the Rename/search operates properly
// OR, if you add a space after the ~ in the declaration of kMask, the Rename/search operates properly

namespace Test
{
    uint32_t kMask = ~(1);
    // uint32_t kMask = ~ (1); // comment out above line, and uncomment this line, to get proper search functionality

    uint32_t FuncA(uint32_t in_uSize)
    {
        uint32_t idx = in_uSize + 31;
        return idx - in_uSize;
    }

    uint32_t FuncB(uint32_t in_uSize)
    {
        uint32_t idx = 31 - in_uSize;
        return in_uSize + idx;
    }
} // namespace Test

---

(Note: this was previously reported to Whole Tomato support privately, and already filed as case 164183)

Edited by - CypherSignal on Feb 16 2024 09:55:14 AM

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Feb 16 2024 :  11:26:35 AM  Show Profile  Reply with Quote
Thank you again for the very clear code example, that could have been hard to pin down without a good example, simply because make a small change and the bug can disappear. Thankfully this makes it relatively easy to work around, but still a bug that could do with being fixed properly.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000