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)