vscode-codeql icon indicating copy to clipboard operation
vscode-codeql copied to clipboard

Quick-eval targets ending in a comment are deemed invalid

Open tausbn opened this issue 4 years ago • 1 comments

Describe the bug If the piece of code selected for quick eval ends in a comment (// or /* ... */), then quick-eval fails. This is especially troublesome if one is selecting a subset of lines using the left margin, and the last of these happens to have a comment attached.

Comments inside the selected block are unproblematic. The problem only arises at the end of a selection.

To Reproduce Put the following code in a suitable QL buffer. Select the line starting with result and do a quick-eval.

int getRandomNumber() {
  result = 4 // chosen by fair dice roll. guaranteed to be random.
}

Expected behavior The comment is ignored, and quick-eval executes successfully

Additional context Seen using CodeQL extension version 1.3.10 and CLI version 2.4.2+202102021519plus (built locally)

tausbn avatar Feb 02 '21 15:02 tausbn

Thanks for the bug report. I can reproduce. This looks like an error in the query server.

aeisenberg avatar Feb 02 '21 18:02 aeisenberg