ctags icon indicating copy to clipboard operation
ctags copied to clipboard

JavaScript: missing some properties

Open masatake opened this issue 1 year ago • 3 comments

g.js

function g() {
    return ({
        props: { key: "key" },
        columns: [
            { title: "sir" },
        ],
    });    
}

output

~/bin/ctags --options=NONE --sort=no -o - /tmp/g.js 
ctags: Notice: No options will be read from files or environment
g	/tmp/g.js	/^function g() {$/;"	f
anonymousObject322330e60105	/tmp/g.js	/^            { title: "sir" },$/;"	v	function:g
title	/tmp/g.js	/^            { title: "sir" },$/;"	p	variable:g.anonymousObject322330e60105

I wonder why ctags doesn't extract props, key, and columns.

masatake avatar Feb 17 '25 10:02 masatake

Maybe I introduced this bug when supporting destructuring binding.

masatake avatar Feb 17 '25 10:02 masatake

ctags doesn't extract props, key, and columns because they are inside an anonymous returned object, not explicitly assigned to a named variable. Try assigning the object to a variable before returning it, or use Universal Ctags for better JavaScript support.

davidmicahdaniels avatar Feb 18 '25 09:02 davidmicahdaniels

ctags doesn't extract props, key, and columns because they are inside an anonymous returned object, not explicitly assigned to a named variable.

I wonder why ctags extracts title in that case.

masatake avatar Feb 18 '25 10:02 masatake