ctags icon indicating copy to clipboard operation
ctags copied to clipboard

JavaScript: destructing in function signature

Open masatake opened this issue 1 year ago • 1 comments

h.js:

const PackageList = ({packages}) => packages ? 1 : null;

output:

$ ~/bin/ctags --options=NONE  --fields=+S --sort=no -o - /tmp/h.js 
ctags: Notice: No options will be read from files or environment
packages	/tmp/h.js	/^const PackageList = ({packages}) => packages ? 1 : null;$/;"	p	function:PackageList
PackageList	/tmp/h.js	/^const PackageList = ({packages}) => packages ? 1 : null;$/;"	f	signature:()

signature: of PackageeList should be ({package}). package should not be tagged till we add parameter kind to the parser.

masatake avatar Feb 17 '25 10:02 masatake

To solve this issue, we need more flexible look-ahead mechanism that Cxx parser has. The input is too similar with with

const PackageList = ({packages})

We cannot say anything about ({packages}) till we see (or don't see) =>.

masatake avatar Feb 17 '25 14:02 masatake