Inconsistent highlight color for casts

Open
#1,194 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Reproduce the issue by opening ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql at commit 509a3493b6b1b742bc5408c9f38e9f423b727174 and compare the two MergedPathNode casts. Trace the VS Code extension's syntax-highlighting handling for these casts; done means both occurrences receive the same color.

Written by the indexing model from the issue text.

Description

bug VSCode

Describe the bug
Casts are not consistently colored. Sometimes they are green-ish and sometimes blue-ish.

Version
The CodeQL and VS Code version in which the bug occurs.

CodeQL extension version: 1.6.0
CodeQL CLI version: 2.8.2
Platform: darwin arm64

Version: 1.65.0 (Universal)
Commit: b5205cc8eb4fbaa726835538cd82372cc0222d43
Date: 2022-03-02T11:11:20.886Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.3.0

To reproduce

  1. Open ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql from the CodeQL repo (current commit ID 509a3493b6b1b742bc5408c9f38e9f423b727174)
  2. Scroll to the bottom
  3. In the following line
    select sinkAsArgumentIndirection(sinkNode.getNode()), TPathNode1(sourceNode).(MergedPathNode), TPathNode2(sinkNode).(MergedPathNode),
    
    the first occurrence (MergedPathNode) is green-ish and the second blue-ish.

Expected behavior
Consistent coloring of casts.

Additional context

Screenshot 2022-03-08 at 10 41 03

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

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.