From f2eec024cab1ec4c597ad70ae59531338a192b11 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Wed, 22 May 2024 15:06:11 +0200 Subject: [PATCH] php scope migration (#2342) ## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --- packages/cursorless-engine/src/languages/php.ts | 6 ------ queries/php.scm | 13 +++++++++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/cursorless-engine/src/languages/php.ts b/packages/cursorless-engine/src/languages/php.ts index 9a19538108..72b3defebc 100644 --- a/packages/cursorless-engine/src/languages/php.ts +++ b/packages/cursorless-engine/src/languages/php.ts @@ -63,12 +63,6 @@ function castTypeExtractor( const nodeMatchers: Partial< Record > = { - name: [ - "assignment_expression[left]", - "class_declaration[name]", - "function_definition[name]", - "method_declaration[name]", - ], type: cascadingMatcher( trailingMatcher(["~cast_expression[type]"]), matcher(patternFinder("cast_expression[type]"), castTypeExtractor), diff --git a/queries/php.scm b/queries/php.scm index c31bd7e2e0..6de382a5b4 100644 --- a/queries/php.scm +++ b/queries/php.scm @@ -84,3 +84,16 @@ (function_call_expression) (object_creation_expression) ] @functionCall + +(assignment_expression + left: (_) @name +) @_.domain +(class_declaration + name: (_) @name +) @_.domain +(function_definition + name: (_) @name +) @_.domain +(method_declaration + name: (_) @name +) @_.domain