Skip to content

Unified: Extract init keywords - #22641

Merged
asgerf merged 1 commit into
github:mainfrom
hvitved:unified/constructor-name-node
Sep 22, 2026
Merged

asgerf merged 1 commit into
github:mainfrom
hvitved:unified/constructor-name-node

Conversation

@hvitved

@hvitved hvitved commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Useful for resolving super.init calls, which can then be handled like any other call.

@hvitved
hvitved force-pushed the unified/constructor-name-node branch from b9962e5 to d89d9e2 Compare September 21, 2026 18:38
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Sep 21, 2026
@hvitved
hvitved marked this pull request as ready for review September 21, 2026 18:55
@hvitved
hvitved requested review from a team as code owners September 21, 2026 18:55
Copilot AI balanced review requested due to automatic review settings September 21, 2026 18:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused mapping change is consistent with the AST schema and covered by updated generated expectations.

Review effort: Balanced
Findings: None

What changed in this PR

Extracts Swift init keywords as constructor name nodes, enabling future constructor-call resolution.

Changes:

  • Maps initializerDecl.initKeyword to constructor_declaration.name_node.
  • Updates generated extractor and control-flow expectations.
File Description
unified/​extractor/​src/​languages/​swift/​swift.rs Extracts the init keyword as an identifier.
unified/​extractor/​tests/​corpus/​swift/​types/​constructor-with-parameters.output Updates generated constructor output.
unified/​extractor/​tests/​corpus/​swift/​types/​class-with-initializer.output Updates generated initializer output.
unified/​ql/​test/​library-tests/​controlflow/​cfg.swift Marks new initializer identifiers as intentionally absent from CFGs.
unified/​ql/​test/​library-tests/​controlflow/​cfg.expected Updates generated control-flow expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@asgerf asgerf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Bug is tracked here https://github.com/github/codeql-team/issues/4882 Nevermind this was a different bug.

@asgerf
asgerf merged commit 3d3ca4c into github:main Sep 22, 2026
8 checks passed
@hvitved
hvitved deleted the unified/constructor-name-node branch September 22, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants