I’m developing a plugin for Rider and I need to access the runtime values of variables during a paused debugging session. Specifically, I want to inspect the value of a String variable and replace placeholders in it using values from another object (like a dictionary or builder).
Currently, I use the following approach:
val nodes = XDebuggerTreeActionBase.getSelectedNodes(e.dataContext)
nodes.filterIsInstance<XValueNodeImpl>().forEach { node ->
when (builder.classifyNode(node)) {
NodeType.SqlText -> builder.sql = node.rawValue?.toString().orEmpty()
else -> builder.collectParams(node)
}
}
The problem: rawValue does not contain the actual full value of the variable. If the string is too long, it gets truncated (e.g., ends with ...).
My questions:
- Is there any way to retrieve the full, actual runtime value of a variable (especially strings) while debugging?
- Is there a different API or method I should be using to evaluate or extract the true value, not just what’s displayed in the UI?
Use case for context:
var parm = new ParmBuilder();
var sql = $"SELECT * FROM table WHERE id = {parm.AddParm(id)}";
Any pointer to the right API, approach or example would be really appreciated.