File tree Expand file tree Collapse file tree
src/languagePlugins/php/exportResolver Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ describe("PHP Export resolver", () => {
1515 const mynamespace = namespaces . get ( "My\\Namespace" ) ! ;
1616 expect ( mynamespace . name ) . toBe ( "My\\Namespace" ) ;
1717 const symbols = mynamespace . symbols ;
18- expect ( symbols . length ) . toBe ( 66 ) ;
18+ expect ( ( new Set ( symbols . map ( ( s ) => s . name ) ) ) . size ) . toBe ( 66 ) ;
1919 } ) ;
2020
2121 test ( "resolves nested.php" , ( ) => {
Original file line number Diff line number Diff line change 11import type Parser from "tree-sitter" ;
2- import {
3- type ExportedNamespace ,
4- type ExportedSymbol ,
5- PHP_VARIABLE ,
6- } from "./types.ts" ;
2+ import type { ExportedNamespace , ExportedSymbol } from "./types.ts" ;
73import { INTERESTING_NODES , PHP_IDNODE_QUERY } from "./queries.ts" ;
84
95export class PHPExportResolver {
@@ -41,12 +37,6 @@ export class PHPExportResolver {
4137 continue ; // Root out false positives for variables and constants
4238 }
4339 const symType = INTERESTING_NODES . get ( child . type ) ! ;
44- if (
45- symType === PHP_VARIABLE &&
46- exports . find ( ( e ) => e . name === idNode . node . text )
47- ) {
48- continue ; // No duplicate variables
49- }
5040 exports . push ( {
5141 name : idNode . node . text ,
5242 type : symType ,
You can’t perform that action at this time.
0 commit comments