Skip to content

Quick-eval targets ending in a comment are deemed invalid #743

Open
@tausbn

Description

@tausbn

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)

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