You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having a function/method named 'get' or 'set' seems to break the parser in a couple of situations (possibly/probably related to how the parser is trying to handle ES6 class getters/setters).
All of my example cases illustrate only with 'get', but the same symptoms occur if you replace 'get' with 'set'.
General Information
The name of the parser: jscript
The command line you used to run ctags:
$ ctags --options=NONE <filename>
The version of ctags (I realize I'm not up-to-date but a perusal of changes to the jscript parser between then and now suggested that this issue should still be present):
definedWithFunctionAfter NonClass.js /^function definedWithFunctionAfter() {};$/;" f
definedWithFunctionBefore NonClass.js /^function definedWithFunctionBefore() {};$/;" f
functionExpressionAfter NonClass.js /^const functionExpressionAfter = () => {};$/;" C
functionExpressionBefore NonClass.js /^const functionExpressionBefore = () => {};$/;" C
variableAfter NonClass.js /^let variableAfter = "bar";$/;" v
variableBefore NonClass.js /^let variableBefore = "foo";$/;" v
The tags output you expect:
Previous output plus the following:
get NonClass.js /^function get() {};$/;" f
✔️ Case 2: Not using ES6 class, 'get' as function expression
All tags generated as expected
Input file:
functiondefinedWithFunctionBefore(){};constfunctionExpressionBefore=()=>{};letvariableBefore="foo";constget=function(){};// also works as arrow function // const get = () => {};functiondefinedWithFunctionAfter(){};constfunctionExpressionAfter=()=>{};letvariableAfter="bar";
Tags expected == tags actual:
definedWithFunctionAfter NonClass.js /^function definedWithFunctionAfter() {};$/;" f
definedWithFunctionBefore NonClass.js /^function definedWithFunctionBefore() {};$/;" f
functionExpressionAfter NonClass.js /^const functionExpressionAfter = () => {};$/;" C
functionExpressionBefore NonClass.js /^const functionExpressionBefore = () => {};$/;" C
get NonClass.js /^const get = function () {};$/;" f
variableAfter NonClass.js /^let variableAfter = "bar";$/;" v
variableBefore NonClass.js /^let variableBefore = "foo";$/;" v
❌ Case 3: 'get' as a method in an ES6 class, no arguments
No tag for 'get'
No tag for any method or class field following 'get'
Having a function/method named 'get' or 'set' seems to break the parser in a couple of situations (possibly/probably related to how the parser is trying to handle ES6 class getters/setters).
All of my example cases illustrate only with 'get', but the same symptoms occur if you replace 'get' with 'set'.
General Information
The name of the parser: jscript
The command line you used to run ctags:
The version of ctags (I realize I'm not up-to-date but a perusal of changes to the jscript parser between then and now suggested that this issue should still be present):
How do you get ctags binary: Ubuntu 22.04 repository (via
apt
)❌ Case 1: Not using ES6 class, "normal" function declaration of 'get'
The 'get' function gets no tag. Neither having 'get' accept arguments nor putting anything in its code block makes a difference.
The content of input file:
The tags output you are not satisfied with:
The tags output you expect:
Previous output plus the following:
✔️ Case 2: Not using ES6 class, 'get' as function expression
All tags generated as expected
Input file:
Tags expected == tags actual:
❌ Case 3: 'get' as a method in an ES6 class, no arguments
Input file:
The tags output you are not satisfied with:
The tags output you expect:
Previous output plus the following:
❌ Case 4: 'get' as a method in an ES6 class, with argument
fieldBefore
andbar
getting field tags from the definition of method 'get' despite lack of tag for 'get' itselfInput file:
The tags output you are not satisfied with:
The tags output you expect:
✔️ Case 5: proper ES6 getter
All tags generated as expected
Input file:
Tags expected == tags actual:
The text was updated successfully, but these errors were encountered: