Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Rename symbol dialog not properly scoped to func

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
CypherSignal Posted - Feb 16 2024 : 09:54:36 AM
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)
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 16 2024 : 11:26:35 AM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000