Skip to content

Conversation

@kiyoon
Copy link
Collaborator

@kiyoon kiyoon commented Jun 14, 2025

Addresses #86 (comment)

@kiyoon kiyoon requested a review from Copilot June 14, 2025 09:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces new query patterns to recognize TypeScript type and interface property signatures as parameters.

  • Added queries for @parameter.inner on property signatures.
  • Added multiple patterns for @parameter.outer to handle object_type and interface_body constructs with varying separator placements.

Comment on lines +56 to +102
([
(object_type
"," @_start
.
(property_signature) @_end)
(interface_body
"," @_start
.
(property_signature) @_end)
]
(#make-range! "parameter.outer" @_start @_end))

([
(object_type
(property_signature) @_start
.
"," @_end)
(interface_body
(property_signature) @_start
.
"," @_end)
]
(#make-range! "parameter.outer" @_start @_end))

([
(object_type
";" @_start
.
(property_signature) @_end)
(interface_body
";" @_start
.
(property_signature) @_end)
]
(#make-range! "parameter.outer" @_start @_end))

([
(object_type
(property_signature) @_start
.
";" @_end)
(interface_body
(property_signature) @_start
.
";" @_end)
]
(#make-range! "parameter.outer" @_start @_end))
Copy link

Copilot AI Jun 14, 2025

Choose a reason for hiding this comment

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

The comma/semicolon separator patterns for object_type and interface_body are duplicated. Consider refactoring or adding clarifying comments to explain the necessity for the similar blocks to improve maintainability.

Suggested change
([
(object_type
"," @_start
.
(property_signature) @_end)
(interface_body
"," @_start
.
(property_signature) @_end)
]
(#make-range! "parameter.outer" @_start @_end))
([
(object_type
(property_signature) @_start
.
"," @_end)
(interface_body
(property_signature) @_start
.
"," @_end)
]
(#make-range! "parameter.outer" @_start @_end))
([
(object_type
";" @_start
.
(property_signature) @_end)
(interface_body
";" @_start
.
(property_signature) @_end)
]
(#make-range! "parameter.outer" @_start @_end))
([
(object_type
(property_signature) @_start
.
";" @_end)
(interface_body
(property_signature) @_start
.
";" @_end)
]
(#make-range! "parameter.outer" @_start @_end))
; Define a reusable macro for handling separators (comma/semicolon) and property_signature
(defmacro separator_pattern (separator)
([
(object_type
separator @_start
.
(property_signature) @_end)
(interface_body
separator @_start
.
(property_signature) @_end)
]
(#make-range! "parameter.outer" @_start @_end)))
; Use the reusable macro for comma separator
(separator_pattern ",")
; Use the reusable macro for semicolon separator
(separator_pattern ";")

Copilot uses AI. Check for mistakes.
@kiyoon kiyoon enabled auto-merge (squash) June 14, 2025 09:43
@kiyoon kiyoon disabled auto-merge June 14, 2025 09:43
@kiyoon kiyoon merged commit 89ebe73 into master Jun 14, 2025
4 of 6 checks passed
@clason clason deleted the feat-ecma/parameter-type-interface branch November 8, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant