Skip to content

Graph viewer: node names are not escaped #1333

@nickrolfe

Description

@nickrolfe

In a graph query being displayed by the graph viewer, when the value for semmle.label contains backslashes, they appear to be interpreted by graphviz, when I would expect them to appear as literal backslashes. Here's an example:

/**
 * @kind graph
 * @id foo
 */
query predicate nodes(string node, string attr, string val) {
  node in ["foo\\bar", "x\\ny", "p\\q\\r\\s"] and
  attr = "semmle.label" and
  val = node
}

query predicate edges(string a, string b, string attr, string val) { none() }

It looks like this:
image

I would expect to see the actual string x\ny rather than x<newline>y.

This affected me when I was using the graph viewer to visualize parsed regexes, which often contain backslashes.

Version

VS Code: 1.66.2
CodeQL extension: 1.6.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    VSCodebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions