Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Quick-eval targets ending in a comment are deemed invalid

Open
#743 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript, vscode

Research direction

Reproduce quick-eval in the VS Code CodeQL extension using the provided QL snippet, selecting the line that ends with a comment. Trace the quick-eval entry point and selection handling, then verify that comments at the end of a selection are ignored while comments inside the selection remain unaffected.

Written by the indexing model from the issue text.

Description

bug VSCode

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)

Dominant language
TypeScript
Stars
539
Forks
240
Avg merge
2d 18h
Merged PRs (30d)
37

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/vscode-codeql

All issues in github/vscode-codeql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.