Skip to content

Source links in result viewer do not handle pseudo-locations correctly #545

@max-schaefer

Description

@max-schaefer

Describe the bug
In CodeQL, it is a common idiom to assign entities that do not have a real source location a pseudo-location at line 0, column 0 of a file with the empty path (see here for an example). The QL4E result viewer understood this and did not make such entities clickable, but the VSCode result viewer does not seem to handle them specially. Clicking on them does nothing, but in the console you can see a file-system error EntryIsADirectory.

To Reproduce
Run the following quick query:

class A extends int {
  A() { this = 1 }

  predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) {
    path = "" and
    sl = 0 and
    sc = 0 and
    el = 0 and
    ec = 0
  }
}

select any(A a)

The result will be a single row, with a single column 1. The column is rendered as a link, but clicking on it does nothing (except cause an error in the console, as mentioned above).

Expected behavior

The column should not be clickable.

Additional context

This is on v1.3.2.

Metadata

Metadata

Assignees

Labels

QL4E parityThis issue corresponds to a feature from QL4E not yet implemented for VSCodeVSCodebugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions